結果

問題 No.24 数当てゲーム
ユーザー ongakucasongakucas
提出日時 2020-01-08 16:23:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 595 bytes
コンパイル時間 1,453 ms
コンパイル使用メモリ 163,172 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-15 00:37:08
合計ジャッジ時間 2,116 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
typedef long long ll;

int main(){
  int n;
  cin >> n;
  int a,b,c,d;
  string r;
  int s[] = {0,1,2,3,4,5,6,7,8,9};
  rep(i,n){
    cin >> a >> b >> c >> d >> r;
    if(r=="YES"){
      rep(j,10){
        if(j!=a && j!=b && j!=c && j!=d){
          s[j] = -1;
          }
        }
      }else{
        s[a] = -1;
        s[b] = -1;
        s[c] = -1;
        s[d] = -1;
    }
  }
  rep(i,10){
    if(s[i]!=-1){
      cout << s[i] << endl;
      return 0;
    }
  }
}
0