結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー fujitafujita
提出日時 2023-05-09 14:07:46
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 174 ms / 5,000 ms
コード長 1,181 bytes
コンパイル時間 13,968 ms
コンパイル使用メモリ 146,292 KB
実行使用メモリ 172,744 KB
最終ジャッジ日時 2023-08-17 06:41:49
合計ジャッジ時間 13,762 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
29,696 KB
testcase_01 AC 171 ms
35,284 KB
testcase_02 AC 50 ms
29,412 KB
testcase_03 AC 51 ms
29,588 KB
testcase_04 AC 52 ms
29,432 KB
testcase_05 AC 164 ms
36,920 KB
testcase_06 AC 49 ms
30,636 KB
testcase_07 AC 49 ms
28,212 KB
testcase_08 AC 50 ms
29,368 KB
testcase_09 AC 51 ms
29,676 KB
testcase_10 AC 51 ms
29,476 KB
testcase_11 AC 52 ms
31,456 KB
testcase_12 AC 51 ms
29,256 KB
testcase_13 AC 52 ms
29,552 KB
testcase_14 AC 124 ms
34,940 KB
testcase_15 AC 79 ms
30,940 KB
testcase_16 AC 142 ms
33,952 KB
testcase_17 AC 76 ms
30,992 KB
testcase_18 AC 141 ms
34,100 KB
testcase_19 AC 113 ms
32,644 KB
testcase_20 AC 174 ms
37,188 KB
testcase_21 AC 53 ms
29,728 KB
testcase_22 AC 89 ms
31,732 KB
testcase_23 AC 171 ms
37,016 KB
testcase_24 AC 167 ms
172,744 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  Determining projects to restore...
  Restored /home/judge/data/code/main.csproj (in 149 ms).
.NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f
Copyright (C) Microsoft Corporation.All rights reserved.

  プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください
  main -> /home/judge/data/code/bin/Release/net6.0/main.dll
  main -> /home/judge/data/code/bin/Release/net6.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