結果

問題 No.24 数当てゲーム
ユーザー math_kpromath_kpro
提出日時 2018-08-15 00:14:43
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 596 bytes
コンパイル時間 430 ms
コンパイル使用メモリ 58,012 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 17:21:37
合計ジャッジ時間 943 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  int A[N],B[N],C[N],D[N];
  string R[N];
  for(int i=0;i<N;i++){
    cin>>A[i]>>B[i]>>C[i]>>D[i]>>R[i];
  }
  int ans[10]={0,1,1,1,1,1,1,1,1,1};
  for(int i=0;i<N;i++){
    if(R[i]=="NO"){
      ans[A[i]]=0;
      ans[B[i]]=0;
      ans[C[i]]=0;
      ans[D[i]]=0;
    }else{
      ans[A[i]]=min(1,ans[A[i]]);
      ans[B[i]]=min(1,ans[B[i]]);
      ans[C[i]]=min(1,ans[C[i]]);
      ans[D[i]]=min(1,ans[D[i]]);
    }
  }
  for(int i=0;i<10;i++){
    if(ans[i]==1){
      cout<<i<<endl;
      break;
    }
  }
  return 0;
}
0