結果
| 問題 |
No.50 おもちゃ箱
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-02-05 12:25:55 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 332 bytes |
| コンパイル時間 | 3,401 ms |
| コンパイル使用メモリ | 65,928 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-01 11:25:37 |
| 合計ジャッジ時間 | 4,552 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 17 WA * 21 |
コンパイルメッセージ
/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 for _ in 0..<n:(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;A.nextPermutation) if a<m:echo a else:echo -1