結果
| 問題 |
No.5 数字のブロック
|
| ユーザー |
|
| 提出日時 | 2018-07-21 19:26:26 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 282 bytes |
| コンパイル時間 | 3,379 ms |
| コンパイル使用メモリ | 65,940 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-01 03:16:11 |
| 合計ジャッジ時間 | 4,538 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 14 |
ソースコード
import algorithm, strutils, sequtils
let l = stdin.readLine().parseInt()
discard stdin.readLine()
let sortedW = stdin.readLine().split(' ').map(parseInt).sorted(proc (x, y: int): int = x - y)
var sum: int = 0
for idx, w in sortedW:
sum += w
if sum >= l:
echo idx
break