結果

問題 No.112 ややこしい鶴亀算
ユーザー kou6839kou6839
提出日時 2014-12-29 16:59:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 163 ms / 5,000 ms
コード長 426 bytes
コンパイル時間 3,685 ms
コンパイル使用メモリ 74,020 KB
実行使用メモリ 57,228 KB
最終ジャッジ日時 2023-09-03 20:14:05
合計ジャッジ時間 8,154 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 154 ms
56,764 KB
testcase_01 AC 155 ms
56,604 KB
testcase_02 AC 156 ms
57,228 KB
testcase_03 AC 156 ms
56,500 KB
testcase_04 AC 155 ms
56,676 KB
testcase_05 AC 155 ms
57,036 KB
testcase_06 AC 155 ms
56,536 KB
testcase_07 AC 156 ms
56,760 KB
testcase_08 AC 154 ms
56,876 KB
testcase_09 AC 155 ms
56,644 KB
testcase_10 AC 156 ms
56,480 KB
testcase_11 AC 158 ms
56,660 KB
testcase_12 AC 157 ms
56,424 KB
testcase_13 AC 158 ms
56,624 KB
testcase_14 AC 161 ms
56,664 KB
testcase_15 AC 160 ms
56,400 KB
testcase_16 AC 160 ms
56,656 KB
testcase_17 AC 161 ms
56,856 KB
testcase_18 AC 160 ms
56,664 KB
testcase_19 AC 161 ms
56,680 KB
testcase_20 AC 162 ms
56,404 KB
testcase_21 AC 162 ms
56,740 KB
testcase_22 AC 163 ms
56,444 KB
testcase_23 AC 162 ms
56,740 KB
testcase_24 AC 162 ms
56,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.*;
import java.util.*;

class Main {
	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 turu=0;
        int kame=0;
        kame = (sum-n*2)/2;
        turu=n-kame;
        System.out.println(turu+" "+kame);
        
    }
}
0