結果

問題 No.112 ややこしい鶴亀算
ユーザー GrenacheGrenache
提出日時 2015-09-23 20:08:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 426 bytes
コンパイル時間 4,712 ms
コンパイル使用メモリ 72,064 KB
実行使用メモリ 56,544 KB
最終ジャッジ日時 2023-09-26 14:38:50
合計ジャッジ時間 7,545 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,224 KB
testcase_01 AC 123 ms
56,112 KB
testcase_02 AC 122 ms
56,000 KB
testcase_03 AC 123 ms
55,772 KB
testcase_04 AC 124 ms
54,524 KB
testcase_05 AC 124 ms
55,980 KB
testcase_06 AC 123 ms
56,012 KB
testcase_07 AC 123 ms
56,368 KB
testcase_08 AC 125 ms
55,712 KB
testcase_09 AC 129 ms
55,720 KB
testcase_10 AC 124 ms
55,468 KB
testcase_11 AC 126 ms
55,808 KB
testcase_12 AC 124 ms
55,980 KB
testcase_13 AC 124 ms
56,064 KB
testcase_14 AC 130 ms
56,032 KB
testcase_15 AC 133 ms
55,892 KB
testcase_16 AC 129 ms
55,632 KB
testcase_17 AC 129 ms
55,724 KB
testcase_18 AC 131 ms
55,896 KB
testcase_19 AC 130 ms
55,752 KB
testcase_20 AC 131 ms
55,824 KB
testcase_21 AC 132 ms
56,120 KB
testcase_22 AC 129 ms
56,088 KB
testcase_23 AC 129 ms
56,544 KB
testcase_24 AC 129 ms
56,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder112 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < n; i++) {
        	sum += sc.nextInt();
        }

        sum /= n - 1;
        int b = (sum - 2 * n) / 2;

        System.out.printf("%d %d\n", n - b, b);
        
        sc.close();
    }
}
0