結果
| 問題 |
No.553 AlphaCoder Rating
|
| ユーザー |
tkmst201
|
| 提出日時 | 2017-08-11 22:57:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 1,500 ms |
| コード長 | 1,520 bytes |
| コンパイル時間 | 1,303 ms |
| コンパイル使用メモリ | 160,008 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-12 21:38:53 |
| 合計ジャッジ時間 | 2,667 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
コンパイルメッセージ
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);
| ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#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;
}
tkmst201