結果
| 問題 |
No.2099 [Cherry Alpha B] Time Machine
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-15 10:12:18 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 388 bytes |
| コンパイル時間 | 458 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,956 KB |
| 最終ジャッジ日時 | 2024-06-26 19:39:49 |
| 合計ジャッジ時間 | 6,864 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 53 WA * 8 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)
return(n+(time//a)*x)
elif time<0:
u=abs(time)
r=(math.ceil(u/b))
return(r*y+f(r*b-u))
else:
return(0)
print(f(t))