結果

問題 No.5 数字のブロック
ユーザー 💕💖💞💕💖💞
提出日時 2017-04-08 15:46:50
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 417 ms / 5,000 ms
コード長 324 bytes
コンパイル時間 12,050 ms
コンパイル使用メモリ 418,264 KB
実行使用メモリ 57,692 KB
最終ジャッジ日時 2023-08-12 17:43:09
合計ジャッジ時間 25,312 ms
ジャッジサーバーID
(参考情報)
judge10 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 304 ms
56,824 KB
testcase_01 AC 302 ms
56,748 KB
testcase_02 AC 288 ms
52,660 KB
testcase_03 AC 402 ms
57,492 KB
testcase_04 AC 363 ms
57,264 KB
testcase_05 AC 407 ms
57,692 KB
testcase_06 AC 379 ms
57,384 KB
testcase_07 AC 367 ms
57,212 KB
testcase_08 AC 394 ms
57,284 KB
testcase_09 AC 350 ms
57,072 KB
testcase_10 AC 417 ms
57,156 KB
testcase_11 AC 360 ms
57,364 KB
testcase_12 AC 416 ms
57,192 KB
testcase_13 AC 401 ms
57,392 KB
testcase_14 AC 310 ms
56,824 KB
testcase_15 AC 317 ms
56,884 KB
testcase_16 AC 413 ms
57,276 KB
testcase_17 AC 409 ms
57,080 KB
testcase_18 AC 410 ms
57,268 KB
testcase_19 AC 413 ms
57,388 KB
testcase_20 AC 302 ms
56,620 KB
testcase_21 AC 301 ms
56,840 KB
testcase_22 AC 305 ms
56,884 KB
testcase_23 AC 306 ms
56,800 KB
testcase_24 AC 318 ms
56,892 KB
testcase_25 AC 321 ms
57,032 KB
testcase_26 AC 306 ms
56,832 KB
testcase_27 AC 304 ms
56,608 KB
testcase_28 AC 290 ms
52,676 KB
testcase_29 AC 366 ms
57,316 KB
testcase_30 AC 346 ms
57,116 KB
testcase_31 AC 290 ms
52,660 KB
testcase_32 AC 289 ms
52,980 KB
testcase_33 AC 289 ms
52,872 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String> ) { 
         ^
Main.kt:3:7: warning: variable 'N' is never used
  val N = readLine()!!.toInt()
      ^

ソースコード

diff #

fun main(args: Array<String> ) { 
  val L = readLine()!!.toInt()
  val N = readLine()!!.toInt()
  var acc = 0 
  val ws = readLine()!!.split(" ").map { x ->
    x.toInt()
  }.sortedBy { x ->  
    x   
  }.filter { x ->
    acc += x
    if(acc <= L ) { 
      true 
    } else {
      false
    }   
  }
  println(ws.size)
}
0