結果
| 問題 | No.607 開通777年記念 |
| コンテスト | |
| ユーザー |
💕💖💞
|
| 提出日時 | 2018-02-16 15:33:00 |
| 言語 | Kotlin (2.3.20) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 767 bytes |
| 記録 | |
| コンパイル時間 | 9,428 ms |
| コンパイル使用メモリ | 478,072 KB |
| 実行使用メモリ | 127,716 KB |
| 最終ジャッジ日時 | 2026-05-14 16:22:27 |
| 合計ジャッジ時間 | 16,523 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 TLE * 1 -- * 1 |
ソースコード
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 {
val arr = readLine()!!.split(" ").map { it.toInt() }
when {
arr.sum() != 0 -> { arr.mapIndexed { index, x ->
xs[index] += x
}
xs.toList()
}
else -> null
}
}.filter { it != null }
.map { xsn ->
val xs = xsn!!
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")
}
💕💖💞