結果

問題 No.112 ややこしい鶴亀算
ユーザー koukonko
提出日時 2015-12-11 18:34:46
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 837 bytes
コンパイル時間 3,418 ms
コンパイル使用メモリ 75,872 KB
実行使用メモリ 53,360 KB
最終ジャッジ日時 2024-09-15 08:14:52
合計ジャッジ時間 5,080 ms
ジャッジサーバーID
(参考情報)
judge2 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
	public static void main(String[] args) {
		BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));

		try {
			int count = Integer.parseInt(buff.readLine());

			String[] box = buff.readLine().split(" ");
			int[] num = new int[count];
			int max = 0;

			for(int i = 0; i < count; ++i){
				num[i] = Integer.parseInt(box[i]);
				if(max < num[i]){
					max = num[i];
				}
			}
			int crane = 0;
			for(int i = 0; i < count; ++i){
				if(max == num[i]){
					crane++;
				}
			}

			System.out.println(crane + " " + (count-crane));

		} catch (NumberFormatException e) {
			e.getStackTrace();
		} catch (IOException e) {
			e.getStackTrace();
		} catch (Exception e) {
			e.getStackTrace();
		}
	}
}
0