結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー ぴろずぴろず
提出日時 2014-12-05 11:30:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 452 ms / 5,000 ms
コード長 417 bytes
コンパイル時間 3,045 ms
コンパイル使用メモリ 71,048 KB
実行使用メモリ 60,700 KB
最終ジャッジ日時 2023-09-08 14:11:48
合計ジャッジ時間 10,814 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 206 ms
59,396 KB
testcase_01 AC 441 ms
60,296 KB
testcase_02 AC 124 ms
53,616 KB
testcase_03 AC 122 ms
55,792 KB
testcase_04 AC 119 ms
56,336 KB
testcase_05 AC 442 ms
60,588 KB
testcase_06 AC 119 ms
56,088 KB
testcase_07 AC 123 ms
55,724 KB
testcase_08 AC 124 ms
55,624 KB
testcase_09 AC 118 ms
55,964 KB
testcase_10 AC 124 ms
53,900 KB
testcase_11 AC 124 ms
55,680 KB
testcase_12 AC 125 ms
56,112 KB
testcase_13 AC 124 ms
55,948 KB
testcase_14 AC 378 ms
60,340 KB
testcase_15 AC 302 ms
60,676 KB
testcase_16 AC 399 ms
60,156 KB
testcase_17 AC 272 ms
59,884 KB
testcase_18 AC 408 ms
60,248 KB
testcase_19 AC 364 ms
59,952 KB
testcase_20 AC 435 ms
60,700 KB
testcase_21 AC 188 ms
58,568 KB
testcase_22 AC 327 ms
60,228 KB
testcase_23 AC 420 ms
60,284 KB
testcase_24 AC 452 ms
60,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no079;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] c = new int[7];
		for(int i=0;i<n;i++) {
			c[sc.nextInt()]++;
		}
		int ans = 0;
		int max = 0;
		for(int i=1;i<7;i++) {
			if (max <= c[i]) {
				max = c[i];
				ans = i;
			}
		}
		System.out.println(ans);
	}

}
0