結果

問題 No.1486 ロボット
ユーザー 👑 tamatotamato
提出日時 2021-04-23 21:26:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 427 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 87,424 KB
実行使用メモリ 83,928 KB
最終ジャッジ日時 2023-09-17 11:42:07
合計ジャッジ時間 3,204 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,684 KB
testcase_01 AC 74 ms
71,840 KB
testcase_02 AC 76 ms
71,620 KB
testcase_03 AC 74 ms
71,748 KB
testcase_04 AC 73 ms
71,748 KB
testcase_05 AC 72 ms
71,612 KB
testcase_06 AC 110 ms
83,928 KB
testcase_07 AC 112 ms
83,860 KB
testcase_08 AC 96 ms
79,508 KB
testcase_09 AC 82 ms
77,748 KB
testcase_10 AC 105 ms
81,608 KB
testcase_11 AC 106 ms
81,892 KB
testcase_12 AC 96 ms
79,532 KB
testcase_13 AC 90 ms
77,816 KB
testcase_14 AC 92 ms
78,352 KB
testcase_15 AC 84 ms
76,544 KB
testcase_16 AC 86 ms
77,260 KB
testcase_17 AC 87 ms
76,948 KB
testcase_18 AC 90 ms
78,096 KB
testcase_19 AC 84 ms
76,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


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

    a, b, c, d, e = map(int, input().split())
    L = (a + b) * (c + d)
    move = [0] * L
    for i in range(L):
        if i % (a+b) < a and i % (c+d) < c:
            move[i] = move[i-1] + 1
        else:
            move[i] = move[i-1]

    print(move[-1] * ((e - 1) // L) + move[(e-1) % L])


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