結果

問題 No.1663 Maximum Remainder
ユーザー ABKZABKZ
提出日時 2021-09-25 17:34:30
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 143 bytes
コンパイル時間 646 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 71,556 KB
最終ジャッジ日時 2023-09-18 23:07:05
合計ジャッジ時間 2,435 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,412 KB
testcase_01 AC 70 ms
71,336 KB
testcase_02 AC 70 ms
71,456 KB
testcase_03 AC 70 ms
71,180 KB
testcase_04 AC 71 ms
71,420 KB
testcase_05 AC 70 ms
71,292 KB
testcase_06 AC 70 ms
71,136 KB
testcase_07 AC 69 ms
71,412 KB
testcase_08 AC 70 ms
71,308 KB
testcase_09 AC 72 ms
71,408 KB
testcase_10 AC 71 ms
71,128 KB
testcase_11 AC 71 ms
71,420 KB
testcase_12 AC 68 ms
71,480 KB
testcase_13 AC 70 ms
71,556 KB
testcase_14 AC 70 ms
71,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c, d, m = map(int, input().split())

lower = a + c
upper = b + d

if lower // m == upper // m:
    print(upper % m)
else:
    print(m-1)
0