結果
問題 |
No.228 ゆきこちゃんの 15 パズル
|
ユーザー |
![]() |
提出日時 | 2020-11-02 22:54:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 445 bytes |
コンパイル時間 | 515 ms |
コンパイル使用メモリ | 69,428 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-22 08:15:04 |
合計ジャッジ時間 | 1,297 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 8 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; using ll = long long; int main() { bool ret = true; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { int x; cin >> x; if (x == 0)x += 16; x--; if (abs(i - (x / 4)) + abs(j - (x % 4)) > 1) ret = false; } } cout << (ret ? "Yes" : "No") << endl; return 0; }