結果

問題 No.1486 ロボット
ユーザー _matumo__matumo_
提出日時 2021-12-16 08:55:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 453 ms / 2,000 ms
コード長 175 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 47,412 KB
最終ジャッジ日時 2023-10-11 02:31:08
合計ジャッジ時間 3,841 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,060 KB
testcase_01 AC 17 ms
8,064 KB
testcase_02 AC 16 ms
8,064 KB
testcase_03 AC 16 ms
7,960 KB
testcase_04 AC 16 ms
8,028 KB
testcase_05 AC 16 ms
7,960 KB
testcase_06 AC 453 ms
47,412 KB
testcase_07 AC 448 ms
47,092 KB
testcase_08 AC 226 ms
19,720 KB
testcase_09 AC 16 ms
7,972 KB
testcase_10 AC 47 ms
10,852 KB
testcase_11 AC 48 ms
10,784 KB
testcase_12 AC 18 ms
7,956 KB
testcase_13 AC 16 ms
7,964 KB
testcase_14 AC 142 ms
19,088 KB
testcase_15 AC 43 ms
10,700 KB
testcase_16 AC 87 ms
13,720 KB
testcase_17 AC 67 ms
12,708 KB
testcase_18 AC 77 ms
13,444 KB
testcase_19 AC 35 ms
9,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
A,B,C,D,E=map(int,input().split())
ab=A+B
cd=C+D
L=ab*cd//math.gcd(ab,cd)
p=[0]*(L+1)
for i in range(L):
	p[i+1]=p[i]+(i%ab<A)*(i%cd<C)
n=E//L*p[L]+p[E%L]
print(n)
0