結果

問題 No.24 数当てゲーム
ユーザー satanicsatanic
提出日時 2015-11-23 18:59:11
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 601 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 24,364 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-11 18:22:24
合計ジャッジ時間 960 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int main(){
  int num[10]={1,1,1,1,1,1,1,1,1,1};
  int marker[10]={0};
  int n, input[4];
  char r;
  int i, j;
  
  scanf("%d", &n);
  for(i=0; i<n; ++i){
    for(j=0; j<10; ++j) marker[j]=0;
    for(j=0; j<4; ++j) scanf("%d", &input[j]);
    scanf(" %c%*s", &r);
    switch(r){
    case 'Y':
      for(j=0; j< 4; ++j) marker[input[j]]=1;
      for(j=0; j<10; ++j) num[j]*=marker[j];
      break;
    case 'N':
      for(j=0; j< 4; ++j) num[input[j]]=0;
      break;
    }
  }
  for(i=0; i<10; ++i){
    if(num[i]==1){
      printf("%d\n", i);
      break;
    }
  }
  return 0;
}
0