結果

問題 No.24 数当てゲーム
ユーザー sk3388607083sk3388607083
提出日時 2018-06-21 14:58:49
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 523 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 25,596 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 07:32:53
合計ジャッジ時間 747 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>
#include<string.h>

int main(void){
  int i, j;
  int N, A, B, C, D;
  char R[8];
  int S[10] = {};

  scanf("%d", &N);
  for(i = 0; i < N; i++){
    scanf("%d %d %d %d %s", &A, &B, &C, &D, R);
    if(!strcmp(R, "NO")){
      S[A] = 1;
      S[B] = 1;
      S[C] = 1;
      S[D] = 1;
    }
    else if(!strcmp(R, "YES")){
      for(j = 0; j < 10; j++){
	if(j != A && j != B && j != C && j != D) S[j] = 1;
      }
    }
  }
  for(j = 0; j < 10; j++){
    if(S[j] == 0) printf("%d\n", j);
  }
  return 0;
}
0