結果

問題 No.1486 ロボット
ユーザー nok0nok0
提出日時 2021-04-23 21:50:57
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 262 ms / 2,000 ms
コード長 243 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 10,572 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2023-09-17 12:05:20
合計ジャッジ時間 2,392 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,896 KB
testcase_01 AC 16 ms
7,924 KB
testcase_02 AC 17 ms
7,860 KB
testcase_03 AC 15 ms
8,008 KB
testcase_04 AC 16 ms
7,872 KB
testcase_05 AC 16 ms
7,880 KB
testcase_06 AC 262 ms
16,048 KB
testcase_07 AC 260 ms
16,128 KB
testcase_08 AC 136 ms
12,124 KB
testcase_09 AC 16 ms
8,064 KB
testcase_10 AC 33 ms
8,872 KB
testcase_11 AC 33 ms
8,928 KB
testcase_12 AC 17 ms
7,912 KB
testcase_13 AC 16 ms
7,944 KB
testcase_14 AC 114 ms
10,328 KB
testcase_15 AC 35 ms
8,516 KB
testcase_16 AC 56 ms
9,356 KB
testcase_17 AC 57 ms
9,192 KB
testcase_18 AC 49 ms
9,432 KB
testcase_19 AC 28 ms
8,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

a, b, c, d, e = map(int, input().split())
x = (a + b) * (c + d) // math.gcd(a + b, c + d)
li = [int(i % (a + b) < a and i % (c + d) < c) for i in range(x)]
res = e // x * sum(li)
for i in range(e % x):
    res += li[i]
print(res)
0