結果

問題 No.112 ややこしい鶴亀算
ユーザー カニ戯(ry
提出日時 2015-02-25 10:42:48
言語 Java
(openjdk 23)
結果
AC  
実行時間 188 ms / 5,000 ms
コード長 311 bytes
コンパイル時間 2,445 ms
コンパイル使用メモリ 76,648 KB
実行使用メモリ 42,644 KB
最終ジャッジ日時 2024-06-23 23:11:03
合計ジャッジ時間 7,722 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] a) {
		Scanner s = new Scanner(System.in);
		int N=s.nextInt(),i=0,S=0,C=0,T=0;
		int[] F=new int[N];
		for(;s.hasNext();)S+=(F[i++]=s.nextInt());
		S/=N-1;
		for(int f:F)if(S-f==2)C++;else T++;
		System.out.println(C+" "+T);
	}
}
0