結果
| 問題 |
No.1134 Deviation Score Ⅱ
|
| ユーザー |
|
| 提出日時 | 2020-08-02 06:45:04 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 2,000 ms |
| コード長 | 1,239 bytes |
| コンパイル時間 | 1,286 ms |
| コンパイル使用メモリ | 115,588 KB |
| 最終ジャッジ日時 | 2025-01-12 13:08:54 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 27 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
#include <deque>
#include <stack>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
return (ull)rng() % B;
}
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int n; cin >> n;
vector<int> a(n),b(n);
for(int i=0;i<n;i++){
cin >> a[i];
}
b=a;
sort(b.begin(), b.end());
if(b[0]==b[n-1]){
printf("50\n");
return 0;
}
else{
double s=0,t=0;
for(int i=0;i<n;i++){
s+=a[i];
}
s/=n;
for(int i=0;i<n;i++){
t+=(s-a[i])*(s-a[i]);
}
t=sqrt(t/n);
int m; cin >> m;
m--;
double res=50+10*(a[m]-s)/t;
if(res<0){
printf("%d\n",(int)(res-1e-10));
}
else{
printf("%d\n",(int)(res+1e-10));
}
}
}