結果

問題 No.607 開通777年記念
ユーザー 💕💖💞💕💖💞
提出日時 2018-02-16 15:20:37
言語 Kotlin
(1.9.23)
結果
TLE  
実行時間 -
コード長 612 bytes
コンパイル時間 14,674 ms
コンパイル使用メモリ 443,656 KB
実行使用メモリ 98,316 KB
最終ジャッジ日時 2024-04-30 16:56:43
合計ジャッジ時間 21,397 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 339 ms
60,444 KB
testcase_01 AC 344 ms
94,868 KB
testcase_02 AC 355 ms
57,072 KB
testcase_03 AC 344 ms
56,960 KB
testcase_04 AC 350 ms
56,884 KB
testcase_05 AC 349 ms
56,980 KB
testcase_06 AC 344 ms
56,948 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>) { 
         ^

ソースコード

diff #

fun main(args: Array<String>) { 
  val (ws, n) = readLine()!!.split(" ").map { it.toInt() }
  val xs = (1..ws).map { 0 }.toMutableList()
  
  var check = false
  for( nn in (1..n) ) { 
    readLine()!!.split(" ").map { it.toInt() }.mapIndexed { index, x ->
      xs[index] += x
      
      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