結果

問題 No.553 AlphaCoder Rating
ユーザー mbanmban
提出日時 2017-08-27 12:57:58
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 1,500 ms
コード長 1,252 bytes
コンパイル時間 1,118 ms
コンパイル使用メモリ 105,728 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2024-04-24 00:11:13
合計ジャッジ時間 1,906 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
18,816 KB
testcase_01 AC 23 ms
18,816 KB
testcase_02 AC 22 ms
18,944 KB
testcase_03 AC 22 ms
18,816 KB
testcase_04 AC 23 ms
19,072 KB
testcase_05 AC 23 ms
18,816 KB
testcase_06 AC 23 ms
18,816 KB
testcase_07 AC 22 ms
18,944 KB
testcase_08 AC 23 ms
18,944 KB
testcase_09 AC 23 ms
18,944 KB
testcase_10 AC 23 ms
18,816 KB
testcase_11 AC 22 ms
18,816 KB
testcase_12 AC 23 ms
18,816 KB
testcase_13 AC 23 ms
18,816 KB
testcase_14 AC 22 ms
18,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        new Magatro().Solve();
    }
}

class Magatro
{
    private const double InfF=0.229415733870562;
    private int N;
    private int[]RPerf;
    private double F(int n)
    {
        double aa=1,bb=1;
        double bo=0,si=0;
        for(int i = 0;i<n;i++)
        {
            aa*=0.9;
            bb*=0.81;
            bo+=aa;
            si+=bb;
        }
        return Math.Sqrt(si)/bo;
    }
    private double f(int n)
    {
        return (F(n)-InfF)/(1-InfF)*1200;
    }
    private double g(int n)
    {
        return Math.Pow(2.0,(double)n/800);
    }
    private double minusg(double n)
    {
        return 800.0*Math.Log(n,2);
    }
            
            
    public void Solve()
    {    
        N=int.Parse(Console.ReadLine());
        RPerf=new int[N];
        for(int i=0;i<N;i++)
        {
            RPerf[i]=int.Parse(Console.ReadLine());
        }
        double aa=1;
        double bo=0;
        double si=0;
        for(int i=0;i<N;i++)
        {
            aa*=0.9;
            bo+=aa;
            si+=g(RPerf[i])*aa;
        }
        Console.WriteLine(Math.Round(minusg(si/bo)-f(N)));
        
    }
}
0