結果

問題 No.24 数当てゲーム
ユーザー Rumain831
提出日時 2025-05-04 20:53:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 558 bytes
コンパイル時間 764 ms
コンパイル使用メモリ 76,376 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-05-04 20:53:11
合計ジャッジ時間 1,281 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<set>
using namespace std;

int main(void){
  int n; cin >> n;
  vector<bool> ok(n, true);
  for(int i=0; i<n; i++){
    int a[4];
    for(int j=0; j<4; j++) cin >> a[j];
    string r; cin >> r;
    if(r=="NO"){
      for(int j=0; j<4; j++) ok[a[j]]=false;
    }
    else{
      for(int j=0; j<10; j++){
        bool er=true;
        for(int k=0; k<4; k++){
          if(j==a[k]) er=false;
        }
        if(er) ok[j]=false;
      }
    }
  }
  for(int i=0; i<10; i++) if(ok[i]) cout << i << endl;
  return 0;
}
0