結果

問題 No.112 ややこしい鶴亀算
ユーザー shinwisteria
提出日時 2019-01-24 20:00:45
言語 Java
(openjdk 23)
結果
AC  
実行時間 164 ms / 5,000 ms
コード長 340 bytes
コンパイル時間 3,232 ms
コンパイル使用メモリ 76,024 KB
実行使用メモリ 42,492 KB
最終ジャッジ日時 2024-09-16 04:42:03
合計ジャッジ時間 7,646 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

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