結果

問題 No.50 おもちゃ箱
ユーザー むらためむらため
提出日時 2019-02-07 04:07:23
言語 Nim
(2.0.0)
結果
AC  
実行時間 614 ms / 5,000 ms
コード長 338 bytes
コンパイル時間 3,273 ms
コンパイル使用メモリ 72,168 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-14 03:33:29
合計ジャッジ時間 7,635 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 65 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 58 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 260 ms
4,376 KB
testcase_18 AC 27 ms
4,376 KB
testcase_19 AC 117 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 9 ms
4,376 KB
testcase_22 AC 294 ms
4,380 KB
testcase_23 AC 11 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 3 ms
4,380 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 46 ms
4,376 KB
testcase_29 AC 45 ms
4,376 KB
testcase_30 AC 614 ms
4,376 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 91 ms
4,376 KB
testcase_33 AC 344 ms
4,376 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 179 ms
4,380 KB
testcase_36 AC 94 ms
4,376 KB
testcase_37 AC 58 ms
4,376 KB
testcase_38 AC 30 ms
4,376 KB
testcase_39 AC 47 ms
4,380 KB
testcase_40 AC 347 ms
4,380 KB
testcase_41 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/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 q():any=stdin.readLine
proc R():any=q().split.map(parseInt).sorted cmp
var
 n=q().parseInt
 A=R()
 m=q().parseInt+1
 B=R().reversed
 a=m
while true:(var(T,i,j)=(B,0,0);while i<n and j<m-1:(if T[j]>=A[i]:(T[j]-=A[i];i+=1)else:j+=1);a=a.min j+1;if not A.nextPermutation:break)
echo if a<m: a else: -1
0