結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー fujitafujita
提出日時 2023-05-09 14:07:46
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 181 ms / 5,000 ms
コード長 1,181 bytes
コンパイル時間 10,009 ms
コンパイル使用メモリ 167,936 KB
実行使用メモリ 190,044 KB
最終ジャッジ日時 2024-11-26 01:06:40
合計ジャッジ時間 13,891 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
29,912 KB
testcase_01 AC 181 ms
36,992 KB
testcase_02 AC 53 ms
29,568 KB
testcase_03 AC 54 ms
29,312 KB
testcase_04 AC 52 ms
29,568 KB
testcase_05 AC 171 ms
37,244 KB
testcase_06 AC 52 ms
29,056 KB
testcase_07 AC 51 ms
28,532 KB
testcase_08 AC 52 ms
29,568 KB
testcase_09 AC 53 ms
29,440 KB
testcase_10 AC 52 ms
29,440 KB
testcase_11 AC 53 ms
29,436 KB
testcase_12 AC 53 ms
29,684 KB
testcase_13 AC 54 ms
29,556 KB
testcase_14 AC 130 ms
34,944 KB
testcase_15 AC 91 ms
32,344 KB
testcase_16 AC 151 ms
35,712 KB
testcase_17 AC 87 ms
32,116 KB
testcase_18 AC 148 ms
35,580 KB
testcase_19 AC 123 ms
34,164 KB
testcase_20 AC 180 ms
36,860 KB
testcase_21 AC 56 ms
30,208 KB
testcase_22 AC 100 ms
32,896 KB
testcase_23 AC 168 ms
36,352 KB
testcase_24 AC 175 ms
190,044 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (95 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;

namespace yukicoder
{
    class Program
    {

        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int count = 0 , maxcount = 0 , num = 0;
            var str = Console.ReadLine();
            var g = str.Split(" ");
            string[] strings = new string[g.Length];
            for (int i = 0; i < g.Length; i++)
            {
                
                strings[i] = g[i];//入力された文字を配列に
            }
            Array.Sort(strings);

            for (int j = 0; j < strings.Length - 1; j++)
            {
                if (strings[j] == strings[j + 1])
                {
                    count++;
                    if (maxcount <= count)
                    {
                        maxcount = count;
                        num = int.Parse(strings[j]);
                    }
                }
                else
                {
                    count = 0;
                }
            }
            if (num == 0)
            {
                num = int.Parse(strings[strings.Length - 1]);
            }
            Console.WriteLine(num);
        }
    }
}
0