結果

問題 No.607 開通777年記念
ユーザー 💕💖💞💕💖💞
提出日時 2018-02-16 15:25:59
言語 Kotlin
(1.9.23)
結果
TLE  
実行時間 -
コード長 608 bytes
コンパイル時間 13,119 ms
コンパイル使用メモリ 439,324 KB
実行使用メモリ 107,356 KB
最終ジャッジ日時 2024-04-30 16:57:20
合計ジャッジ時間 19,406 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 323 ms
60,604 KB
testcase_01 AC 327 ms
95,136 KB
testcase_02 AC 324 ms
63,876 KB
testcase_03 AC 320 ms
57,136 KB
testcase_04 AC 323 ms
57,056 KB
testcase_05 AC 321 ms
57,060 KB
testcase_06 AC 322 ms
56,968 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) { 
         ^
Main.kt:11:11: warning: name shadowed: xs
  }.map { xs ->
          ^

ソースコード

diff #

fun main(args: Array<String>) { 
  val (ws, n) = readLine()!!.split(" ").map { it.toInt() }
  val xs = (1..ws).map { 0 }.toMutableList()
  
  var check = false
  (1..n).map { 
    readLine()!!.split(" ").map { it.toInt() }.mapIndexed { index, x ->
      xs[index] += x
    }
    xs.toList()
  }.map { xs ->
    if( check == false ) {
      scan@for( s in (0..xs.size-1) ) { 
        for( e in (s..xs.size-1) ) { 
          if( xs.slice(s..e).sum() == 777) {
            check = true
            continue@scan
          }
        }
      }
    }
  }

  if(check) 
    println("YES")
  else
    println("NO")
}
0