結果

問題 No.1486 ロボット
ユーザー 👑 rin204rin204
提出日時 2021-08-05 17:56:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 86,864 KB
実行使用メモリ 83,936 KB
最終ジャッジ日時 2023-10-14 21:37:57
合計ジャッジ時間 3,292 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,352 KB
testcase_01 AC 77 ms
71,424 KB
testcase_02 AC 78 ms
71,316 KB
testcase_03 AC 81 ms
71,244 KB
testcase_04 AC 78 ms
71,572 KB
testcase_05 AC 78 ms
70,988 KB
testcase_06 AC 110 ms
83,780 KB
testcase_07 AC 111 ms
83,936 KB
testcase_08 AC 96 ms
79,920 KB
testcase_09 AC 78 ms
71,180 KB
testcase_10 AC 87 ms
76,532 KB
testcase_11 AC 87 ms
76,740 KB
testcase_12 AC 83 ms
76,260 KB
testcase_13 AC 77 ms
71,296 KB
testcase_14 AC 94 ms
78,512 KB
testcase_15 AC 89 ms
76,636 KB
testcase_16 AC 91 ms
77,480 KB
testcase_17 AC 91 ms
77,016 KB
testcase_18 AC 90 ms
77,056 KB
testcase_19 AC 86 ms
76,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd

a, b, c, d, e = map(int, input().split())
loop = (a + b) * (c + d) // gcd(a + b, c + d)
tmp = [False] * loop
for i in range(loop):
    if i % (a + b) < a and i % (c + d) < c:
        tmp[i] = True

ans = e // loop * tmp.count(True)
for i in range(e % loop):
    if tmp[i]:
        ans += 1
print(ans)
0