Skip to content

Commit 4a78f75

Browse files
committed
Fix RWS to follow IOI rounding rules.
1 parent 7ff9cc2 commit 4a78f75

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cms/grading/scoretypes/abc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ def compute_score(self, submission_result):
490490
else:
491491
public_subtasks.append({"idx": st_idx,
492492
"testcases": public_testcases})
493-
ranking_details.append("%g" % rounded_score)
493+
ranking_details.append("%g" % st_score)
494494

495495
return score, subtasks, public_score, public_subtasks, ranking_details
496496

cmsranking/static/UserDetail.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,15 @@ var UserDetail = new function () {
292292
} else {
293293
for (var i in self.submissions[task_id]) {
294294
var submission = self.submissions[task_id][i];
295+
var rounded_extra = submission["extra"].map(x => round_to_str(parseFloat(x), DataStore.tasks[task_id]['score_precision']));
295296
time = submission["time"] - DataStore.contests[DataStore.tasks[task_id]["contest"]]["begin"];
296297
time = format_time(time);
297298
res += " \
298299
<tr> \
299300
<td>" + time + "</td> \
300301
<td>" + round_to_str(submission['score'], DataStore.tasks[task_id]['score_precision']) + "</td> \
301302
<td>" + (submission["token"] ? 'Yes' : 'No') + "</td> \
302-
" + (submission["extra"].length > 0 ? "<td>" + submission["extra"].join("</td><td>") + "</td>" : "") + " \
303+
" + (submission["extra"].length > 0 ? "<td>" + rounded_extra.join("</td><td>") + "</td>" : "") + " \
303304
</tr>";
304305
}
305306
}

0 commit comments

Comments
 (0)