mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 01:08:41 +00:00
fix(judger): wrong final score when subtask scores are not all configured
This commit is contained in:
parent
a4371c2847
commit
1fc4b9afd2
@ -1681,9 +1681,30 @@ bool main_data_test(TP test_point_func) {
|
||||
}
|
||||
}
|
||||
} else { // subtask
|
||||
map<int, SubtaskMetaInfo> subtask_metas;
|
||||
score_t remaining_subtasks_total_score = 100;
|
||||
int remaining_subtasks_cnt = nT;
|
||||
|
||||
for (int t = 1; t <= nT; t++) {
|
||||
score_t subtask_score = conf_score("subtask_score", t, -1);
|
||||
|
||||
subtask_metas[t] = conf_subtask_meta_info(t);
|
||||
subtask_metas[t].full_score = subtask_score;
|
||||
|
||||
if (subtask_score != -1) {
|
||||
remaining_subtasks_total_score -= subtask_score;
|
||||
remaining_subtasks_cnt--;
|
||||
}
|
||||
}
|
||||
|
||||
map<int, SubtaskInfo> subtasks;
|
||||
for (int t = 1; t <= nT; t++) {
|
||||
SubtaskInfo st_info(conf_subtask_meta_info(t));
|
||||
if (subtask_metas[t].full_score == -1) {
|
||||
subtask_metas[t].full_score = remaining_subtasks_total_score / remaining_subtasks_cnt;
|
||||
}
|
||||
|
||||
SubtaskInfo st_info(subtask_metas[t]);
|
||||
|
||||
if (!st_info.resolve_dependencies(subtasks)) {
|
||||
st_info.info = "Skipped";
|
||||
} else {
|
||||
@ -1696,6 +1717,7 @@ bool main_data_test(TP test_point_func) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subtasks[t] = st_info;
|
||||
passed = passed && st_info.passed;
|
||||
add_subtask_info(st_info);
|
||||
|
Loading…
Reference in New Issue
Block a user