結果

問題 No.24 数当てゲーム
ユーザー y_mazuny_mazun
提出日時 2015-04-24 21:32:04
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 470 bytes
コンパイル時間 613 ms
コンパイル使用メモリ 35,652 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-18 09:33:41
合計ジャッジ時間 984 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }

#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <set>

using namespace std;

int main(){
  int can[10]; REP(i,10) can[i] = 1;

  const int n = getInt();
  REP(i,n){
    int a[10]; REP(i,10) a[i] = 0;
    REP(i,4) a[getInt()] = 1;
    char r[10]; scanf("%s", r);
    REP(i,10)
      can[i] &= r[0] == 'Y' ? a[i] : !a[i];
  }

  REP(i,10) if(can[i])
    printf("%d\n", i);

  return 0;
}
0