結果

問題 No.549 素材合成システム
ユーザー アロンアルファアロンアルファ
提出日時 2017-10-03 12:47:40
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 237 ms / 2,000 ms
コード長 564 bytes
コンパイル時間 611 ms
コンパイル使用メモリ 66,644 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-10 05:19:31
合計ジャッジ時間 8,419 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 221 ms
4,380 KB
testcase_08 AC 237 ms
4,384 KB
testcase_09 AC 224 ms
4,380 KB
testcase_10 AC 221 ms
4,380 KB
testcase_11 AC 224 ms
4,380 KB
testcase_12 AC 227 ms
4,380 KB
testcase_13 AC 225 ms
4,384 KB
testcase_14 AC 224 ms
4,380 KB
testcase_15 AC 224 ms
4,384 KB
testcase_16 AC 228 ms
4,380 KB
testcase_17 AC 216 ms
4,380 KB
testcase_18 AC 138 ms
4,380 KB
testcase_19 AC 209 ms
4,384 KB
testcase_20 AC 181 ms
4,380 KB
testcase_21 AC 186 ms
4,384 KB
testcase_22 AC 169 ms
4,384 KB
testcase_23 AC 218 ms
4,384 KB
testcase_24 AC 189 ms
4,380 KB
testcase_25 AC 150 ms
4,380 KB
testcase_26 AC 207 ms
4,380 KB
testcase_27 AC 163 ms
4,380 KB
testcase_28 AC 1 ms
4,384 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 2 ms
4,388 KB
testcase_31 AC 211 ms
4,384 KB
testcase_32 AC 205 ms
4,384 KB
testcase_33 AC 212 ms
4,380 KB
testcase_34 AC 212 ms
4,380 KB
testcase_35 AC 217 ms
4,380 KB
testcase_36 AC 208 ms
4,380 KB
testcase_37 AC 208 ms
4,380 KB
testcase_38 AC 1 ms
4,380 KB
testcase_39 AC 1 ms
4,384 KB
testcase_40 AC 89 ms
4,388 KB
testcase_41 AC 20 ms
4,380 KB
testcase_42 AC 2 ms
4,380 KB
testcase_43 AC 29 ms
4,380 KB
testcase_44 AC 5 ms
4,384 KB
testcase_45 AC 38 ms
4,384 KB
testcase_46 AC 14 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
	int N;
	std::vector<int> v;
	int n,w=0;

	std::cin >> N;

	while(N--){
		std::cin >> n;
		v.push_back(n);
	}

	std::sort(v.begin(),v.end());
	for(std::vector<int>::iterator i = v.begin();i != v.end()-2;){
		//for(int j = 0;j < v.size();j++) std::cout << v[j] << ' ';
		//std::cout << std::endl;
		*(i+v.size()-1) += *(i + v.size()/2)/2;
		if(v.size() > 2) v.erase(i+v.size()/2);
		else break;
	}
	//std::cout << v.size() << std::endl;
	std::cout << v[0]/2 + v[1] << std::endl;
	return 0;
}
0