結果

問題 No.1486 ロボット
ユーザー otsunekootsuneko
提出日時 2021-04-23 21:36:42
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 543 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 80,160 KB
最終ジャッジ日時 2023-09-17 11:52:04
合計ジャッジ時間 4,073 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
75,820 KB
testcase_01 AC 74 ms
71,336 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,C,D,E = map(int,input().split())

flag1 = True
flag2 = True
cnt = 1
cnt1 = 1
cnt2 = 1
ans = 1
while cnt <= E-1:
    if flag1:
        if cnt1%A == 0:
            flag1 = False
            cnt1 -= A
    else:
        if cnt1%B == 0:
            flag1 = True
            cnt1 -= B
    if flag2:
        if cnt2%C == 0:
            flag2 = False
            cnt2 -= C
    else:
        if cnt2%D == 0:
            flag2 = True
            cnt2 -= D
    if flag1 and flag2:
        ans += 1
    cnt += 1
    cnt1 += 1
    cnt2 += 1
print(ans)
0