mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-26 02:28:41 +00:00
fix(judger): wrong final score when test point scores are not all configured
This commit is contained in:
parent
eb39c9ec04
commit
a4371c2847
@ -1637,13 +1637,33 @@ bool main_data_test(TP test_point_func) {
|
|||||||
|
|
||||||
bool passed = true;
|
bool passed = true;
|
||||||
if (nT == 0) { // OI
|
if (nT == 0) { // OI
|
||||||
|
map<int, score_t> point_scores;
|
||||||
|
score_t remaining_tests_total_score = 100;
|
||||||
|
int remaining_tests_cnt = n;
|
||||||
|
|
||||||
|
for (int i = 1; i <= n; i++) {
|
||||||
|
score_t point_score = conf_score("point_score", i, -1);
|
||||||
|
|
||||||
|
if (point_score != -1) {
|
||||||
|
point_scores[i] = point_score;
|
||||||
|
remaining_tests_total_score -= point_score;
|
||||||
|
remaining_tests_cnt--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 1; i <= n; i++) {
|
for (int i = 1; i <= n; i++) {
|
||||||
report_judge_status_f("Judging Test #%d", i);
|
report_judge_status_f("Judging Test #%d", i);
|
||||||
PointInfo po = test_point_func(i);
|
PointInfo po = test_point_func(i);
|
||||||
if (po.scr != 100) {
|
if (po.scr != 100) {
|
||||||
passed = false;
|
passed = false;
|
||||||
}
|
}
|
||||||
po.scr = scale_score(po.scr, conf_score("point_score", i, 100.0 / n));
|
|
||||||
|
if (point_scores.count(i)) {
|
||||||
|
po.scr = scale_score(po.scr, point_scores[i]);
|
||||||
|
} else {
|
||||||
|
po.scr = scale_score(po.scr, remaining_tests_total_score / remaining_tests_cnt);
|
||||||
|
}
|
||||||
|
|
||||||
add_point_info(po);
|
add_point_info(po);
|
||||||
}
|
}
|
||||||
} else if (nT == 1 && conf_subtask_meta_info(1).is_ordinary()) { // ACM
|
} else if (nT == 1 && conf_subtask_meta_info(1).is_ordinary()) { // ACM
|
||||||
|
Loading…
Reference in New Issue
Block a user