結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  funakoshi | 
| 提出日時 | 2019-08-07 16:04:42 | 
| 言語 | C (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 685 bytes | 
| コンパイル時間 | 229 ms | 
| コンパイル使用メモリ | 29,696 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-18 18:29:10 | 
| 合計ジャッジ時間 | 777 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 3 WA * 7 | 
ソースコード
#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);
}
            
            
            
        