結果

問題 No.553 AlphaCoder Rating
ユーザー RisenRisen
提出日時 2017-08-11 22:48:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 32 ms / 1,500 ms
コード長 1,206 bytes
コンパイル時間 2,420 ms
コンパイル使用メモリ 107,520 KB
実行使用メモリ 28,160 KB
最終ジャッジ日時 2024-04-20 23:08:16
合計ジャッジ時間 3,574 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
26,396 KB
testcase_01 AC 29 ms
26,116 KB
testcase_02 AC 29 ms
26,244 KB
testcase_03 AC 31 ms
26,244 KB
testcase_04 AC 32 ms
26,260 KB
testcase_05 AC 30 ms
23,952 KB
testcase_06 AC 31 ms
26,416 KB
testcase_07 AC 30 ms
26,500 KB
testcase_08 AC 30 ms
26,140 KB
testcase_09 AC 31 ms
25,976 KB
testcase_10 AC 31 ms
26,400 KB
testcase_11 AC 29 ms
26,372 KB
testcase_12 AC 29 ms
26,108 KB
testcase_13 AC 29 ms
26,244 KB
testcase_14 AC 29 ms
28,160 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;
using System.Linq;

class Solution
{
    static double F(int n)
    {
        var m = Math.Sqrt(Enumerable.Range(1, n).Select(i => Math.Pow(0.81, i)).Sum());
        var d = Enumerable.Range(1, n).Select(i => Math.Pow(0.9, i)).Sum();
        return m / d;
    }

    static double F2(int n)
    {
        var max = 0.22941573;
        var m = F(n) - max;
        var d = F(1) - max;
        return m * 1200 / d;
    }

    static double G(double x)
    {
        return Math.Pow(2, x / 800);
    }

    static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var rperf = new int[n];
        for (int i = 0; i < n; i++)
        {
            rperf[i] = int.Parse(Console.ReadLine());
        }

        var m = Enumerable.Range(1, n).Select(i => G(rperf[i - 1]) * Math.Pow(0.9, i)).Sum();
        var d = Enumerable.Range(1, n).Select(i => Math.Pow(0.9, i)).Sum();
        var t = m / d;

        int x = 0;
        while (true)
        {
            if (t <= G(x))
            {
                break;
            }
            x++;
        }

        double result = x - F2(n);

        Console.WriteLine(Math.Round(result));
    }
}
0