結果

問題 No.1486 ロボット
ユーザー c-yanc-yan
提出日時 2021-04-23 21:27:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 23,712 KB
最終ジャッジ日時 2023-09-17 11:43:17
合計ジャッジ時間 1,506 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 17 ms
7,916 KB
testcase_04 WA -
testcase_05 AC 17 ms
8,004 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 32 ms
17,832 KB
testcase_09 AC 17 ms
7,952 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 16 ms
8,016 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd

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

x = gcd(A + B, C + D)
y = ([1] * A + [0] * B) * ((A+B)//x)
z = ([1] * C + [0] * D) * ((C+D)//x)

c = 0
for i in range(x):
    if y[i] == 1 and z[i] == 1:
        c += 1

result = E // x * C
for i in range(E % x):
    if y[i] == 1 and z[i] == 1:
        result += 1

print(result)
0