結果
問題 | No.1935 Water Simulation |
ユーザー |
![]() |
提出日時 | 2022-05-13 22:26:55 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 45 ms / 2,000 ms |
コード長 | 588 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 82,204 KB |
実行使用メモリ | 58,192 KB |
最終ジャッジ日時 | 2024-07-22 04:28:36 |
合計ジャッジ時間 | 2,348 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
V1,V2,V3,V4,N=map(int,input().split())def solve(V1,V2,V3,V4,N):V=(V1,V2,V3,V4)s=[V1,0,0,0]st = {tuple(s):0}ts = [tuple(s)]i=0cnt=0while N>0:N-=1cnt+=1v=s[i]ib=ii+=1if i>3:i=0nxt=s[i]c=V[i]d=min(c-nxt,v)s[i]+=ds[ib]-=dt = tuple(s+[i])if t in st:l=st[t]loop=cnt-lN%=loops = ts[l+N]breakst[t]=cntts.append(t[:4])return sprint(*solve(V1,V2,V3,V4,N))