結果

問題 No.870 無敵囲い
ユーザー MaboyMaboy
提出日時 2021-06-18 18:10:44
言語 Swift
(5.10.0)
結果
AC  
実行時間 4 ms / 300 ms
コード長 355 bytes
コンパイル時間 7,563 ms
コンパイル使用メモリ 130,692 KB
実行使用メモリ 8,316 KB
最終ジャッジ日時 2023-09-11 16:39:33
合計ジャッジ時間 8,515 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
8,316 KB
testcase_01 AC 3 ms
8,316 KB
testcase_02 AC 3 ms
8,112 KB
testcase_03 AC 3 ms
8,180 KB
testcase_04 AC 3 ms
8,140 KB
testcase_05 AC 4 ms
8,188 KB
testcase_06 AC 4 ms
8,124 KB
testcase_07 AC 3 ms
8,224 KB
testcase_08 AC 4 ms
8,216 KB
testcase_09 AC 4 ms
8,120 KB
testcase_10 AC 3 ms
8,212 KB
testcase_11 AC 4 ms
8,120 KB
testcase_12 AC 3 ms
8,140 KB
testcase_13 AC 4 ms
8,192 KB
testcase_14 AC 3 ms
8,224 KB
testcase_15 AC 3 ms
8,144 KB
testcase_16 AC 4 ms
8,124 KB
testcase_17 AC 4 ms
8,180 KB
testcase_18 AC 3 ms
8,144 KB
testcase_19 AC 3 ms
8,144 KB
testcase_20 AC 4 ms
8,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let n = Int(readLine()!)
var b = [[Int]]()
for _ in 0...9{
    b += [[0,0,0,0,0,0,0,0,0,0]]
}
b[2][8] = 1
b[3][9] = 2
b[7][9] = 3
for _ in 1...n!{
    let s = readLine()!.split(separator: " ").map{Int($0)!}
    b[s[2]][s[3]] = b[s[0]][s[1]]
    b[s[0]][s[1]] = 0
}
if b[5][8] == 1 && b[4][8] == 2 && b[6][8] == 3{
    print("YES")
}else{
    print("NO")
}
0