結果

問題 No.1486 ロボット
ユーザー NoaSaberNoaSaber
提出日時 2021-04-23 22:30:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 965 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 76,420 KB
最終ジャッジ日時 2023-09-17 12:37:39
合計ジャッジ時間 5,071 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,228 KB
testcase_01 AC 76 ms
71,256 KB
testcase_02 AC 78 ms
71,788 KB
testcase_03 AC 75 ms
71,532 KB
testcase_04 AC 75 ms
71,280 KB
testcase_05 AC 83 ms
76,016 KB
testcase_06 AC 88 ms
76,292 KB
testcase_07 AC 89 ms
76,340 KB
testcase_08 AC 81 ms
76,088 KB
testcase_09 AC 890 ms
76,268 KB
testcase_10 AC 127 ms
76,396 KB
testcase_11 AC 128 ms
76,368 KB
testcase_12 AC 331 ms
76,344 KB
testcase_13 AC 965 ms
76,344 KB
testcase_14 AC 84 ms
76,236 KB
testcase_15 AC 84 ms
76,348 KB
testcase_16 AC 83 ms
76,048 KB
testcase_17 AC 84 ms
76,348 KB
testcase_18 AC 87 ms
76,252 KB
testcase_19 AC 83 ms
76,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,C,D,E=map(int,input().split())
import math
ptA,ptB=A+B,C+D
S=math.gcd(ptA,ptB)*(ptA)*(ptB)
cnt_cir=0
ans=0
for i in range(S):
    if i%ptA<A and i%ptB<C:
        cnt_cir+=1
ans+=cnt_cir*(E//S)
E-=E//S*S
for i in range(E):
    if i%ptA<A and i%ptB<C:
        ans+=1
print(ans)
0