@xcpcio/core 0.75.2 → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +9 -5
- package/dist/index.d.cts +5 -2
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.mjs +9 -5
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1411,12 +1411,14 @@ function createContestIndexList(contestListJSON) {
|
|
|
1411
1411
|
class CodeforcesGymGhostDATConverter {
|
|
1412
1412
|
constructor() {
|
|
1413
1413
|
}
|
|
1414
|
-
convert(rank) {
|
|
1414
|
+
convert(rank, options) {
|
|
1415
|
+
const includeFakeRussianTeams = options?.includeFakeRussianTeams ?? false;
|
|
1416
|
+
const fakeTeamsCount = includeFakeRussianTeams ? 100 : 0;
|
|
1415
1417
|
let res = "";
|
|
1416
1418
|
res += `@contest "${rank.contest.name.getOrDefault()}"
|
|
1417
1419
|
@contlen ${Math.floor(dayjs__default.duration(rank.contest.endTime.diff(rank.contest.startTime)).asMinutes())}
|
|
1418
1420
|
@problems ${rank.contest.problems.length}
|
|
1419
|
-
@teams ${rank.teams.length +
|
|
1421
|
+
@teams ${rank.teams.length + fakeTeamsCount}
|
|
1420
1422
|
@submissions ${rank.submissions.length}
|
|
1421
1423
|
`;
|
|
1422
1424
|
rank.contest.problems.forEach((p) => {
|
|
@@ -1446,10 +1448,12 @@ class CodeforcesGymGhostDATConverter {
|
|
|
1446
1448
|
submissionsIdMap.set(team.id, mp);
|
|
1447
1449
|
}
|
|
1448
1450
|
});
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
+
if (includeFakeRussianTeams) {
|
|
1452
|
+
for (let i = 0; i < 100; i++) {
|
|
1453
|
+
res += `@t ${teamIndex},0,1,"\u041F\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043A\u043E\u043C\u0430\u043D\u0434\u0443"
|
|
1451
1454
|
`;
|
|
1452
|
-
|
|
1455
|
+
teamIndex++;
|
|
1456
|
+
}
|
|
1453
1457
|
}
|
|
1454
1458
|
rank.getSubmissions().forEach((submission) => {
|
|
1455
1459
|
const teamId = submission.teamId;
|
package/dist/index.d.cts
CHANGED
|
@@ -402,9 +402,12 @@ declare class Rank {
|
|
|
402
402
|
}
|
|
403
403
|
type Ranks = Array<Rank>;
|
|
404
404
|
|
|
405
|
+
interface Options {
|
|
406
|
+
includeFakeRussianTeams?: boolean;
|
|
407
|
+
}
|
|
405
408
|
declare class CodeforcesGymGhostDATConverter {
|
|
406
409
|
constructor();
|
|
407
|
-
convert(rank: Rank): string;
|
|
410
|
+
convert(rank: Rank, options?: Options): string;
|
|
408
411
|
private submissionStatusToCodeforcesGymDatStatus;
|
|
409
412
|
}
|
|
410
413
|
|
|
@@ -554,4 +557,4 @@ declare function isPending(status: SubmissionStatus): boolean;
|
|
|
554
557
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
555
558
|
|
|
556
559
|
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, stringToSubmissionStatus };
|
|
557
|
-
export type { Awards, Balloons, ContestIndexList, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
|
560
|
+
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.d.mts
CHANGED
|
@@ -402,9 +402,12 @@ declare class Rank {
|
|
|
402
402
|
}
|
|
403
403
|
type Ranks = Array<Rank>;
|
|
404
404
|
|
|
405
|
+
interface Options {
|
|
406
|
+
includeFakeRussianTeams?: boolean;
|
|
407
|
+
}
|
|
405
408
|
declare class CodeforcesGymGhostDATConverter {
|
|
406
409
|
constructor();
|
|
407
|
-
convert(rank: Rank): string;
|
|
410
|
+
convert(rank: Rank, options?: Options): string;
|
|
408
411
|
private submissionStatusToCodeforcesGymDatStatus;
|
|
409
412
|
}
|
|
410
413
|
|
|
@@ -554,4 +557,4 @@ declare function isPending(status: SubmissionStatus): boolean;
|
|
|
554
557
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
555
558
|
|
|
556
559
|
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, stringToSubmissionStatus };
|
|
557
|
-
export type { Awards, Balloons, ContestIndexList, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
|
560
|
+
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.d.ts
CHANGED
|
@@ -402,9 +402,12 @@ declare class Rank {
|
|
|
402
402
|
}
|
|
403
403
|
type Ranks = Array<Rank>;
|
|
404
404
|
|
|
405
|
+
interface Options {
|
|
406
|
+
includeFakeRussianTeams?: boolean;
|
|
407
|
+
}
|
|
405
408
|
declare class CodeforcesGymGhostDATConverter {
|
|
406
409
|
constructor();
|
|
407
|
-
convert(rank: Rank): string;
|
|
410
|
+
convert(rank: Rank, options?: Options): string;
|
|
408
411
|
private submissionStatusToCodeforcesGymDatStatus;
|
|
409
412
|
}
|
|
410
413
|
|
|
@@ -554,4 +557,4 @@ declare function isPending(status: SubmissionStatus): boolean;
|
|
|
554
557
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
555
558
|
|
|
556
559
|
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, stringToSubmissionStatus };
|
|
557
|
-
export type { Awards, Balloons, ContestIndexList, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
|
560
|
+
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.mjs
CHANGED
|
@@ -1380,12 +1380,14 @@ function createContestIndexList(contestListJSON) {
|
|
|
1380
1380
|
class CodeforcesGymGhostDATConverter {
|
|
1381
1381
|
constructor() {
|
|
1382
1382
|
}
|
|
1383
|
-
convert(rank) {
|
|
1383
|
+
convert(rank, options) {
|
|
1384
|
+
const includeFakeRussianTeams = options?.includeFakeRussianTeams ?? false;
|
|
1385
|
+
const fakeTeamsCount = includeFakeRussianTeams ? 100 : 0;
|
|
1384
1386
|
let res = "";
|
|
1385
1387
|
res += `@contest "${rank.contest.name.getOrDefault()}"
|
|
1386
1388
|
@contlen ${Math.floor(dayjs.duration(rank.contest.endTime.diff(rank.contest.startTime)).asMinutes())}
|
|
1387
1389
|
@problems ${rank.contest.problems.length}
|
|
1388
|
-
@teams ${rank.teams.length +
|
|
1390
|
+
@teams ${rank.teams.length + fakeTeamsCount}
|
|
1389
1391
|
@submissions ${rank.submissions.length}
|
|
1390
1392
|
`;
|
|
1391
1393
|
rank.contest.problems.forEach((p) => {
|
|
@@ -1415,10 +1417,12 @@ class CodeforcesGymGhostDATConverter {
|
|
|
1415
1417
|
submissionsIdMap.set(team.id, mp);
|
|
1416
1418
|
}
|
|
1417
1419
|
});
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
+
if (includeFakeRussianTeams) {
|
|
1421
|
+
for (let i = 0; i < 100; i++) {
|
|
1422
|
+
res += `@t ${teamIndex},0,1,"\u041F\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u043A\u043E\u043C\u0430\u043D\u0434\u0443"
|
|
1420
1423
|
`;
|
|
1421
|
-
|
|
1424
|
+
teamIndex++;
|
|
1425
|
+
}
|
|
1422
1426
|
}
|
|
1423
1427
|
rank.getSubmissions().forEach((submission) => {
|
|
1424
1428
|
const teamId = submission.teamId;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcpcio/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.76.0",
|
|
5
5
|
"description": "The core library for XCPCIO",
|
|
6
6
|
"author": "Dup4 <hi@dup4.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"papaparse": "^5.5.3",
|
|
43
43
|
"string-width": "^8.1.0",
|
|
44
44
|
"xlsx-js-style": "^1.2.0",
|
|
45
|
-
"@xcpcio/types": "0.
|
|
45
|
+
"@xcpcio/types": "0.76.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@babel/types": "^7.28.5",
|