結果

問題 No.228 ゆきこちゃんの 15 パズル
ユーザー m1025o1184tm1025o1184t
提出日時 2020-01-06 11:30:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 762 bytes
コンパイル時間 1,692 ms
コンパイル使用メモリ 170,060 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-02 10:46:00
合計ジャッジ時間 2,461 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 3 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 WA -
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
using namespace std;
typedef long long ll;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  vector<vector<int>> a(4 + 2,vector<int>(4 + 2));
  for(int i = 0;i <= 5; ++i){
  	for(int j = 0; j<= 5; ++j){
  		a[i][j] = 0;
  	}
  }
  for(int i = 1;i <= 4;++i){
  	for(int j = 1;j <= 4; ++j){
  		int k; cin >> k;
  		a[i][j] = k;
  	}
  }
  int b = 1;
  int res = 0;
  for(int i = 1;i <= 4;++i){
  	for(int j = 1;j <= 4;++j){
  		if(a[i][j] == b || a[i + 1][j] == b || a[i - 1][j] == b || a[i][j + 1] == b || a[i][j - 1] == b){
  			res++;
  		}
  		b++;
  	}
  }
  
  puts(res == 15 ? "Yes" : "No");
  
  return 0;
}
0