結果

問題 No.24 数当てゲーム
ユーザー funakoshifunakoshi
提出日時 2019-08-07 16:04:42
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 685 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 28,832 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-25 22:49:16
合計ジャッジ時間 1,039 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int main(void)
{
    int turn,a,b,c,d;
    int cnt[10]={};
    char yorn=' ';
    scanf("%d",&turn);
    for(int i=0;i<turn;i++)
    {
        scanf("%d %d %d %d %c",&a,&b,&c,&d,&yorn);
        if(yorn=='Y')
        {
            cnt[a]++;
            cnt[b]++;
            cnt[c]++;
            cnt[d]++;
        }
        else
        {
            cnt[a]--;
            cnt[b]--;
            cnt[c]--;
            cnt[d]--;
        }
    }
    int max=-1000;
    int ans=0;
    for(int i=0;i<10;i++)
    {
        if(max<cnt[i])
        {
            max=cnt[i];
            ans=i;
        }
    }
    printf("%d",ans);
}
0