結果

問題 No.1134 Deviation Score Ⅱ
ユーザー 👑 CleyL
提出日時 2023-03-22 08:53:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 561 bytes
コンパイル時間 1,047 ms
コンパイル使用メモリ 85,496 KB
最終ジャッジ日時 2025-02-11 16:09:56
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

int main(){
    int n;cin>>n;
    vector<int> A(n);
    int sm = 0;
    for(int i = 0; n > i; i++){
        cin>>A[i];
        sm += A[i];
    }
    int m;cin>>m;m--;
    vector<double> B(n);
    double sm2 = 0;
    for(int i = 0; n > i; i++){
        B[i] =(A[i]-(sm/(double)n))*(A[i]-(sm/(double)n)); 
        sm2 += B[i];
    }
    double c = sqrt(sm2/n);
    if(c == 0){
        cout << 50 << endl;
    }else{
        cout << (int)(50+(A[m]-(sm/(double)n))*10/c) << endl;
    }
}
0