結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  funakoshi | 
| 提出日時 | 2019-06-20 15:42:13 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,846 bytes | 
| コンパイル時間 | 821 ms | 
| コンパイル使用メモリ | 113,212 KB | 
| 実行使用メモリ | 26,220 KB | 
| 最終ジャッジ日時 | 2024-12-17 17:55:11 | 
| 合計ジャッジ時間 | 1,572 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 3 WA * 7 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace yukicoderTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string num = "0123456789";
            string n = Console.ReadLine();
            int loop = int.Parse(n);
            int[] cnt = new int[10];
            for (int i = 0; i < cnt.Length; i++)
            {
                cnt[i] = 0;
            }
            for(int i=0;i<loop;i++)
            {
                string str = Console.ReadLine();
                string[] jiro = str.Split(' ');
                if(jiro[4]=="YES")
                {
                    int a = int.Parse(jiro[0]);
                    int b = int.Parse(jiro[1]);
                    int c = int.Parse(jiro[2]);
                    int d = int.Parse(jiro[3]);
                    cnt[a] = cnt[a] + 1;
                    cnt[b] = cnt[b] + 1;
                    cnt[c] = cnt[c] + 1;
                    cnt[d] = cnt[d] + 1;
                }
                else
                {
                    int a = int.Parse(jiro[0]);
                    int b = int.Parse(jiro[1]);
                    int c = int.Parse(jiro[2]);
                    int d = int.Parse(jiro[3]);
                    cnt[a] = cnt[a] - 1;
                    cnt[b] = cnt[b] - 1;
                    cnt[c] = cnt[c] - 1;
                    cnt[d] = cnt[d] - 1;
                }
            }
            string max = "";
            int m = -100;
            for (int i=1;i<cnt.Length;i++)
            {
                if (m < cnt[i])
                {
                   max = num.Substring(i, 1);
                   m = int.Parse(max);
                }
                
                
            }
            Console.WriteLine(max);
        }
    }
}
            
            
            
        