結果
問題 | No.79 過小評価ダメ・ゼッタイ |
ユーザー |
|
提出日時 | 2017-09-30 19:16:19 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 171 ms / 5,000 ms |
コード長 | 773 bytes |
コンパイル時間 | 3,450 ms |
コンパイル使用メモリ | 75,152 KB |
実行使用メモリ | 49,544 KB |
最終ジャッジ日時 | 2024-06-26 08:18:39 |
合計ジャッジ時間 | 6,724 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
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; } }