結果

問題 No.228 ゆきこちゃんの 15 パズル
ユーザー roiti46roiti46
提出日時 2015-06-19 22:34:09
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 563 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 6,684 KB
実行使用メモリ 6,068 KB
最終ジャッジ日時 2023-09-21 09:58:46
合計ジャッジ時間 1,119 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 11 ms
5,844 KB
testcase_02 AC 11 ms
5,920 KB
testcase_03 AC 10 ms
6,060 KB
testcase_04 AC 10 ms
6,024 KB
testcase_05 AC 11 ms
6,060 KB
testcase_06 AC 10 ms
5,920 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 10 ms
6,004 KB
testcase_14 AC 10 ms
6,016 KB
testcase_15 AC 10 ms
6,016 KB
testcase_16 WA -
testcase_17 AC 10 ms
6,068 KB
testcase_18 AC 10 ms
5,908 KB
testcase_19 AC 10 ms
5,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

dxy = zip([0, 1, 0, -1, 0], [0, 0, 1, 0, -1])
a = [map(int, raw_input().split()) for i in xrange(4)]
b = [[j % 16 for j in xrange(4 * i + 1, 4 * i + 5)] for i in xrange(4)]

for y in xrange(4):
        for x in xrange(4):
                for dx, dy in dxy:
                        nx, ny = x + dx, y + dy
                        if not (0 <= nx < 4 and 0 <= ny < 4): continue
                        if a[ny][nx] == b[y][x]:
                                break
                else:
                        print "No"
                        exit()
print "Yes"
0