結果

問題 No.112 ややこしい鶴亀算
ユーザー scache
提出日時 2015-09-19 17:27:40
言語 Java
(openjdk 23)
結果
AC  
実行時間 158 ms / 5,000 ms
コード長 424 bytes
コンパイル時間 3,344 ms
コンパイル使用メモリ 77,140 KB
実行使用メモリ 55,036 KB
最終ジャッジ日時 2024-07-19 08:05:15
合計ジャッジ時間 8,087 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main253 {
	public static void main(String[] args) {
		Main253 p = new Main253();
	}

	public Main253() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count = 0;
		for(int i=0;i<n;i++){
			count += sc.nextInt();
		}
		
		int total = count/(n-1);
		
		int crane = (total-n*2)/2;
		System.out.println((n-crane) +" " + crane);
		
	}

	public void solve() {
	}

}
0