結果

問題 No.1663 Maximum Remainder
ユーザー asumo0729asumo0729
提出日時 2021-09-03 21:21:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 76,512 KB
最終ジャッジ日時 2023-08-21 19:20:42
合計ジャッジ時間 2,430 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
76,092 KB
testcase_01 AC 88 ms
76,512 KB
testcase_02 AC 82 ms
71,060 KB
testcase_03 AC 79 ms
70,948 KB
testcase_04 AC 80 ms
71,196 KB
testcase_05 AC 86 ms
76,196 KB
testcase_06 AC 82 ms
75,848 KB
testcase_07 AC 87 ms
75,800 KB
testcase_08 AC 83 ms
75,776 KB
testcase_09 AC 84 ms
75,836 KB
testcase_10 AC 86 ms
75,900 KB
testcase_11 AC 80 ms
71,332 KB
testcase_12 AC 85 ms
76,064 KB
testcase_13 AC 80 ms
71,220 KB
testcase_14 AC 79 ms
70,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
stdin=sys.stdin
sys.setrecursionlimit(10 ** 8)

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
eps = 1e-9
sortkey = itemgetter(0)

a, b, c, d, m = lp()
ans = 0
for i in range(a, b + 1):
    for j in range(c, d + 1):
        ans = max(ans, (i + j) % m)
print(ans)
0