結果
問題 | No.553 AlphaCoder Rating |
ユーザー |
![]() |
提出日時 | 2017-08-11 22:48:26 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 30 ms / 1,500 ms |
コード長 | 1,206 bytes |
コンパイル時間 | 3,513 ms |
コンパイル使用メモリ | 106,240 KB |
実行使用メモリ | 20,224 KB |
最終ジャッジ日時 | 2024-10-12 21:32:34 |
合計ジャッジ時間 | 2,148 ms |
ジャッジサーバーID (参考情報) |
judge5 / 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.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));}}