結果
| 問題 |
No.553 AlphaCoder Rating
|
| ユーザー |
|
| 提出日時 | 2017-08-12 00:15:51 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 140 ms / 1,500 ms |
| コード長 | 1,205 bytes |
| コンパイル時間 | 3,628 ms |
| コンパイル使用メモリ | 77,328 KB |
| 実行使用メモリ | 54,420 KB |
| 最終ジャッジ日時 | 2024-10-12 22:29:29 |
| 合計ジャッジ時間 | 6,489 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
import java.io.*;
import java.util.*;
public class Main_yukicoder553 {
private static Scanner sc;
private static Printer pr;
private static void solve() {
int n = sc.nextInt();
int[] r = new int[n];
for (int i = 0; i < n; i++) {
r[i] = sc.nextInt();
}
double gsum = 0;
for (int i = 1; i <= n; i++) {
gsum += g(r[i - 1]) * Math.pow(0.9, i);
}
gsum /= 9.0 * (1 - Math.pow(0.9, n));
// pr.println(gsum);
// pr.println((double)1 / g(gsum));
// pr.println(f(n));
// pr.println((double)1 / g(gsum) - f(n));
pr.println((int)(Math.log(gsum) / Math.log(2) * 800 - f(n)));
}
private static double f(int x) {
double ret = 0.1 * Math.sqrt(1 - Math.pow(0.81, x)) / (1 - Math.pow(0.9, x));
ret -= 0.1;
ret /= 0.1 * Math.sqrt(1 - 0.81) / (1 - 0.9) - 0.1;
ret *= 1200;
return ret;
}
private static double g(double x) {
return Math.pow(2, x / 800);
}
// ---------------------------------------------------
public static void main(String[] args) {
sc = new Scanner(System.in);
pr = new Printer(System.out);
solve();
pr.close();
sc.close();
}
private static class Printer extends PrintWriter {
Printer(PrintStream out) {
super(out);
}
}
}