結果

問題 No.553 AlphaCoder Rating
ユーザー 37zigen37zigen
提出日時 2017-08-12 00:45:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 1,500 ms
コード長 1,035 bytes
コンパイル時間 2,205 ms
コンパイル使用メモリ 80,724 KB
実行使用メモリ 41,940 KB
最終ジャッジ日時 2024-04-21 00:18:26
合計ジャッジ時間 5,136 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
41,236 KB
testcase_01 AC 110 ms
39,984 KB
testcase_02 AC 126 ms
41,564 KB
testcase_03 AC 128 ms
41,200 KB
testcase_04 AC 122 ms
41,504 KB
testcase_05 AC 125 ms
41,496 KB
testcase_06 AC 129 ms
41,460 KB
testcase_07 AC 118 ms
41,184 KB
testcase_08 AC 133 ms
41,940 KB
testcase_09 AC 129 ms
41,808 KB
testcase_10 AC 131 ms
41,824 KB
testcase_11 AC 118 ms
40,944 KB
testcase_12 AC 131 ms
41,360 KB
testcase_13 AC 125 ms
41,460 KB
testcase_14 AC 119 ms
41,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


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

import javax.swing.JFrame;

public class Main {

	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] pf = new int[n];
		for (int i = 0; i < n; ++i) {
			pf[i] = sc.nextInt();
		}
		double[] F = new double[n + 1];
		double[] f = new double[n + 1];
		double F_inf = (Math.sqrt((0.81) / (1 - 0.81))) / ((0.9) / (1 - 0.9));
		for (int i = 1; i <= n; ++i) {
			double u = 0;
			double l = 0;
			for (int j = 1; j <= i; ++j) {
				u += Math.pow(0.81, j);
				l += Math.pow(0.9, j);
			}
			F[i] = Math.sqrt(u) / l;
			f[i] = (F[i] - F_inf) / (F[1] - F_inf) * 1200;
		}
		double u = 0, l = 0;
		for (int j = 1; j <= n; ++j) {
			u += Math.pow(2, 1d * pf[j - 1] / 800) * Math.pow(0.9, j);
			l += Math.pow(0.9, j);
		}
		System.out.println((int) (Math.log(u / l) / Math.log(2) * 800 - f[n]));
	}

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

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