@xcpcio/core 0.40.0 → 0.40.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
@@ -527,6 +527,7 @@ class ProblemStatistics {
527
527
  this.submittedNum = 0;
528
528
  this.attemptedNum = 0;
529
529
  this.ignoreNum = 0;
530
+ this.se = 0;
530
531
  this.firstSolveSubmissions = [];
531
532
  this.lastSolveSubmissions = [];
532
533
  }
@@ -537,6 +538,7 @@ class ProblemStatistics {
537
538
  this.submittedNum = 0;
538
539
  this.attemptedNum = 0;
539
540
  this.ignoreNum = 0;
541
+ this.se = 0;
540
542
  this.firstSolveSubmissions = [];
541
543
  this.lastSolveSubmissions = [];
542
544
  }
@@ -546,6 +548,11 @@ class ProblemStatistics {
546
548
  }
547
549
  return calcDirt(this.attemptedNum, this.acceptedNum);
548
550
  }
551
+ calcSE(totalTeams) {
552
+ const res = (totalTeams - this.acceptedNum) / totalTeams;
553
+ this.se = Math.round(res * 100) / 100;
554
+ return this.se;
555
+ }
549
556
  }
550
557
  class Problem {
551
558
  constructor() {
@@ -1550,6 +1557,7 @@ class Rank {
1550
1557
  this.rankStatistics.effectiveTeamNum = this.teams.filter((t) => t.isEffectiveTeam).length;
1551
1558
  this.rankStatistics.totalTeamNum = this.teams.length;
1552
1559
  this.teams.forEach((t) => t.calcSE(this.rankStatistics.totalTeamNum));
1560
+ this.contest.problems.forEach((p) => p.statistics.calcSE(this.rankStatistics.totalTeamNum));
1553
1561
  this.buildAwards();
1554
1562
  this.teams.forEach((t) => t.calcAwards(this.contest.awards?.get(this.options.group)));
1555
1563
  this.teams.forEach((t) => t.postProcessPlaceChartPoints());
package/dist/index.d.ts CHANGED
@@ -39,9 +39,11 @@ declare class ProblemStatistics {
39
39
  ignoreNum: number;
40
40
  firstSolveSubmissions: Submissions;
41
41
  lastSolveSubmissions: Submissions;
42
+ se: number;
42
43
  constructor();
43
44
  reset(): void;
44
45
  get dirt(): number;
46
+ calcSE(totalTeams: number): number;
45
47
  }
46
48
  declare class Problem {
47
49
  id: string;
package/dist/index.mjs CHANGED
@@ -496,6 +496,7 @@ class ProblemStatistics {
496
496
  this.submittedNum = 0;
497
497
  this.attemptedNum = 0;
498
498
  this.ignoreNum = 0;
499
+ this.se = 0;
499
500
  this.firstSolveSubmissions = [];
500
501
  this.lastSolveSubmissions = [];
501
502
  }
@@ -506,6 +507,7 @@ class ProblemStatistics {
506
507
  this.submittedNum = 0;
507
508
  this.attemptedNum = 0;
508
509
  this.ignoreNum = 0;
510
+ this.se = 0;
509
511
  this.firstSolveSubmissions = [];
510
512
  this.lastSolveSubmissions = [];
511
513
  }
@@ -515,6 +517,11 @@ class ProblemStatistics {
515
517
  }
516
518
  return calcDirt(this.attemptedNum, this.acceptedNum);
517
519
  }
520
+ calcSE(totalTeams) {
521
+ const res = (totalTeams - this.acceptedNum) / totalTeams;
522
+ this.se = Math.round(res * 100) / 100;
523
+ return this.se;
524
+ }
518
525
  }
519
526
  class Problem {
520
527
  constructor() {
@@ -1519,6 +1526,7 @@ class Rank {
1519
1526
  this.rankStatistics.effectiveTeamNum = this.teams.filter((t) => t.isEffectiveTeam).length;
1520
1527
  this.rankStatistics.totalTeamNum = this.teams.length;
1521
1528
  this.teams.forEach((t) => t.calcSE(this.rankStatistics.totalTeamNum));
1529
+ this.contest.problems.forEach((p) => p.statistics.calcSE(this.rankStatistics.totalTeamNum));
1522
1530
  this.buildAwards();
1523
1531
  this.teams.forEach((t) => t.calcAwards(this.contest.awards?.get(this.options.group)));
1524
1532
  this.teams.forEach((t) => t.postProcessPlaceChartPoints());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcpcio/core",
3
- "version": "0.40.0",
3
+ "version": "0.40.1",
4
4
  "description": "XCPCIO Core",
5
5
  "author": "Dup4 <lyuzhi.pan@gmail.com>",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  "lodash": "^4.17.21",
47
47
  "string-width": "^6.1.0",
48
48
  "xlsx-js-style": "^1.2.0",
49
- "@xcpcio/types": "0.40.0"
49
+ "@xcpcio/types": "0.40.1"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@babel/types": "^7.22.4",
package/src/problem.ts CHANGED
@@ -17,6 +17,8 @@ export class ProblemStatistics {
17
17
  firstSolveSubmissions: Submissions;
18
18
  lastSolveSubmissions: Submissions;
19
19
 
20
+ se: number;
21
+
20
22
  constructor() {
21
23
  this.acceptedNum = 0;
22
24
  this.rejectedNum = 0;
@@ -26,6 +28,8 @@ export class ProblemStatistics {
26
28
  this.attemptedNum = 0;
27
29
  this.ignoreNum = 0;
28
30
 
31
+ this.se = 0;
32
+
29
33
  this.firstSolveSubmissions = [];
30
34
  this.lastSolveSubmissions = [];
31
35
  }
@@ -39,6 +43,8 @@ export class ProblemStatistics {
39
43
  this.attemptedNum = 0;
40
44
  this.ignoreNum = 0;
41
45
 
46
+ this.se = 0;
47
+
42
48
  this.firstSolveSubmissions = [];
43
49
  this.lastSolveSubmissions = [];
44
50
  }
@@ -50,6 +56,13 @@ export class ProblemStatistics {
50
56
 
51
57
  return calcDirt(this.attemptedNum, this.acceptedNum);
52
58
  }
59
+
60
+ calcSE(totalTeams: number) {
61
+ const res = (totalTeams - this.acceptedNum) / totalTeams;
62
+ this.se = Math.round(res * 100) / 100;
63
+
64
+ return this.se;
65
+ }
53
66
  }
54
67
 
55
68
  export class Problem {
package/src/rank.ts CHANGED
@@ -353,6 +353,7 @@ export class Rank {
353
353
  this.rankStatistics.effectiveTeamNum = this.teams.filter(t => t.isEffectiveTeam).length;
354
354
  this.rankStatistics.totalTeamNum = this.teams.length;
355
355
  this.teams.forEach(t => t.calcSE(this.rankStatistics.totalTeamNum));
356
+ this.contest.problems.forEach(p => p.statistics.calcSE(this.rankStatistics.totalTeamNum));
356
357
  this.buildAwards();
357
358
 
358
359
  this.teams.forEach(t => t.calcAwards(this.contest.awards?.get(this.options.group)));