結果
問題 | No.553 AlphaCoder Rating |
ユーザー | Grenache |
提出日時 | 2017-08-12 00:15:51 |
言語 | Java19 (openjdk 21) |
結果 |
AC
|
実行時間 | 129 ms / 1,500 ms |
コード長 | 1,205 bytes |
コンパイル時間 | 3,234 ms |
コンパイル使用メモリ | 74,420 KB |
実行使用メモリ | 56,692 KB |
最終ジャッジ日時 | 2023-08-03 00:20:22 |
合計ジャッジ時間 | 6,044 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 120 ms
56,200 KB |
testcase_01 | AC | 118 ms
56,692 KB |
testcase_02 | AC | 118 ms
55,520 KB |
testcase_03 | AC | 118 ms
56,008 KB |
testcase_04 | AC | 118 ms
56,012 KB |
testcase_05 | AC | 123 ms
56,184 KB |
testcase_06 | AC | 122 ms
55,900 KB |
testcase_07 | AC | 118 ms
56,572 KB |
testcase_08 | AC | 129 ms
56,284 KB |
testcase_09 | AC | 120 ms
56,080 KB |
testcase_10 | AC | 126 ms
56,196 KB |
testcase_11 | AC | 120 ms
56,280 KB |
testcase_12 | AC | 124 ms
56,128 KB |
testcase_13 | AC | 124 ms
56,592 KB |
testcase_14 | AC | 118 ms
56,132 KB |
ソースコード
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); } } }