結果

問題 No.553 AlphaCoder Rating
コンテスト
ユーザー bal4u
提出日時 2019-08-14 20:34:55
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 1,500 ms
コード長 806 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 160 ms
コンパイル使用メモリ 42,436 KB
最終ジャッジ日時 2026-02-22 04:14:56
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

// yukicoder: No.553 AlphaCoder Rating
// bal4u 2019.8.14

#include <stdio.h>
#include <math.h>

//// 入出力関係
#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif

int in() { // 非負整数の入力
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

double f(int n) {
	return 1200.*(sqrt(1-pow(0.81, n)) / (1-pow(0.9, n))-1) /
			3.3588989435406735522369819838596;     // (sqrt(19)-1)
}

int N;
int RPerf[102];

int main()
{
	int i; double x, y;
	
	N = in();
	for (i = 1; i <= N; i++) RPerf[i] = in();
	
	y = 0;
	for (i = 1; i <= N; i++) {
		y += pow(2, RPerf[i]/800.0) * pow(0.9, i);
	}
	y /= 9.0*(1 - pow(0.9, N));
	x = 800*log10(y)/0.30102999566398119521373889472449;  // log10(2)
	
	printf("%d\n", (int)(x-f(N) + 0.5));
	return 0;
}
0