結果

問題 No.1134 Deviation Score Ⅱ
ユーザー trineutrontrineutron
提出日時 2020-07-30 03:54:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 553 bytes
コンパイル時間 2,080 ms
コンパイル使用メモリ 200,716 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-14 03:51:49
合計ジャッジ時間 3,785 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, m;
    cin >> n;
    vector<int> x(n);
    for (int i = 0; i < n; i++) {
        cin >> x.at(i);
    }
    cin >> m;
    int64_t s = 0, s_square = 0;
    for (int i = 0; i < n; i++) {
        s += x.at(i);
        s_square += x.at(i) * x.at(i);
    }
    double avg = 1.0 * s / n, var = 1.0 * (n * s_square - s * s) / (n * n);
    if (n * s_square == s * s) {
        cout << 50 << endl;
        return 0;
    }
    cout << 50 + int(10 * (x.at(m - 1) - avg) / sqrt(var)) << endl;
}
0