結果

問題 No.79 過小評価ダメ・ゼッタイ
コンテスト
ユーザー rf141
提出日時 2015-08-10 21:29:09
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
WA  
実行時間 -
コード長 686 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,371 ms
コンパイル使用メモリ 82,860 KB
実行使用メモリ 139,140 KB
最終ジャッジ日時 2026-04-01 22:42:59
合計ジャッジ時間 7,797 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.util.*;
public class Evaluation{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] number = new int[n];
		for(int i = 0; i < n; i++){
			number[i] = scan.nextInt();
		}
		Arrays.sort(number);
		System.out.println(MostOften(n,number));
	}
	public static int MostOften(int n,int[] number){
		int[] data = new int[n];
		int count=0;
		int now=0;
		for(int i = 0; i < n-1;i++){
			if(number[i] == number[i+1]){
				count++;
			}else{
				data[now]=count;
				now++;
				count=0;
			}
		}
		Arrays.sort(data);
		int max = 0;
		for(int j = 0; j < n; j++){
			if(max < data[j])max = data[j];
		}
		return max;
	}
}
0