結果

問題 No.79 過小評価ダメ・ゼッタイ
ユーザー リチウムリチウム
提出日時 2014-11-27 23:24:21
言語 Java19
(openjdk 21)
結果
AC  
実行時間 450 ms / 5,000 ms
コード長 509 bytes
コンパイル時間 2,035 ms
コンパイル使用メモリ 71,688 KB
実行使用メモリ 61,052 KB
最終ジャッジ日時 2023-09-08 14:07:09
合計ジャッジ時間 9,826 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 208 ms
56,788 KB
testcase_01 AC 423 ms
58,824 KB
testcase_02 AC 135 ms
56,436 KB
testcase_03 AC 132 ms
55,840 KB
testcase_04 AC 133 ms
56,112 KB
testcase_05 AC 436 ms
60,308 KB
testcase_06 AC 131 ms
55,664 KB
testcase_07 AC 135 ms
56,216 KB
testcase_08 AC 134 ms
55,856 KB
testcase_09 AC 132 ms
55,932 KB
testcase_10 AC 134 ms
56,196 KB
testcase_11 AC 132 ms
53,732 KB
testcase_12 AC 136 ms
54,164 KB
testcase_13 AC 133 ms
56,004 KB
testcase_14 AC 369 ms
59,172 KB
testcase_15 AC 289 ms
60,124 KB
testcase_16 AC 399 ms
60,440 KB
testcase_17 AC 270 ms
60,588 KB
testcase_18 AC 406 ms
60,532 KB
testcase_19 AC 359 ms
60,160 KB
testcase_20 AC 437 ms
61,052 KB
testcase_21 AC 197 ms
58,772 KB
testcase_22 AC 318 ms
59,792 KB
testcase_23 AC 425 ms
60,608 KB
testcase_24 AC 450 ms
60,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import static java.lang.Math.*;

public class Main {
	
	
  public static void main(String[] args) {
	  Scanner sc=new Scanner(System.in);
	  int n=sc.nextInt();
	  int l[]=new int[n];
	  int a[]=new int[200000];
	  for(int i=0;i<n;i++){
		  a[sc.nextInt()]++;
	  }
	  int max=0;
	  for(int i=0;i<200000;i++){
		  max=Math.max(max,a[i]);
	  }
	  int ans=0;
	  for(int i=200000-1;i>=0;i--){
		  if(a[i]==max){
			  System.out.println(i);
			  return;
		  }
	  }
  }}
0