結果

問題 No.112 ややこしい鶴亀算
ユーザー Maeda
提出日時 2025-09-08 10:32:04
言語 Java
(openjdk 23)
結果
AC  
実行時間 176 ms / 5,000 ms
コード長 378 bytes
コンパイル時間 2,841 ms
コンパイル使用メモリ 77,472 KB
実行使用メモリ 43,500 KB
最終ジャッジ日時 2025-09-08 10:32:13
合計ジャッジ時間 8,151 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int total = 0;
        for(int i = 0 ;  i < n ; i++ ){
        	total += scan.nextInt();
        }
        total /= ( n - 1 ) * 2;
        System.out.println((2*n-total) + " " + (total-n));
        
    }
}
0