結果
問題 | No.553 AlphaCoder Rating |
ユーザー | kuuso1 |
提出日時 | 2017-08-11 22:48:33 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 29 ms / 1,500 ms |
コード長 | 1,691 bytes |
コンパイル時間 | 2,342 ms |
コンパイル使用メモリ | 113,784 KB |
実行使用メモリ | 18,176 KB |
最終ジャッジ日時 | 2024-10-12 21:32:59 |
合計ジャッジ時間 | 2,248 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
コンパイルメッセージ
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));} }