Skip to content

Commit

Permalink
部分点で実数値の場合を考慮した(ただしEPSを入れていない) fix icpc-jag#11, fix icpc-jag#17 だといいな
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshi-cl committed Jan 17, 2017
1 parent 2f94a9d commit 3a6a8e1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions rime/plugins/plus/subtask.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def _TestSolutionWithAllCases(self, solution, ui):
max_score += subtask.score

if min_score == max_score:
detail = ('%s, score %d' % (original_result.detail, min_score))
detail = ('%s, score %s' % (original_result.detail, min_score))
else:
detail = ('%s, score %d <= x <= %d' % (original_result.detail, min_score, max_score))
detail = ('%s, score %s <= x <= %s' % (original_result.detail, min_score, max_score))
ui.errors.Warning(self, "If you want more precise score, set keep_going option.")

if solution.expected_score is not None:
Expand All @@ -103,10 +103,10 @@ def _TestSolutionWithAllCases(self, solution, ui):
notable_testcase=test.TestCase(self, 'unexpected_score.in'),
detail=detail, allow_override=True)
if min_score == max_score:
ui.errors.Error(self, 'expected score %d does not equal to %d' %
ui.errors.Error(self, 'expected score %s does not equal to %s' %
(solution.expected_score, min_score))
else:
ui.errors.Error(self, 'expected score x = %d does not satisfy %d <= x <= %d' %
ui.errors.Error(self, 'expected score x = %s does not satisfy %s <= x <= %s' %
(solution.expected_score, min_score, max_score))
else:
original_result.Finalize(True, detail=detail, allow_override=True)
Expand Down Expand Up @@ -137,8 +137,8 @@ def _TestSolutionWithAllCases(self, solution, ui):
notable_testcase=test.TestCase(self, 'judge_error.in'),
detail=original_result.detail, allow_override=True)
yield original_result
score /= len(original_result.results)
detail = ('%s, score %d' %
score /= float(len(original_result.results))
detail = ('%s, score %s' %
(original_result.detail, score))
expected_result = score == solution.expected_score
if expected_result or not solution.expected_score:
Expand All @@ -147,7 +147,7 @@ def _TestSolutionWithAllCases(self, solution, ui):
original_result.Finalize(False,
notable_testcase=test.TestCase(self, 'unexpected_score.in'),
detail=detail, allow_override=True)
ui.errors.Error(self, 'expected score %d does not equal to %d' %
ui.errors.Error(self, 'expected score %d does not equal to %s' %
(solution.expected_score, score))
original_result.Finalize(True, detail=detail, allow_override=True)
yield original_result
Expand Down

0 comments on commit 3a6a8e1

Please sign in to comment.