結果
問題 | No.607 開通777年記念 |
ユーザー | 💕💖💞 |
提出日時 | 2018-03-07 14:06:33 |
言語 | Kotlin (1.9.23) |
結果 |
TLE
|
実行時間 | - |
コード長 | 629 bytes |
コンパイル時間 | 14,740 ms |
コンパイル使用メモリ | 443,340 KB |
実行使用メモリ | 450,284 KB |
最終ジャッジ日時 | 2024-04-30 17:09:03 |
合計ジャッジ時間 | 20,309 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 321 ms
60,468 KB |
testcase_01 | AC | 322 ms
95,112 KB |
testcase_02 | AC | 371 ms
64,028 KB |
testcase_03 | AC | 324 ms
57,220 KB |
testcase_04 | AC | 329 ms
56,964 KB |
testcase_05 | AC | 326 ms
56,932 KB |
testcase_06 | AC | 321 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>) { ^
ソースコード
fun main(args: Array<String>) { val (ws, n) = readLine()!!.split(" ").map { it.toInt() } val xs = (1..ws).map { 0 }.toMutableList() var check = false val arrs = (1..n).map { val arr = readLine()!!.split(" ").map { it.toInt() } arr } total@for( arr in arrs ) { arr.mapIndexed { index, x -> xs[index] += x } // 尺取サーチ for( left in (0..xs.size-1) ) { for( right in (left..xs.size-1) ) { if( xs.slice( (left..right) ).sum() == 777 ) { check = true break@total } } } } if(check) println("YES") else println("NO") }