結果

問題 No.112 ややこしい鶴亀算
ユーザー カニ戯(ryカニ戯(ry
提出日時 2015-02-25 10:42:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 162 ms / 5,000 ms
コード長 311 bytes
コンパイル時間 2,172 ms
コンパイル使用メモリ 74,560 KB
実行使用メモリ 58,340 KB
最終ジャッジ日時 2023-09-06 04:21:35
合計ジャッジ時間 7,174 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 150 ms
56,836 KB
testcase_01 AC 150 ms
56,528 KB
testcase_02 AC 153 ms
56,452 KB
testcase_03 AC 153 ms
56,712 KB
testcase_04 AC 149 ms
56,492 KB
testcase_05 AC 147 ms
56,340 KB
testcase_06 AC 150 ms
58,340 KB
testcase_07 AC 146 ms
56,932 KB
testcase_08 AC 145 ms
56,504 KB
testcase_09 AC 147 ms
56,568 KB
testcase_10 AC 147 ms
56,524 KB
testcase_11 AC 153 ms
56,848 KB
testcase_12 AC 150 ms
56,648 KB
testcase_13 AC 144 ms
56,628 KB
testcase_14 AC 152 ms
56,556 KB
testcase_15 AC 151 ms
56,704 KB
testcase_16 AC 152 ms
56,592 KB
testcase_17 AC 155 ms
56,612 KB
testcase_18 AC 153 ms
56,724 KB
testcase_19 AC 156 ms
56,832 KB
testcase_20 AC 162 ms
56,612 KB
testcase_21 AC 155 ms
56,728 KB
testcase_22 AC 153 ms
56,456 KB
testcase_23 AC 154 ms
56,484 KB
testcase_24 AC 147 ms
56,528 KB
権限があれば一括ダウンロードができます

ソースコード

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