結果

問題 No.5 数字のブロック
ユーザー MaboyMaboy
提出日時 2021-05-28 17:32:06
言語 Swift
(5.10.0)
結果
WA  
実行時間 -
コード長 235 bytes
コンパイル時間 19,453 ms
コンパイル使用メモリ 135,144 KB
実行使用メモリ 9,680 KB
最終ジャッジ日時 2024-04-24 21:02:50
合計ジャッジ時間 17,922 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
9,216 KB
testcase_01 AC 9 ms
9,344 KB
testcase_02 WA -
testcase_03 AC 11 ms
9,388 KB
testcase_04 AC 10 ms
9,492 KB
testcase_05 WA -
testcase_06 AC 12 ms
9,504 KB
testcase_07 AC 11 ms
9,372 KB
testcase_08 AC 12 ms
9,508 KB
testcase_09 AC 9 ms
9,472 KB
testcase_10 AC 13 ms
9,552 KB
testcase_11 AC 10 ms
9,600 KB
testcase_12 AC 11 ms
9,384 KB
testcase_13 AC 11 ms
9,532 KB
testcase_14 AC 9 ms
9,344 KB
testcase_15 WA -
testcase_16 AC 13 ms
9,552 KB
testcase_17 AC 13 ms
9,568 KB
testcase_18 AC 12 ms
9,556 KB
testcase_19 AC 14 ms
9,564 KB
testcase_20 AC 9 ms
9,216 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 8 ms
9,344 KB
testcase_24 AC 9 ms
9,216 KB
testcase_25 AC 9 ms
9,344 KB
testcase_26 AC 8 ms
9,344 KB
testcase_27 AC 9 ms
9,344 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

let L = Int(readLine()!)!
let N = Int(readLine()!)!
var W = readLine()!.split(separator: " ").map{Int($0)!}
W.sort()

var sum :Int = 0
var count :Int = 0

while sum < L{
    sum = sum + W[count]
    count = count + 1
}
print(count - 1)
0