結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー yuki2006yuki2006
提出日時 2017-06-05 11:57:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 90 ms / 5,000 ms
コード長 1,000 bytes
コンパイル時間 2,142 ms
コンパイル使用メモリ 104,108 KB
実行使用メモリ 26,376 KB
最終ジャッジ日時 2023-09-08 15:10:02
合計ジャッジ時間 4,995 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
24,032 KB
testcase_01 AC 88 ms
26,340 KB
testcase_02 AC 60 ms
21,756 KB
testcase_03 AC 61 ms
23,760 KB
testcase_04 AC 60 ms
23,696 KB
testcase_05 AC 90 ms
26,376 KB
testcase_06 AC 60 ms
21,644 KB
testcase_07 AC 60 ms
23,640 KB
testcase_08 AC 59 ms
21,676 KB
testcase_09 AC 60 ms
21,688 KB
testcase_10 AC 60 ms
23,700 KB
testcase_11 AC 60 ms
23,660 KB
testcase_12 AC 62 ms
21,812 KB
testcase_13 AC 59 ms
21,584 KB
testcase_14 AC 80 ms
22,996 KB
testcase_15 AC 75 ms
24,544 KB
testcase_16 AC 86 ms
25,840 KB
testcase_17 AC 73 ms
22,568 KB
testcase_18 AC 83 ms
21,824 KB
testcase_19 AC 79 ms
22,856 KB
testcase_20 AC 88 ms
26,300 KB
testcase_21 AC 68 ms
23,976 KB
testcase_22 AC 74 ms
22,552 KB
testcase_23 AC 87 ms
26,220 KB
testcase_24 AC 87 ms
26,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

namespace lecture
{
	class MainClass
	{
		public static void Main(string[] args)
		{

			int N = int.Parse(Console.ReadLine());
			int[] L = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();

            // わざと1つ多めに宣言する 1〜6を使いたい
            int[] counts = new int[7];

            // それぞれの数字が何個あるかカウントする
            for (int i = 0; i < L.Length; i++)
            {
                int j = L[i];
                counts[ j ]++;
            }
            // カウントの最大値を求める
            int max = 0;
			int index = 0;
            // ループを逆にして ループを1つだけにする
			for (int i = 6; i >= 1 ; i--){
                if (max < counts[i]){
                    max = counts[i];
                    index = i;
                }
            }
            Console.WriteLine(index);

		}
	}
}
0