結果

問題 No.870 無敵囲い
ユーザー 37zigen37zigen
提出日時 2019-08-30 22:40:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 580 bytes
コンパイル時間 496 ms
コンパイル使用メモリ 64,840 KB
実行使用メモリ 5,256 KB
最終ジャッジ日時 2023-09-11 16:14:44
合計ジャッジ時間 1,371 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
int a[100][100];

int main() {
  int N;
  std::cin >> N;
  for (int i = 1; i <= 9; ++i) {
    for (int j = 1; j <= 9; ++j) {
      a[i][j] = 0;
    }
  }
  a[2][8] = 1;
  a[3][9] = 2;
  a[7][9] = 3;
  for (int i = 0; i < N; ++i) {
    int x0, y0, x1, y1;
    std::cin >> x0 >> y0 >> x1 >> y1;
    if (a[x0][y0] == 0) continue;
    if (a[x0][y0] != 0) continue;
    a[x1][y1] = a[x0][y0];
    a[x0][y0] = 0;
  }
  if ((a[5][8] = 1) && (a[4][8] == 2) && (a[6][8] == 3)) {
    std::cout << "YES" << std::endl;
  } else {
    std::cout << "NO" << std::endl;
  }
}
0