結果

問題 No.1486 ロボット
ユーザー KudeKude
提出日時 2021-04-23 21:46:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 428 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 98,796 KB
最終ジャッジ日時 2023-09-17 11:59:45
合計ジャッジ時間 3,423 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,200 KB
testcase_01 AC 76 ms
71,400 KB
testcase_02 AC 74 ms
71,136 KB
testcase_03 AC 74 ms
71,292 KB
testcase_04 AC 75 ms
70,864 KB
testcase_05 AC 77 ms
71,332 KB
testcase_06 AC 136 ms
92,048 KB
testcase_07 AC 134 ms
91,952 KB
testcase_08 AC 107 ms
83,896 KB
testcase_09 AC 92 ms
79,572 KB
testcase_10 AC 175 ms
98,720 KB
testcase_11 AC 175 ms
98,796 KB
testcase_12 AC 114 ms
84,872 KB
testcase_13 AC 99 ms
80,252 KB
testcase_14 AC 107 ms
82,888 KB
testcase_15 AC 94 ms
77,968 KB
testcase_16 AC 97 ms
79,796 KB
testcase_17 AC 101 ms
79,008 KB
testcase_18 AC 108 ms
82,856 KB
testcase_19 AC 93 ms
78,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c, d, e = map(int, input().split())
l = (a + b) * (c + d)
s1 = [False] * l
s2 = [False] * l
for i in range(l // (a + b)):
    for j in range(a):
        s1[i * (a + b) + j] = True

for i in range(l // (c + d)):
    for j in range(c):
        s2[i * (c + d) + j] = True

cnt_loop = sum(b1 and b2 for b1, b2 in zip(s1, s2))
q, r = divmod(e, l)
ans = q * cnt_loop + sum(b1 and b2 for b1, b2 in zip(s1[:r], s2[:r]))
print(ans)
0