結果

問題 No.24 数当てゲーム
コンテスト
ユーザー しめはじめ
提出日時 2019-07-30 11:21:33
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 792 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 152 ms
コンパイル使用メモリ 38,212 KB
最終ジャッジ日時 2026-02-22 04:03:29
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
int main(void){
    int n;
    scanf( "%d", &n );

    int i;
    int num[4];
    int ans[10];
    
    int yescount = 0;
    char temp[4];

    for( i = 0; i <= 9; i++ ){
        ans[i] = 0;
    }

    for( i = 0; i < n; i++ ){
        scanf( "%d %d %d %d %s", &num[0], &num[1], &num[2], &num[3], temp );
        if( temp[0] == 'N' ){
            ans[num[0]] -= 10;
            ans[num[1]] -= 10;
            ans[num[2]] -= 10;
            ans[num[3]] -= 10;
        }else{
            ans[num[0]] += 1;
            ans[num[1]] += 1;
            ans[num[2]] += 1;
            ans[num[3]] += 1;
            yescount++;
        }
    }

    for( i = 0; i <= 9; i++ ){
        if( ans[i] >= yescount ){
            printf( "%d\n", i );
            return 0;
        }
    }
}
0