結果

問題 No.553 AlphaCoder Rating
ユーザー CleyLCleyL
提出日時 2020-03-20 03:05:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 1,500 ms
コード長 772 bytes
コンパイル時間 825 ms
コンパイル使用メモリ 72,924 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-20 21:22:54
合計ジャッジ時間 1,935 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 3 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 3 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:47:17: 警告: ‘r’ may be used uninitialized [-Wmaybe-uninitialized]
   47 |         cout << r << endl;
      |                 ^
main.cpp:42:13: 備考: ‘r’ はここで定義されています
   42 |         int r;
      |             ^

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
vector<int> RP;
double g(double X){
	return pow(2.0,X/800);
}
double ga(double X){
	return 800*(log2(X));
}
double F(int n){
	double P = 0;
	double C = 0;
	for(int i = 1; n >= i; i++){
		P+=pow(0.81,i);
		C+=pow(0.9,i);
	}
	return sqrt(P)/C;
}
double f(int n){
	return 1200*((F(n)-0.229417)/(F(1)-0.229417));
}
double Rating(int n){
	double R = 0;
	double P = 0;
	double C = 0;
	for(int i = 1; n >= i; i++){
		P+=g(RP[i-1])*pow(0.9,i);
		C+=pow(0.9,i);
	}
	R+=ga(P/C);
	R-=f(n);
	return R;
}

int main(){
	// for(int i = 1; 10 > i; i++){
	// 	cout << f(i) << endl;
	// }
	int n;cin>>n;
	int r;
	for(int i = 0; n > i; i++){
		int t;cin>>t;RP.push_back(t);
		r=Rating(i+1);
	}
	cout << r << endl;
}
0