結果

問題 No.50 おもちゃ箱
ユーザー むらためむらため
提出日時 2019-02-05 11:13:44
言語 Nim
(2.0.2)
結果
AC  
実行時間 535 ms / 5,000 ms
コード長 341 bytes
コンパイル時間 3,302 ms
コンパイル使用メモリ 72,272 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-14 03:31:42
合計ジャッジ時間 6,467 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 56 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 51 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,384 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 227 ms
4,376 KB
testcase_18 AC 23 ms
4,380 KB
testcase_19 AC 103 ms
4,380 KB
testcase_20 AC 3 ms
4,376 KB
testcase_21 AC 8 ms
4,380 KB
testcase_22 AC 257 ms
4,376 KB
testcase_23 AC 10 ms
4,376 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 39 ms
4,380 KB
testcase_29 AC 41 ms
4,376 KB
testcase_30 AC 535 ms
4,376 KB
testcase_31 AC 1 ms
4,380 KB
testcase_32 AC 80 ms
4,376 KB
testcase_33 AC 298 ms
4,376 KB
testcase_34 AC 3 ms
4,376 KB
testcase_35 AC 164 ms
4,380 KB
testcase_36 AC 91 ms
4,376 KB
testcase_37 AC 52 ms
4,380 KB
testcase_38 AC 27 ms
4,376 KB
testcase_39 AC 41 ms
4,380 KB
testcase_40 AC 316 ms
4,376 KB
testcase_41 AC 1 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)
if a<m:echo a else:echo -1
0