結果

問題 No.851 テストケース
ユーザー ohreitetsuohreitetsu
提出日時 2019-07-27 13:58:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 925 bytes
コンパイル時間 713 ms
コンパイル使用メモリ 81,096 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-15 06:14:13
合計ジャッジ時間 1,760 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string.h>
#include <vector>
#include <map>
using namespace std;
typedef long long LL;
int Gets(char *buff,int buffMaxSize)
{
	buff[0]='\0';
	if (fgets(buff,buffMaxSize,stdin)==NULL){
		return -1;
	}
	size_t strLen = strlen(buff);
	if (strLen>0){
		while (buff[strLen-1] == '\r' || buff[strLen-1]=='\n'){//改行コード
			strLen--;
			buff[strLen]='\0';
		}
	}
	return (int)strLen;
}
int main(int argc, char* argv[])
{
	int N,i;
	char buff[100];
	Gets(buff,100);
	N=atoi(buff);
	vector<LL> A(N);
	for (i=0;i<N;i++){
		int len=Gets(buff,100);
		if (len<=0){
			cout<<"assert"<<endl;
			return 0;
		}
		sscanf(buff,"%lld",&A[i]);
	}
	map<LL,int> B;
	int j=0;
	for (i=0;i<N-1;i++){
		for (j=i+1;j<N;j++){
			B[A[i]+A[j]]=1;
		}
	}
	map<LL,int>::iterator mit;
	mit=B.begin();
	switch(B.size()){
		case 1:
		case 2:
			break;
		case 3:
			mit++;
			break;
	}
	cout<<(*mit).first<<endl;
	return 0;
}
0