結果
| 問題 |
No.2099 [Cherry Alpha B] Time Machine
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-15 10:06:53 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 384 bytes |
| コンパイル時間 | 134 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,824 KB |
| 最終ジャッジ日時 | 2024-06-26 19:39:03 |
| 合計ジャッジ時間 | 6,556 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 25 RE * 36 TLE * 1 -- * 10 |
ソースコード
import math
t=int(input())
x,a=list(map(int,input().split()))
y,b=list(map(int,input().split()))
def f(time):
if time>0:
n=time%a
for i in range(n//x):
m=n+i*x
n=min(n,(m//b)*y+m%b)
print(n+(time//a)*x)
elif t<0:
u=abs(time)
r=(math.ceil(u/b))
return(r*y+f(r*b-u))
else:
return(0)
print(f(t))