結果
問題 | No.553 AlphaCoder Rating |
ユーザー | kuuso1 |
提出日時 | 2017-08-11 22:48:33 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 69 ms / 1,500 ms |
コード長 | 1,691 bytes |
コンパイル時間 | 2,283 ms |
コンパイル使用メモリ | 105,628 KB |
実行使用メモリ | 23,372 KB |
最終ジャッジ日時 | 2023-08-02 23:14:44 |
合計ジャッジ時間 | 4,089 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 65 ms
23,244 KB |
testcase_01 | AC | 64 ms
23,248 KB |
testcase_02 | AC | 67 ms
23,372 KB |
testcase_03 | AC | 64 ms
21,252 KB |
testcase_04 | AC | 64 ms
21,312 KB |
testcase_05 | AC | 64 ms
21,168 KB |
testcase_06 | AC | 63 ms
21,328 KB |
testcase_07 | AC | 69 ms
23,320 KB |
testcase_08 | AC | 66 ms
21,252 KB |
testcase_09 | AC | 64 ms
21,216 KB |
testcase_10 | AC | 64 ms
23,300 KB |
testcase_11 | AC | 63 ms
23,312 KB |
testcase_12 | AC | 65 ms
21,280 KB |
testcase_13 | AC | 67 ms
23,136 KB |
testcase_14 | AC | 68 ms
21,268 KB |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ Func<int, double> F = n =>{ double a = 0; for(int i=1;i<=n;i++) a += Math.Pow(0.81,i); a = Math.Sqrt(a); double b = 0; for(int i=1;i<=n;i++) b += Math.Pow(0.9,i); return a / b; }; var FInf = F(100000); Func<int, double> f = n => { double a = F(n) - FInf; double b = F(1) - FInf; return a / b * 1200; }; Func<double, double> g = x =>{ return Math.Pow(2,x/800.0); }; Func<double, double> ginv = y =>{ return Math.Log(y) / Math.Log(2) * 800; }; double aa = 0; for(int i=1;i<=N;i++) aa += g(Pf[i-1]) * Math.Pow(0.9, i); double bb = 0; for(int i=1;i<=N;i++) bb += Math.Pow(0.9,i); var ans = ginv(aa / bb) - f(N); Console.WriteLine((int)Math.Round(ans)); } int N; int[] Pf; public Sol(){ N = ri(); Pf = new int[N]; for(int i=0;i<N;i++) Pf[i] = ri(); } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);} static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }