結果
| 問題 |
No.1486 ロボット
|
| コンテスト | |
| ユーザー |
hiragn
|
| 提出日時 | 2022-11-19 17:45:29 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 390 bytes |
| コンパイル時間 | 239 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 26,368 KB |
| 最終ジャッジ日時 | 2024-09-20 21:45:19 |
| 合計ジャッジ時間 | 2,486 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 3 |
ソースコード
import math
def main():
a, b, c, d, e = map(int, input().split())
cycle = (a + b) * (c + d) // math.gcd(a + b, c + d)
dp = [0] * (cycle + 1)
for i in range(cycle):
if 0 <= i % (a + b) < a and 0 <= i % (c + d) < c:
dp[i + 1] = 1
q, r = divmod(e, cycle)
ans = q * sum(dp[:]) + sum(dp[:r])
print(ans)
if __name__ == "__main__":
main()
hiragn