結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2014-12-17 00:06:02 | 
| 言語 | C90 (gcc 12.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 589 bytes | 
| コンパイル時間 | 120 ms | 
| コンパイル使用メモリ | 21,760 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-11 22:04:54 | 
| 合計ジャッジ時間 | 1,018 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:14:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |   scanf("%d",&N);
      |   ^~~~~~~~~~~~~~
main.c:17:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |     scanf("%d %d %d %d %s",&y[0],&y[1],&y[2],&y[3],r);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include<stdio.h>
#include<string.h>
int main()
{
  int x[10],y[4];
  int i,j,N,a,b,c,d;
  char r[4];
  for (i=0;i<10;i++) {
    x[i]=0;
  }
  scanf("%d",&N);
  for (i=0;i<N;i++) {
    scanf("%d %d %d %d %s",&y[0],&y[1],&y[2],&y[3],r);
    if (strcmp(r,"YES")==0) {
      for (j=0;j<10;j++) {
	if (j!=y[0] && j!=y[1] && j!=y[2] && j!=y[3]) {
	  x[j]=-1;
	}
      }
    } else if (strcmp(r,"NO")==0) {
      for (j=0;j<4;j++) {
	x[y[j]]=-1;
      }
    }
  }
  for (i=0;i<10;i++) {
    if (x[i]==0)
      break;
  }
  printf("%d\n",i);
  return 0;
}
            
            
            
        