結果

問題 No.1486 ロボット
ユーザー 👑 H20H20
提出日時 2021-04-23 21:32:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 83,824 KB
最終ジャッジ日時 2023-09-17 11:48:32
合計ジャッジ時間 3,011 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,372 KB
testcase_01 AC 73 ms
71,568 KB
testcase_02 AC 73 ms
71,344 KB
testcase_03 AC 74 ms
71,196 KB
testcase_04 AC 73 ms
71,148 KB
testcase_05 AC 74 ms
71,224 KB
testcase_06 AC 93 ms
83,824 KB
testcase_07 AC 90 ms
83,752 KB
testcase_08 AC 85 ms
79,916 KB
testcase_09 AC 75 ms
71,460 KB
testcase_10 AC 82 ms
76,528 KB
testcase_11 AC 83 ms
76,592 KB
testcase_12 AC 81 ms
76,040 KB
testcase_13 AC 76 ms
71,416 KB
testcase_14 AC 86 ms
79,276 KB
testcase_15 AC 82 ms
76,676 KB
testcase_16 AC 84 ms
77,580 KB
testcase_17 AC 84 ms
77,624 KB
testcase_18 AC 85 ms
77,144 KB
testcase_19 AC 82 ms
76,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math 

#最大公約数
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A,B,C,D,E = map(int, input().split())
lc = lcm(A+B,C+D)
L = [0]*lc
for i in range(lc):
    if i%(A+B)<A and i%(C+D)<C:
        L[i]=1
c = sum(L)
print((E//lc)*c+sum(L[:E%lc]))
0