結果

問題 No.870 無敵囲い
ユーザー ui_mtcui_mtc
提出日時 2020-01-24 21:52:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 977 bytes
コンパイル時間 1,637 ms
コンパイル使用メモリ 167,664 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-11 16:29:28
合計ジャッジ時間 2,515 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define int long long 
using namespace std;


signed main() {
  int N;
  cin >> N;
  
  vector<string> masu(9, ".........");
  int X1, Y1, X2, Y2;
  bool fg1 = false;
  bool fg2 = false;
  bool fg3 = false;
  for( int i = 0; i < N; i++ ){
    cin >> X1 >> Y1 >> X2 >> Y2;
    X1--;
    Y1--;
    X2--;
    Y2--;
    if( (X1 == 1 && Y1 == 7) || masu.at(X1).at(Y1) == 'A' ){
      fg1 = true;
      masu.at(X1).at(Y1) = 'A';
      masu.at(X2).at(Y2) = 'A';
    }else if( (X1 == 2 && Y1 == 8) || masu.at(X1).at(Y1) == 'B' ){
      fg2 = true;
      masu.at(X1).at(Y1) = 'B';
      masu.at(X2).at(Y2) = 'B';
    }else if( (X1 == 6 && Y1 == 8) || masu.at(X1).at(Y1) == 'C' ){
      fg3 = true;
      masu.at(X1).at(Y1) = 'C';
      masu.at(X2).at(Y2) = 'C';
    }
  }
  
  if( fg1 && fg2 && fg3 && masu.at(4).at(7) == 'A' && masu.at(3).at(7) == 'B' && masu.at(5).at(7) == 'C' ){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }
    
  
}
  
0