結果

問題 No.177 制作進行の宮森あおいです!
ユーザー むらためむらため
提出日時 2019-02-05 11:52:52
言語 Nim
(2.0.2)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 709 bytes
コンパイル時間 3,421 ms
コンパイル使用メモリ 72,132 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-14 03:32:18
合計ジャッジ時間 4,584 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/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]

ソースコード

diff #

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
 F=newSeqWith(s+2,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,s+1,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 and e.p>0:(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]s+2;let f=q(s,s+1,9999);if f==0:(if w>z:quit "BANSAKUTSUKITA",0 else:quit "SHIROBAKO",0);z+=f)
0