@xcpcio/core 0.30.0 → 0.31.1

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 CHANGED
@@ -244,12 +244,16 @@ class CodeforcesGymGhostDATConverter {
244
244
  const teamId = submission.teamId;
245
245
  const problemId = submission.problemId;
246
246
  const problem = rank.contest.problemsMap.get(problemId);
247
+ const teamIndex2 = teamIdMap.get(teamId);
247
248
  if (!problem) {
248
249
  return;
249
250
  }
251
+ if (!teamIndex2) {
252
+ return;
253
+ }
250
254
  const status = this.submissionStatusToCodeforcesGymDatStatus(submission.status);
251
255
  submissionsIdMap.get(teamId).set(problemId, submissionsIdMap.get(teamId).get(problemId) + 1);
252
- res += `@s ${teamIdMap.get(teamId)},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestampToSecond},${status}
256
+ res += `@s ${teamIndex2},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestampToSecond},${status}
253
257
  `;
254
258
  });
255
259
  return res;
package/dist/index.mjs CHANGED
@@ -214,12 +214,16 @@ class CodeforcesGymGhostDATConverter {
214
214
  const teamId = submission.teamId;
215
215
  const problemId = submission.problemId;
216
216
  const problem = rank.contest.problemsMap.get(problemId);
217
+ const teamIndex2 = teamIdMap.get(teamId);
217
218
  if (!problem) {
218
219
  return;
219
220
  }
221
+ if (!teamIndex2) {
222
+ return;
223
+ }
220
224
  const status = this.submissionStatusToCodeforcesGymDatStatus(submission.status);
221
225
  submissionsIdMap.get(teamId).set(problemId, submissionsIdMap.get(teamId).get(problemId) + 1);
222
- res += `@s ${teamIdMap.get(teamId)},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestampToSecond},${status}
226
+ res += `@s ${teamIndex2},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestampToSecond},${status}
223
227
  `;
224
228
  });
225
229
  return res;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcpcio/core",
3
- "version": "0.30.0",
3
+ "version": "0.31.1",
4
4
  "description": "XCPCIO Core",
5
5
  "author": "Dup4 <lyuzhi.pan@gmail.com>",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  "lodash": "^4.17.21",
45
45
  "string-width": "^6.1.0",
46
46
  "xlsx-js-style": "^1.2.0",
47
- "@xcpcio/types": "0.30.0"
47
+ "@xcpcio/types": "0.31.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@babel/types": "^7.22.4",
package/src/export/cf.ts CHANGED
@@ -64,15 +64,20 @@ export class CodeforcesGymGhostDATConverter {
64
64
  const teamId = submission.teamId;
65
65
  const problemId = submission.problemId;
66
66
  const problem = rank.contest.problemsMap.get(problemId);
67
+ const teamIndex = teamIdMap.get(teamId);
67
68
 
68
69
  if (!problem) {
69
70
  return;
70
71
  }
71
72
 
73
+ if (!teamIndex) {
74
+ return;
75
+ }
76
+
72
77
  const status = this.submissionStatusToCodeforcesGymDatStatus(submission.status);
73
78
  submissionsIdMap.get(teamId)!.set(problemId, submissionsIdMap.get(teamId)!.get(problemId)! + 1);
74
79
 
75
- res += `@s ${teamIdMap.get(teamId)},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestampToSecond},${status}\n`;
80
+ res += `@s ${teamIndex},${problem.label},${submissionsIdMap.get(teamId)?.get(problemId)},${submission.timestampToSecond},${status}\n`;
76
81
  });
77
82
 
78
83
  return res;