結果

問題 No.553 AlphaCoder Rating
ユーザー tkmst201tkmst201
提出日時 2017-08-11 22:57:48
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 37 ms / 1,500 ms
コード長 1,520 bytes
コンパイル時間 1,404 ms
コンパイル使用メモリ 159,852 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-20 23:14:44
合計ジャッジ時間 2,617 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
6,812 KB
testcase_01 AC 35 ms
6,940 KB
testcase_02 AC 36 ms
6,940 KB
testcase_03 AC 35 ms
6,940 KB
testcase_04 AC 34 ms
6,940 KB
testcase_05 AC 35 ms
6,944 KB
testcase_06 AC 36 ms
6,940 KB
testcase_07 AC 37 ms
6,944 KB
testcase_08 AC 35 ms
6,940 KB
testcase_09 AC 35 ms
6,940 KB
testcase_10 AC 35 ms
6,944 KB
testcase_11 AC 37 ms
6,944 KB
testcase_12 AC 35 ms
6,944 KB
testcase_13 AC 35 ms
6,940 KB
testcase_14 AC 35 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:58:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   58 |         REP(i, N) scanf("%d", rperf + i);
      |                   ~~~~~^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS  = 1e-10;
const bool debug = 0;
//---------------------------------//

int inf;
int N;
int rperf[100];

long double F(int n) {
	long double res = 0;
	
	long double p = 1;
	FOR(i, 1, n + 1) {
		p *= 0.81;
		res += p;
	}
	
	res = sqrt(res);
	
	long double d = 0.0;
	
	p = 1.0;
	FOR(i, 1, n + 1) {
		p *= 0.9;
		d += p;
	}
	
	return res / d;
}

long double f(int n) {
	return (F(n) - F(inf)) / (F(1) - F(inf)) * 1200;
}

long double g(long double x) {
	return pow(2.0, x / 800.0);
}

int main() {
	inf = 100000;
	
	cin >> N;
	REP(i, N) scanf("%d", rperf + i);
	
	long double num = 0.0, p = 1.0;
	FOR(i, 1, N + 1) {
		p *= 0.9;
		num += g(rperf[i - 1]) * p;
	}
	
	long double d = 0.0;
	
	p = 1.0;
	FOR(i, 1, N + 1) {
		p *= 0.9;
		d += p;
	}
	
	num /= d;
	
	long double l = 0.0, r = 10000;
	REP(i, 300) {
		long double m = (l + r) / 2;
		if (g(m) > num) r = m;
		else l = m;
	}
	
	double ans = r - f(N);
	
	printf("%d\n", (int)round(ans));
	
	return 0;
}
0