結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー TDTD
提出日時 2022-06-01 09:45:01
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 933 bytes
コンパイル時間 971 ms
コンパイル使用メモリ 106,640 KB
実行使用メモリ 28,428 KB
最終ジャッジ日時 2023-10-21 00:46:44
合計ジャッジ時間 3,258 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 25 ms
24,116 KB
testcase_04 AC 25 ms
24,116 KB
testcase_05 AC 51 ms
28,428 KB
testcase_06 AC 25 ms
24,116 KB
testcase_07 AC 26 ms
24,116 KB
testcase_08 WA -
testcase_09 AC 25 ms
24,116 KB
testcase_10 AC 25 ms
24,116 KB
testcase_11 AC 25 ms
24,116 KB
testcase_12 AC 25 ms
24,116 KB
testcase_13 AC 25 ms
24,116 KB
testcase_14 WA -
testcase_15 AC 35 ms
25,188 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 42 ms
25,496 KB
testcase_20 AC 52 ms
28,428 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');
            int b;
            int ans = 0;
            int[] c = new int[10];
            for(int i = 0; i < a; i++)
            {
                b = int.Parse(s[i]);
                for(int j = 1; j <= 10; j++)
                {
                    if (b == j) 
                    {
                        c[j - 1]++;
                    }
                }
            }
            for(int x = 0; x <= 8; x++)
            {
                if (c[x] > c[x + 1])
                {
                    ans = x+1;
                }
                else if (c[x + 1] > c[x])
                {
                    ans = x + 1;
                }
            }
            Console.WriteLine(ans);
        }

    }
}
0