結果

問題 No.1134 Deviation Score Ⅱ
ユーザー forest3forest3
提出日時 2020-07-31 13:34:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 541 bytes
コンパイル時間 1,651 ms
コンパイル使用メモリ 166,924 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-20 10:30:26
合計ジャッジ時間 3,861 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 14 ms
4,380 KB
testcase_04 AC 8 ms
4,380 KB
testcase_05 WA -
testcase_06 AC 6 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 4 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 11 ms
4,380 KB
testcase_12 AC 11 ms
4,380 KB
testcase_13 AC 17 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 5 ms
4,380 KB
testcase_17 AC 11 ms
4,380 KB
testcase_18 WA -
testcase_19 AC 15 ms
4,380 KB
testcase_20 WA -
testcase_21 AC 16 ms
4,376 KB
testcase_22 AC 12 ms
4,384 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 1 ms
4,380 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[i];
	}
	cin >> M;

	long double ave = 0;
	for( int i = 0; i < N; i++ ) {
		ave += x[i];
	}
	ave /= N;
	long double dxave = 0;
	for( int i = 0; i < N; i++ ) {
		int dx = x[i] - ave;
		dxave += dx * dx;
	}
	dxave /= N;
	long double sq = sqrt( dxave );
	int ans = 50;
	if( sq ) {
		int xm = x[M - 1];
		long double dx = xm - ave;
		int dx2 = dx * 10 / sq;
		ans += dx2;
	}

	cout << ans << endl;
}
0