結果
問題 |
No.177 制作進行の宮森あおいです!
|
ユーザー |
|
提出日時 | 2019-02-05 11:49:33 |
言語 | Nim (2.2.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 730 bytes |
コンパイル時間 | 3,491 ms |
コンパイル使用メモリ | 66,696 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-01 11:25:03 |
合計ジャッジ時間 | 4,348 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 13 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(2, 8) Warning: Deprecated since v1.5; Use auto instead.; any is deprecated [Deprecated] /home/judge/data/code/Main.nim(3, 8) Warning: Deprecated since v1.5; Use auto instead.; any is deprecated [Deprecated]
ソースコード
import sequtils,strutils proc L:any=stdin.readLine.parseInt proc R:any=stdin.readLine.split.map(parseInt) var w=L() n=L() J=R() m=L() C=R() s=n+m t=s+1 F=newSeqWith(t+1,newSeq[tuple[t,p,r:int]]()) U:seq[int] z=0 proc a(s,t,p:int)=(F[s]&=(t,p,F[t].len);F[t]&=(s,0,F[s].len-1)) for i,j in J:a s,i,j for i,c in C:a n+i,t,c for c in n..<n+m: let X=R()[1..^1].mapIt:it-1 for j in toSeq(0..<n).filterIt(it notin X):a j,c,9999 proc q(s,t,f:int):int= if s==t:return f U[s]=1 for i,e in F[s]: if U[e.t]==1 or e.p<=0:continue let d=q(e.t,t,f.min e.p) if d>0:(F[s][i].p-=d;F[e.t][e.r].p+=d;return d) while true: U=newSeq[int]t+1 let f=q(s,t,9999) if f==0:(if w>z:quit "BANSAKUTSUKITA",0 else:quit "SHIROBAKO",0) z+=f