結果
| 問題 | No.1486 ロボット |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-06 20:14:45 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 197 ms / 2,000 ms |
| + 751µs | |
| コード長 | 401 bytes |
| 記録 | |
| コンパイル時間 | 297 ms |
| コンパイル使用メモリ | 21,412 KB |
| 実行使用メモリ | 31,356 KB |
| 最終ジャッジ日時 | 2026-08-25 11:52:11 |
| 合計ジャッジ時間 | 4,426 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
from math import gcd
a, b, c, d, e = map(int, input().split())
x = (a+b) * (c+d) // gcd(a+b, c+d)
y = ([True] * a + [False] * b) * (x // (a+b))
z = ([True] * c + [False] * d) * (x // (c+d))
cnt = 0
for i in range(x):
if not y[i] or not z[i]:
continue
cnt += 1
result = e // x * cnt
for i in range(e % x):
if not y[i] or not z[i]:
continue
result += 1
print(result)