結果
問題 |
No.1134 Deviation Score Ⅱ
|
ユーザー |
|
提出日時 | 2020-08-01 06:46:50 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 947 bytes |
コンパイル時間 | 947 ms |
コンパイル使用メモリ | 85,608 KB |
最終ジャッジ日時 | 2025-01-12 12:13:19 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 23 WA * 4 |
ソースコード
#include <iostream> #include <numeric> #include <cmath> #include <vector> using ldouble = long double; constexpr ldouble EPS = 1e-10; void solve() { int n; std::cin >> n; std::vector<ldouble> xs(n); for (auto& x : xs) std::cin >> x; ldouble ave = std::accumulate(xs.begin(), xs.end(), 0.L) / n; ldouble sv = std::sqrt(std::accumulate(xs.begin(), xs.end(), 0.L, [&](ldouble acc, ldouble x) { return acc + (x - ave) * (x - ave); }) / n); if (sv < EPS) { std::cout << 0 << "\n"; return; } int m; std::cin >> m; ldouble x = xs[--m]; ldouble ans = (x - ave) * 10 / sv + 50; std::cout << (int)ans << "\n"; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }