結果

問題 No.1663 Maximum Remainder
ユーザー asumo0729asumo0729
提出日時 2021-09-03 21:21:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,128 KB
実行使用メモリ 60,388 KB
最終ジャッジ日時 2024-05-09 01:17:00
合計ジャッジ時間 1,496 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
59,216 KB
testcase_01 AC 48 ms
59,776 KB
testcase_02 AC 38 ms
53,776 KB
testcase_03 AC 39 ms
53,036 KB
testcase_04 AC 37 ms
52,912 KB
testcase_05 AC 47 ms
60,388 KB
testcase_06 AC 43 ms
59,432 KB
testcase_07 AC 43 ms
59,688 KB
testcase_08 AC 43 ms
59,972 KB
testcase_09 AC 41 ms
58,484 KB
testcase_10 AC 42 ms
58,628 KB
testcase_11 AC 40 ms
53,552 KB
testcase_12 AC 42 ms
59,624 KB
testcase_13 AC 39 ms
52,356 KB
testcase_14 AC 39 ms
52,648 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