結果

問題 No.24 数当てゲーム
ユーザー HimatsubushinHimatsubushin
提出日時 2019-12-18 07:45:05
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 700 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 28,632 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-19 06:26:21
合計ジャッジ時間 1,069 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

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

int main(void) {
    int i, j, n, max, pos;
    int d[4], yes[10], no[10];
    char b[4];

    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        for (j = 0; j < 4; j++)
            scanf("%d", &d[j]);
        scanf("%s", b);

        if (strcmp(b, "YES") == 0)
            for (j = 0; j < 4; j++)
                yes[d[j]]++;
        else
            for (j = 0; j < 4; j++)
                no[d[j]]++;
    }

    for (i = 0; i < 10; i++)
        if (no[i] > 0)
            yes[i] =0;

    max = 0;
    for (i = 0; i < 10; i++)
        if (max < yes[i]) {
            max = yes[i];
            pos = i;
        }

    printf("%d\n", pos);

    return 0;
}
0