結果

問題 No.851 テストケース
コンテスト
ユーザー 沙耶花
提出日時 2019-07-26 21:30:21
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 3,153 ms
コード長 637 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,456 ms
コンパイル使用メモリ 189,156 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2026-03-23 11:02:06
合計ジャッジ時間 1,891 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:35:15: warning: ignoring return value of '_FIter std::unique(_FIter, _FIter) [with _FIter = __gnu_cxx::__normal_iterator<long long int*, vector<long long int> >]', declared with attribute 'nodiscard' [-Wunused-result]
   35 |         unique(num.begin(),num.end());
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/algorithm:63,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/x86_64-pc-linux-gnu/bits/stdc++.h:53,
                 from main.cpp:1:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_algo.h:875:5: note: declared here
  875 |     unique(_ForwardIterator __first, _ForwardIterator __last)
      |     ^~~~~~

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x)+modulo)%modulo)
#define Inf 1000000000

int main(){
	int N;
	cin>>N;
	
	string S;
	getline(cin,S);getline(cin,S);
	for(int i=0;i<S.size();i++){
		if(S[i]==' '){
			cout<<"\"assert\""<<endl;
			return 0;
		}
	}
	
	long long A[3];
	for(int i=0;i<2;i++){
		cin>>A[i];
	}
	
	
	A[2] = stoll(S);
	
	vector<long long> num(0);
	for(int i=0;i<3;i++){
		for(int j=i+1;j<3;j++){
			num.push_back(A[i]+A[j]);
		}
	}
	sort(num.begin(),num.end(),greater<long long>());
	unique(num.begin(),num.end());
	cout<<num[1]<<endl;
	
	return 0;
}


0