結果
問題 |
No.1134 Deviation Score Ⅱ
|
ユーザー |
![]() |
提出日時 | 2020-07-28 09:10:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 614 bytes |
コンパイル時間 | 520 ms |
コンパイル使用メモリ | 74,500 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-28 21:12:43 |
合計ジャッジ時間 | 1,483 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 15 WA * 12 |
ソースコード
#include <iostream> #include <cmath> #include <iomanip> int main(void){ using namespace std; int n=0, m=0,x[100000]; double ave=0.0,var=0.0,st=0.0,ans=0.0; cin >> n; for(int i=0;i<n;i++){ cin >> x[i]; ave += (double)x[i]; } cin >> m; ave = ave/(double)n; for(int i=0;i<n;i++) var += ((double)x[i]-ave)*((double)x[i]-ave); st=sqrt(var/n); if(x[m-1] >= ave) ans = 50 + (x[m-1]-ave)*10.0/st; else ans = 50 + (x[m-1]-ave)*10.0/st; //cout << ave << endl; //cout << x[m-1] <<endl; //cout << ans <<endl; cout << fixed << setprecision(0) << ans << endl; return 0; }