結果
問題 |
No.1134 Deviation Score Ⅱ
|
ユーザー |
![]() |
提出日時 | 2023-08-27 02:11:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 24 ms / 2,000 ms |
コード長 | 685 bytes |
コンパイル時間 | 907 ms |
コンパイル使用メモリ | 103,736 KB |
最終ジャッジ日時 | 2025-02-16 14:57:48 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 27 |
ソースコード
#include<iostream> #include<map> #include<vector> #include <algorithm> #include<math.h> #include <iomanip> #include<set> #include <numeric> using namespace std; int main() { long long n, m, total = 0, sqn2 = 0; cin >> n; vector<int> v(n); for (int i = 0; i < n; i++){ cin >> v[i]; total += v[i]; } cin >> m; for (int i = 0; i <n; i++) sqn2 += (total - v[i]*n)*(total - v[i]*n); sqn2 = pow(sqn2, 0.5); cout << fixed << setprecision(0); long double ans = ((v[m-1]*n - total)*10*pow(n, 0.5)/sqn2 + 50); if (sqn2 == 0) cout << 50 << endl; else if (ans > 0) cout << floor(ans) << endl; else cout << ceil(ans) << endl; }