結果
| 問題 |
No.5 数字のブロック
|
| ユーザー |
|
| 提出日時 | 2018-07-21 19:25:21 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 282 bytes |
| コンパイル時間 | 3,533 ms |
| コンパイル使用メモリ | 67,052 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-01 03:15:47 |
| 合計ジャッジ時間 | 4,470 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 WA * 10 |
ソースコード
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