結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-09-30 19:16:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 156 ms / 5,000 ms
コード長 773 bytes
コンパイル時間 5,562 ms
コンパイル使用メモリ 72,432 KB
実行使用メモリ 60,588 KB
最終ジャッジ日時 2023-09-08 15:15:13
合計ジャッジ時間 6,647 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
51,104 KB
testcase_01 AC 154 ms
60,588 KB
testcase_02 AC 42 ms
49,092 KB
testcase_03 AC 42 ms
49,364 KB
testcase_04 AC 41 ms
49,416 KB
testcase_05 AC 156 ms
60,196 KB
testcase_06 AC 44 ms
49,332 KB
testcase_07 AC 41 ms
49,392 KB
testcase_08 AC 42 ms
49,432 KB
testcase_09 AC 43 ms
49,372 KB
testcase_10 AC 41 ms
49,120 KB
testcase_11 AC 45 ms
49,156 KB
testcase_12 AC 45 ms
49,164 KB
testcase_13 AC 42 ms
49,460 KB
testcase_14 AC 108 ms
56,396 KB
testcase_15 AC 86 ms
54,800 KB
testcase_16 AC 138 ms
58,652 KB
testcase_17 AC 74 ms
54,032 KB
testcase_18 AC 131 ms
58,816 KB
testcase_19 AC 98 ms
56,576 KB
testcase_20 AC 155 ms
60,356 KB
testcase_21 AC 53 ms
51,272 KB
testcase_22 AC 95 ms
54,096 KB
testcase_23 AC 147 ms
57,940 KB
testcase_24 AC 146 ms
57,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class No79 {

	public static void main(String[] args) {
		
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int N = Integer.parseInt(br.readLine());
			int[] Hyoka = new int[6];
			
			String[] temp = br.readLine().split(" ");
			int[] temp2 = new int[N];
			
			for(int i=0; i < N; i++)
				temp2[i] = Integer.parseInt(temp[i]);
			
			for(int i=0; i < N; i++)
				Hyoka[temp2[i] - 1]++;
			
			System.out.println(getI(Hyoka));
			
		}catch(Exception e){
			e.getStackTrace();
		}
		
	}
	
	public static int getI(int[] x){
		int I = 0;
		int max = 0;
		for (int i =0; i< x.length; i++){
			if (x[i] >= max){
				max =x[i];
				I = i+1;
			}
		}
		return I;
	}
}
0