結果
問題 |
No.1134 Deviation Score Ⅱ
|
ユーザー |
![]() |
提出日時 | 2020-07-28 09:14:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 621 bytes |
コンパイル時間 | 563 ms |
コンパイル使用メモリ | 74,552 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-28 21:12:50 |
合計ジャッジ時間 | 1,636 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 21 WA * 6 |
ソースコード
#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) << floor(ans) << endl; return 0; }