結果

問題 No.5 数字のブロック
ユーザー 💕💖💞💕💖💞
提出日時 2017-04-08 15:46:50
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 442 ms / 5,000 ms
コード長 324 bytes
コンパイル時間 11,564 ms
コンパイル使用メモリ 429,780 KB
実行使用メモリ 64,836 KB
最終ジャッジ日時 2024-04-30 12:50:45
合計ジャッジ時間 25,532 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 322 ms
60,308 KB
testcase_01 AC 328 ms
60,428 KB
testcase_02 AC 306 ms
56,932 KB
testcase_03 AC 429 ms
62,924 KB
testcase_04 AC 411 ms
60,692 KB
testcase_05 AC 432 ms
62,664 KB
testcase_06 AC 402 ms
62,876 KB
testcase_07 AC 392 ms
62,736 KB
testcase_08 AC 423 ms
62,972 KB
testcase_09 AC 367 ms
60,556 KB
testcase_10 AC 436 ms
62,888 KB
testcase_11 AC 384 ms
62,756 KB
testcase_12 AC 430 ms
62,716 KB
testcase_13 AC 428 ms
62,712 KB
testcase_14 AC 329 ms
60,340 KB
testcase_15 AC 338 ms
60,444 KB
testcase_16 AC 442 ms
62,828 KB
testcase_17 AC 442 ms
62,756 KB
testcase_18 AC 435 ms
62,788 KB
testcase_19 AC 441 ms
64,836 KB
testcase_20 AC 319 ms
60,280 KB
testcase_21 AC 322 ms
60,368 KB
testcase_22 AC 324 ms
60,272 KB
testcase_23 AC 322 ms
60,260 KB
testcase_24 AC 330 ms
60,356 KB
testcase_25 AC 342 ms
60,492 KB
testcase_26 AC 320 ms
60,400 KB
testcase_27 AC 322 ms
60,388 KB
testcase_28 AC 307 ms
56,864 KB
testcase_29 AC 382 ms
60,692 KB
testcase_30 AC 369 ms
60,636 KB
testcase_31 AC 301 ms
56,852 KB
testcase_32 AC 309 ms
56,988 KB
testcase_33 AC 304 ms
56,940 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