結果

問題 No.851 テストケース
ユーザー leaf_1415leaf_1415
提出日時 2019-07-26 21:26:54
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 635 bytes
コンパイル時間 908 ms
コンパイル使用メモリ 72,680 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-15 00:34:17
合計ジャッジ時間 1,861 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stdlib.h>

using namespace std;

int n;
vector<string> vec;
vector<int> vec2;

int main(void)
{
	string s;
	while(getline(cin, s)){
		vec.push_back(s);
	}
	if(vec.size() == 2){
		cout << "\"assert\"" << endl;
		return 0;
	}
	
	vec2.push_back(atoi(vec[1].c_str()) + atoi(vec[2].c_str()));
	vec2.push_back(atoi(vec[1].c_str()) + atoi(vec[2].c_str()));
	vec2.push_back(atoi(vec[2].c_str()) + atoi(vec[3].c_str()));
	sort(vec2.rbegin(), vec2.rend());
	vec2.erase(unique(vec2.begin(), vec2.end()), vec2.end());
	
	cout << vec2[1] << endl;
	
	return 0;
}
0