結果

問題 No.851 テストケース
ユーザー kaichou243
提出日時 2022-10-09 15:05:29
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 3,153 ms
コード長 586 bytes
コンパイル時間 2,171 ms
コンパイル使用メモリ 206,304 KB
最終ジャッジ日時 2025-02-08 00:43:22
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
    string N;
    getline(cin,N);
    vector<ll> a;
    string ai;
    while(getline(cin,ai)){
        for(int i=0;i<ai.size();i++){
            if(ai[i]==' '){
                cout<<'"'<<"assert"<<'"'<<endl;
                return 0;
            }
        }
        a.push_back(stoll(ai));
    }
    vector<ll> v={a[0]+a[1],a[1]+a[2],a[0]+a[2]};
    sort(v.begin(),v.end());
    set<ll> st(v.begin(),v.end());
    vector<ll> v2(st.begin(),st.end());
    reverse(v2.begin(),v2.end());
    cout<<v2[1]<<endl;
}
0