結果

問題 No.813 ユキちゃんの冒険
ユーザー 37zigen37zigen
提出日時 2018-05-26 14:28:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 160 ms / 2,000 ms
コード長 691 bytes
コンパイル時間 2,225 ms
コンパイル使用メモリ 80,840 KB
実行使用メモリ 57,840 KB
最終ジャッジ日時 2023-10-21 07:17:54
合計ジャッジ時間 7,318 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
57,808 KB
testcase_01 AC 151 ms
57,748 KB
testcase_02 AC 156 ms
57,840 KB
testcase_03 AC 154 ms
57,740 KB
testcase_04 AC 160 ms
57,440 KB
testcase_05 AC 155 ms
57,780 KB
testcase_06 AC 154 ms
57,768 KB
testcase_07 AC 153 ms
57,768 KB
testcase_08 AC 156 ms
57,792 KB
testcase_09 AC 154 ms
57,748 KB
testcase_10 AC 155 ms
57,804 KB
testcase_11 AC 154 ms
57,808 KB
testcase_12 AC 158 ms
57,740 KB
testcase_13 AC 150 ms
57,648 KB
testcase_14 AC 153 ms
57,288 KB
testcase_15 AC 153 ms
55,768 KB
testcase_16 AC 157 ms
57,236 KB
testcase_17 AC 152 ms
57,800 KB
testcase_18 AC 150 ms
57,740 KB
testcase_19 AC 147 ms
57,376 KB
testcase_20 AC 147 ms
57,656 KB
testcase_21 AC 151 ms
57,648 KB
testcase_22 AC 151 ms
57,656 KB
testcase_23 AC 153 ms
57,772 KB
testcase_24 AC 156 ms
57,772 KB
testcase_25 AC 149 ms
57,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	int N;
	int[][] curMap;
	int[][] A;

	void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		double R = sc.nextDouble();
		double T = sc.nextDouble();
		double curR = 0;
		double curT = 1;
		for (int i = 0; i < N; ++i) {
			double nextR, nextT;
			nextR = curR + R * curT * curT * 1 / (1 - R * curR);
			nextT = curT * T * 1 / (1 - R * curR);
			curR = nextR;
			curT = nextT;
		}
		System.out.println(curR);
	}

	public static void main(String[] args) {
		new Main().run();
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}
0