結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 23 ms
24,204 KB
testcase_04 AC 25 ms
24,204 KB
testcase_05 AC 49 ms
28,528 KB
testcase_06 AC 23 ms
24,204 KB
testcase_07 AC 23 ms
24,204 KB
testcase_08 WA -
testcase_09 AC 24 ms
24,204 KB
testcase_10 AC 24 ms
24,204 KB
testcase_11 AC 24 ms
24,204 KB
testcase_12 AC 23 ms
24,204 KB
testcase_13 AC 24 ms
24,204 KB
testcase_14 WA -
testcase_15 AC 33 ms
25,288 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 39 ms
25,596 KB
testcase_20 AC 50 ms
28,528 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().Trim().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;
                }
                else if (c[x + 1] > c[x])
                {
                    ans = x + 1;
                }
            }
            Console.WriteLine(ans+1);
        }

    }
}
0