結果

問題 No.112 ややこしい鶴亀算
ユーザー shinwisteriashinwisteria
提出日時 2019-01-24 20:00:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 152 ms / 5,000 ms
コード長 340 bytes
コンパイル時間 2,751 ms
コンパイル使用メモリ 73,160 KB
実行使用メモリ 57,284 KB
最終ジャッジ日時 2023-10-14 09:43:16
合計ジャッジ時間 7,170 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
56,816 KB
testcase_01 AC 135 ms
56,976 KB
testcase_02 AC 127 ms
56,800 KB
testcase_03 AC 133 ms
56,504 KB
testcase_04 AC 127 ms
56,856 KB
testcase_05 AC 127 ms
56,992 KB
testcase_06 AC 132 ms
56,908 KB
testcase_07 AC 135 ms
56,776 KB
testcase_08 AC 130 ms
56,876 KB
testcase_09 AC 133 ms
56,452 KB
testcase_10 AC 129 ms
57,108 KB
testcase_11 AC 123 ms
56,536 KB
testcase_12 AC 131 ms
56,452 KB
testcase_13 AC 134 ms
56,768 KB
testcase_14 AC 135 ms
56,844 KB
testcase_15 AC 138 ms
56,576 KB
testcase_16 AC 132 ms
56,800 KB
testcase_17 AC 133 ms
56,760 KB
testcase_18 AC 135 ms
57,284 KB
testcase_19 AC 152 ms
56,532 KB
testcase_20 AC 142 ms
56,888 KB
testcase_21 AC 135 ms
56,684 KB
testcase_22 AC 130 ms
56,860 KB
testcase_23 AC 148 ms
57,064 KB
testcase_24 AC 135 ms
56,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No112 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		s.nextLine();
		int tot = 0;
		for(int i = 0;i < n;i++){
			tot += s.nextInt();
		}
		s.close();

		tot = tot / (n-1);
		int k = tot / 2 - n;
		System.out.println(n - k + " " + k);
	}

}
0