結果

問題 No.50 おもちゃ箱
ユーザー むらためむらため
提出日時 2019-02-05 10:37:03
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 489 bytes
コンパイル時間 2,781 ms
コンパイル使用メモリ 71,660 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-14 03:31:19
合計ジャッジ時間 4,258 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1 ms
4,376 KB
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 -
testcase_16 WA -
testcase_17 AC 8 ms
4,380 KB
testcase_18 AC 3 ms
4,380 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(2, 10) Warning: Deprecated since v1.5; Use auto instead.; any is deprecated [Deprecated]
/home/judge/data/code/Main.nim(3, 10) Warning: Deprecated since v1.5; Use auto instead.; any is deprecated [Deprecated]

ソースコード

diff #

import sequtils,strutils,algorithm
proc r():any=stdin.readLine.parseInt
proc R():any=stdin.readLine.split.map(parseInt).sorted(cmp,Descending)
var
 N=r()
 K=1 shl N
 A=R()
 M=r()
 B=R()
 S=newSeq[int]K
for n in 0..<K:(for i in 0..<N:(if(n and(1 shl i))==(1 shl i):S[n]+=A[i]))
var U=S.mapIt(B[0]-it>=0)
if U[K-1]:quit "1",0
for i in 0..<M:
 var V=S.mapIt(false)
 for x,a in U:
  if a:
   for y,s in S:
    if (x and y)==0 and B[i]-s>=0:V[x xor y]=true
 U=V
 if U[K-1]:quit $(i+2),0
echo -1
0