結果

問題 No.112 ややこしい鶴亀算
ユーザー mitsuomitsuo
提出日時 2016-05-05 11:07:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 166 ms / 5,000 ms
コード長 673 bytes
コンパイル時間 2,662 ms
コンパイル使用メモリ 83,520 KB
実行使用メモリ 55,384 KB
最終ジャッジ日時 2024-04-15 13:06:22
合計ジャッジ時間 7,871 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 161 ms
54,852 KB
testcase_01 AC 159 ms
55,192 KB
testcase_02 AC 157 ms
55,048 KB
testcase_03 AC 161 ms
54,868 KB
testcase_04 AC 159 ms
54,948 KB
testcase_05 AC 160 ms
54,960 KB
testcase_06 AC 159 ms
55,384 KB
testcase_07 AC 160 ms
54,912 KB
testcase_08 AC 160 ms
54,936 KB
testcase_09 AC 161 ms
55,056 KB
testcase_10 AC 161 ms
55,020 KB
testcase_11 AC 158 ms
55,172 KB
testcase_12 AC 162 ms
55,048 KB
testcase_13 AC 161 ms
54,968 KB
testcase_14 AC 162 ms
54,988 KB
testcase_15 AC 166 ms
55,328 KB
testcase_16 AC 163 ms
55,172 KB
testcase_17 AC 160 ms
54,932 KB
testcase_18 AC 159 ms
55,004 KB
testcase_19 AC 159 ms
55,004 KB
testcase_20 AC 159 ms
55,156 KB
testcase_21 AC 161 ms
55,096 KB
testcase_22 AC 165 ms
55,240 KB
testcase_23 AC 165 ms
55,296 KB
testcase_24 AC 164 ms
55,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package jp.fedom.challange.yuki.q112;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> input = new ArrayList<>();
		while (sc.hasNext()) {
			input.add(sc.nextLine());
		}

		System.out.println(solve(input));

		sc.close();
	}

	public static String solve(List<String> in) {
		int N = Integer.valueOf(in.get(0).split(" ")[0]);
		int t = 0;
		for (String s : in.get(1).split(" ")) {
			t += Integer.valueOf(s);
		}
		int kame = (t - ((N - 1) * N * 2)) / (2 * (N - 1));
		int tsuru = N - kame;
		return tsuru + " " + kame;
	}

}
0