結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー ooh_25ooh_25
提出日時 2017-06-01 14:39:37
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,007 bytes
コンパイル時間 1,903 ms
コンパイル使用メモリ 111,376 KB
実行使用メモリ 29,796 KB
最終ジャッジ日時 2023-10-21 20:14:26
合計ジャッジ時間 2,835 ms
ジャッジサーバーID
(参考情報)
judge9 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 27 ms
25,460 KB
testcase_03 AC 28 ms
25,460 KB
testcase_04 AC 28 ms
25,460 KB
testcase_05 AC 68 ms
29,796 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 29 ms
25,460 KB
testcase_09 WA -
testcase_10 AC 27 ms
25,460 KB
testcase_11 AC 29 ms
25,460 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 40 ms
26,552 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 50 ms
26,776 KB
testcase_20 AC 69 ms
29,796 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;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace lecture
{
    class Program
    {
        public static void Main(String[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] L = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
           
            Array.Sort(L);

            int X,Y;
            int Ans = 0;
            int counta = 0;
            int countb = 0;
            for(int i = 0; i < L.Length-1; i++)
            {
                X = L[i];
               Y = L[i+1];
                if(X == Y)
                {
                   
                   counta++;
                    if( (X > Ans) && (counta > countb))
                    {
                      Ans = X;
                        countb = counta;

                    }

                }

            }
            Console.WriteLine(Ans);
            }
                  
        }
    }
0