結果
| 問題 |
No.50 おもちゃ箱
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-02-05 11:13:44 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 489 ms / 5,000 ms |
| コード長 | 341 bytes |
| コンパイル時間 | 3,493 ms |
| コンパイル使用メモリ | 66,520 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-01 11:24:50 |
| 合計ジャッジ時間 | 7,026 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 38 |
コンパイルメッセージ
/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]
ソースコード
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