結果

問題 No.1486 ロボット
ユーザー O2MTO2MT
提出日時 2021-05-06 00:54:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 1,048 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 76,028 KB
最終ジャッジ日時 2023-10-11 18:28:30
合計ジャッジ時間 3,658 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,252 KB
testcase_01 AC 73 ms
71,536 KB
testcase_02 AC 74 ms
71,264 KB
testcase_03 AC 74 ms
71,552 KB
testcase_04 AC 73 ms
71,476 KB
testcase_05 AC 74 ms
71,308 KB
testcase_06 AC 89 ms
75,940 KB
testcase_07 AC 91 ms
75,756 KB
testcase_08 AC 82 ms
75,748 KB
testcase_09 AC 75 ms
71,080 KB
testcase_10 AC 81 ms
75,876 KB
testcase_11 AC 81 ms
75,688 KB
testcase_12 AC 81 ms
75,652 KB
testcase_13 AC 77 ms
71,288 KB
testcase_14 AC 90 ms
75,856 KB
testcase_15 AC 88 ms
75,980 KB
testcase_16 AC 88 ms
75,692 KB
testcase_17 AC 88 ms
76,028 KB
testcase_18 AC 88 ms
75,976 KB
testcase_19 AC 85 ms
75,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
A,B,C,D,E = map(int,input().split())
time,count = 1,1
F = (A+B)*(C+D)//gcd((A+B),(C+D))
while time < F:
  if 0 <= time%(A+B) < A and 0 <= time%(C+D) < C:
    count += 1
  time += 1
ans = count*(E//F)
time = 0
while time < (E%F):
  if 0 <= time%(A+B) < A and 0 <= time%(C+D) < C:
    ans += 1
  time += 1
print(ans)
0