結果

問題 No.553 AlphaCoder Rating
ユーザー bal4ubal4u
提出日時 2019-08-14 20:34:55
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 1,500 ms
コード長 806 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 31,652 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 18:13:50
合計ジャッジ時間 1,696 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'in':
main.c:9:14: warning: implicit declaration of function 'getchar_unlocked' [-Wimplicit-function-declaration]
    9 | #define gc() getchar_unlocked()
      |              ^~~~~~~~~~~~~~~~
main.c:15:24: note: in expansion of macro 'gc'
   15 |         int n = 0, c = gc();
      |                        ^~

ソースコード

diff #

// 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