結果

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

テストケース

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

ソースコード

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{
      for(int i=0;i<10;i++){
        ans[i]=0;
      }
      ans[A[i]]=1;
      ans[B[i]]=1;
      ans[C[i]]=1;
      ans[D[i]]=1;
    }
  }
  for(int i=0;i<10;i++){
    if(ans[i]==1){
      cout<<i<<endl;
      break;
    }
  }
  return 0;
}
0