結果

問題 No.1663 Maximum Remainder
ユーザー 👑 tamatotamato
提出日時 2021-09-03 21:40:08
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 87,412 KB
実行使用メモリ 76,768 KB
最終ジャッジ日時 2023-08-21 20:34:13
合計ジャッジ時間 2,477 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
76,444 KB
testcase_01 AC 92 ms
76,256 KB
testcase_02 AC 71 ms
71,736 KB
testcase_03 AC 71 ms
71,488 KB
testcase_04 AC 71 ms
71,800 KB
testcase_05 AC 76 ms
76,768 KB
testcase_06 AC 75 ms
75,756 KB
testcase_07 AC 78 ms
76,068 KB
testcase_08 AC 73 ms
75,952 KB
testcase_09 AC 75 ms
75,856 KB
testcase_10 AC 75 ms
75,760 KB
testcase_11 AC 71 ms
71,716 KB
testcase_12 AC 75 ms
75,748 KB
testcase_13 AC 72 ms
71,740 KB
testcase_14 AC 76 ms
71,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    a, b, c, d, m = map(int, input().split())
    ans = 0
    for x in range(a, b+1):
        for y in range(c, d+1):
            ans = max(ans, (x+y)%m)
    print(ans)


if __name__ == '__main__':
    main()
0