結果

問題 No.1134 Deviation Score Ⅱ
ユーザー chacoder1chacoder1
提出日時 2021-01-26 23:14:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 758 bytes
コンパイル時間 1,942 ms
コンパイル使用メモリ 200,420 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 02:20:53
合計ジャッジ時間 4,303 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 WA -
testcase_02 AC 11 ms
4,380 KB
testcase_03 AC 14 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 16 ms
4,380 KB
testcase_06 AC 5 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 11 ms
4,380 KB
testcase_12 AC 10 ms
4,376 KB
testcase_13 AC 17 ms
4,376 KB
testcase_14 AC 11 ms
4,376 KB
testcase_15 WA -
testcase_16 AC 4 ms
4,376 KB
testcase_17 AC 10 ms
4,376 KB
testcase_18 AC 11 ms
4,380 KB
testcase_19 AC 15 ms
4,376 KB
testcase_20 WA -
testcase_21 AC 15 ms
4,376 KB
testcase_22 AC 11 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 WA -
testcase_26 AC 20 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<n;i++)

void solve() {
  int n;
  cin>>n;
  int x[n];
  int sum=0;
  rep(i,n){
    cin>>x[i];
    sum+=x[i];
  }
  double ave=(double)sum/(double)n;
  //cout<<ave<<endl;
  double sqsum=0;
  rep(i,n){
    sqsum+=(x[i]-ave)*(x[i]-ave);
  }
  double rsqsum= sqrt((double)sqsum/(double)n);
  //cout<<rsqsum<<endl;
  //cout<<sqsum<<endl;
  
    
  int m;
  cin>>m;
  m--;
  if(x[m]==ave){
    cout<<50<<endl;
    return;
  }

  if(x[m]>ave){
    cout<<fixed<<setprecision(0)<<50+abs(x[m]-ave)*10/rsqsum<<endl;
    return;
  }
  if(x[m]<ave){
    cout<<fixed<<setprecision(0)<<50-abs(x[m]-ave)*10/rsqsum<<endl;
    return;
  }  
  
  
}

signed main(){
  solve();
}
0