結果

問題 No.1486 ロボット
ユーザー miya145592miya145592
提出日時 2023-05-07 16:29:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 76,356 KB
最終ジャッジ日時 2023-08-16 05:45:24
合計ジャッジ時間 3,679 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,548 KB
testcase_01 AC 68 ms
71,504 KB
testcase_02 AC 66 ms
71,488 KB
testcase_03 AC 64 ms
71,184 KB
testcase_04 AC 67 ms
71,492 KB
testcase_05 AC 66 ms
71,172 KB
testcase_06 AC 77 ms
76,348 KB
testcase_07 AC 77 ms
75,992 KB
testcase_08 AC 74 ms
75,844 KB
testcase_09 AC 66 ms
71,368 KB
testcase_10 AC 74 ms
76,136 KB
testcase_11 AC 73 ms
76,308 KB
testcase_12 AC 74 ms
76,308 KB
testcase_13 AC 71 ms
71,340 KB
testcase_14 AC 80 ms
76,204 KB
testcase_15 AC 78 ms
76,284 KB
testcase_16 AC 77 ms
76,356 KB
testcase_17 AC 78 ms
76,016 KB
testcase_18 AC 75 ms
76,004 KB
testcase_19 AC 76 ms
76,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
A, B, C, D, E = map(int, input().split())
ab = A+B
cd = C+D
G = math.gcd(ab, cd)
L = ab*cd//G
ans = 0
for i in range(L):
    if 0<=i%ab<A and 0<=i%cd<C:
        ans+=1
cnt = E//L
ans *= cnt
for i in range(E%L):
    if 0<=i%ab<A and 0<=i%cd<C:
        ans+=1
print(ans)
0