結果

問題 No.5 数字のブロック
ユーザー 💕💖💞
提出日時 2017-07-01 14:53:39
言語 Kotlin
(2.1.0)
結果
WA  
実行時間 -
コード長 256 bytes
コンパイル時間 13,475 ms
コンパイル使用メモリ 429,252 KB
実行使用メモリ 62,780 KB
最終ジャッジ日時 2024-11-20 11:09:53
合計ジャッジ時間 28,270 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:12: 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> ) {
  var l = readLine()!!.toInt()
  val n = readLine()!!.toInt()
  var cnt = 0
  for( s in readLine()!!.split(" ").map { it.toInt() }.sorted() ) {
    l   -= s
    cnt += 1
    if( l < 0 ) break    
  }
  println( cnt-1 )
}
0