結果

問題 No.870 無敵囲い
ユーザー minokasago
提出日時 2019-11-01 06:07:01
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 284 ms / 300 ms
コード長 517 bytes
コンパイル時間 11,201 ms
コンパイル使用メモリ 435,116 KB
実行使用メモリ 57,224 KB
最終ジャッジ日時 2024-06-29 06:30:38
合計ジャッジ時間 16,953 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

fun main()
{
    val N = readLine()!!.toInt()

    var abc = arrayOf(2, 8, 3, 9, 7, 9)
    val invincible = arrayOf(5, 8, 4, 8, 6,8)

    for (n in 1..N) {
        val xy: List<Int> = readLine()!!.split(" ").map { it.toInt() }
        for (i in 0..4 step 2) {
            if (abc[i] == xy[0] && abc[i+1] == xy[1]) {
                abc[i] = xy[2]
                abc[i+1] = xy[3]
            }
        }
    }

    if (abc contentEquals invincible) {
        println("YES")
    } else {
        println("NO")
    }
}
0