結果

問題 No.1134 Deviation Score Ⅱ
ユーザー 29da16429da164
提出日時 2020-07-28 09:01:32
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 610 bytes
コンパイル時間 566 ms
コンパイル使用メモリ 74,868 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-28 21:12:39
合計ジャッジ時間 1,540 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 << st <<endl;
  //cout << ans <<endl;
  cout << fixed << setprecision(0) << ans << endl;
  
  return 0;    

}
0