結果

問題 No.112 ややこしい鶴亀算
ユーザー mits58mits58
提出日時 2016-07-02 11:50:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 163 ms / 5,000 ms
コード長 285 bytes
コンパイル時間 2,055 ms
コンパイル使用メモリ 76,016 KB
実行使用メモリ 42,648 KB
最終ジャッジ日時 2024-04-20 07:18:33
合計ジャッジ時間 6,754 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
42,492 KB
testcase_01 AC 151 ms
42,440 KB
testcase_02 AC 143 ms
42,280 KB
testcase_03 AC 146 ms
42,340 KB
testcase_04 AC 146 ms
42,512 KB
testcase_05 AC 147 ms
42,336 KB
testcase_06 AC 145 ms
42,356 KB
testcase_07 AC 145 ms
42,216 KB
testcase_08 AC 147 ms
42,624 KB
testcase_09 AC 144 ms
42,140 KB
testcase_10 AC 150 ms
42,212 KB
testcase_11 AC 146 ms
42,100 KB
testcase_12 AC 149 ms
42,216 KB
testcase_13 AC 149 ms
42,464 KB
testcase_14 AC 159 ms
42,360 KB
testcase_15 AC 156 ms
42,512 KB
testcase_16 AC 162 ms
42,528 KB
testcase_17 AC 163 ms
42,348 KB
testcase_18 AC 151 ms
42,384 KB
testcase_19 AC 154 ms
42,332 KB
testcase_20 AC 153 ms
42,356 KB
testcase_21 AC 155 ms
42,172 KB
testcase_22 AC 153 ms
41,700 KB
testcase_23 AC 133 ms
42,416 KB
testcase_24 AC 154 ms
42,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
			int n=sc.nextInt(); int s=0;
			for(int i=0;i<n;i++) s+=sc.nextInt();
			int x=(4*n-s/(n-1))/2;
			int y=(s/(n-1)-2*n)/2;
			System.out.println(x+" "+y);
	}
}
0