結果

問題 No.1486 ロボット
ユーザー ygd.ygd.
提出日時 2021-04-23 21:26:55
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 152,368 KB
最終ジャッジ日時 2023-09-17 11:42:03
合計ジャッジ時間 3,237 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
70,972 KB
testcase_01 AC 71 ms
71,372 KB
testcase_02 AC 72 ms
71,320 KB
testcase_03 AC 71 ms
71,140 KB
testcase_04 AC 72 ms
71,228 KB
testcase_05 AC 73 ms
71,220 KB
testcase_06 AC 137 ms
152,344 KB
testcase_07 AC 136 ms
152,368 KB
testcase_08 AC 115 ms
113,060 KB
testcase_09 AC 95 ms
93,832 KB
testcase_10 AC 123 ms
129,776 KB
testcase_11 AC 123 ms
129,700 KB
testcase_12 AC 112 ms
108,960 KB
testcase_13 AC 93 ms
93,760 KB
testcase_14 AC 101 ms
96,164 KB
testcase_15 AC 87 ms
79,496 KB
testcase_16 AC 93 ms
86,808 KB
testcase_17 AC 91 ms
83,364 KB
testcase_18 AC 102 ms
96,140 KB
testcase_19 AC 86 ms
80,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c,d,e = map(int,input().split())
loop = (a+b)*(c+d)
ok = [0]
for i in range(1,loop+1):
    pre = ok[-1]
    if 0 < i%(a+b) <= a and 0 < i%(c+d) <= c:
        ok.append(pre+1)
    else:
        ok.append(pre)
#print(ok)
num = e//loop
amari = e%loop
ans = num*ok[-1] + ok[amari]
print(ans)
0