結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー spaciaspacia
提出日時 2015-12-29 17:45:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 153 ms / 5,000 ms
コード長 625 bytes
コンパイル時間 2,050 ms
コンパイル使用メモリ 71,904 KB
実行使用メモリ 58,652 KB
最終ジャッジ日時 2023-09-08 14:41:58
合計ジャッジ時間 5,406 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
50,296 KB
testcase_01 AC 150 ms
57,944 KB
testcase_02 AC 42 ms
49,436 KB
testcase_03 AC 43 ms
49,320 KB
testcase_04 AC 42 ms
49,296 KB
testcase_05 AC 149 ms
57,876 KB
testcase_06 AC 43 ms
49,088 KB
testcase_07 AC 42 ms
49,400 KB
testcase_08 AC 43 ms
49,392 KB
testcase_09 AC 42 ms
49,432 KB
testcase_10 AC 42 ms
49,232 KB
testcase_11 AC 43 ms
49,320 KB
testcase_12 AC 42 ms
49,524 KB
testcase_13 AC 43 ms
49,332 KB
testcase_14 AC 121 ms
57,176 KB
testcase_15 AC 88 ms
54,904 KB
testcase_16 AC 134 ms
57,748 KB
testcase_17 AC 86 ms
54,324 KB
testcase_18 AC 138 ms
57,988 KB
testcase_19 AC 116 ms
56,768 KB
testcase_20 AC 151 ms
58,652 KB
testcase_21 AC 54 ms
50,748 KB
testcase_22 AC 96 ms
54,104 KB
testcase_23 AC 149 ms
57,956 KB
testcase_24 AC 153 ms
57,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.math.*;

class Main79 {
	
	public static void out (Object out) {
		System.out.println(out);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int[] nums = new int[7];
		String[] line = br.readLine().split(" ");
		
		for (int i = 0; i < n; i++)
			nums[Integer.parseInt(line[i])]++;
		
		int ans = 0, max = 0;
		for (int i = 1; i <= 6; i++) {
			if (max <= nums[i]) {
				max = nums[i];
				ans = i;
			}
		}
		
		out(ans);
		
	}
}
0