mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-12-22 15:41:52 +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;
|
||||
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++) {
|
||||
report_judge_status_f("Judging Test #%d", i);
|
||||
PointInfo po = test_point_func(i);
|
||||
if (po.scr != 100) {
|
||||
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);
|
||||
}
|
||||
} else if (nT == 1 && conf_subtask_meta_info(1).is_ordinary()) { // ACM
|
||||
|
Loading…
Reference in New Issue
Block a user