結果

問題 No.24 数当てゲーム
ユーザー commycommy
提出日時 2016-05-09 15:18:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 565 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 64,884 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 14:55:36
合計ジャッジ時間 1,086 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
using namespace std;

int yeslist[9];
int nolist[9];
int cnt;

int main(){
  int N;
  cin>>N;
  for(int i=0;i<N;i++){
    int a,b,c,d;
    string str;
    cin>>a>>b>>c>>d>>str;
    if(str == "YES"){
      cnt++;
      yeslist[a-1]++;
      yeslist[b-1]++;
      yeslist[c-1]++;
      yeslist[d-1]++;
    }else{
      nolist[a-1] |= 1;
      nolist[b-1] |= 1;
      nolist[c-1] |= 1;
      nolist[d-1] |= 1;
    }
  }
  for(int i=0;i<9;i++){
    if(yeslist[i] == cnt && !nolist[i]){
      cout<<i+1<<endl;
    }
  }
  return 0;
}
0