結果

問題 No.851 テストケース
ユーザー hibari2357hibari2357
提出日時 2019-07-26 22:07:48
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 3,153 ms
コード長 1,009 bytes
コンパイル時間 1,219 ms
コンパイル使用メモリ 116,184 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-15 01:36:57
合計ジャッジ時間 2,195 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define fs first
#define sc second
#define INF 1000000000
#define MOD 1000000007
#define EPS 0.00000001


int main() {
    int N; cin >> N;
    cin.ignore();
    string S; getline(cin, S);
    
    if(find(S.begin(), S.end(), ' ')!=S.end()){
        cout << "\"assert\"" << endl;
        return 0;
    }

    vector<ll> A(3);
    A[0] = stoll(S);
    for(int i=1; i<3; i++){
        cin >> A[i];
    }
    
    set<ll> T;
    for(int i=0; i<3; i++){
        for(int j=i+1; j<3; j++){
            T.insert(A[i]+A[j]);
        }
    }
    
    vector<ll> V;
    for(auto t:T){
        V.push_back(t);
    }
    sort(V.begin(), V.end(), greater<ll>());
    
    cout << V[1] << endl;
    return 0;
}

0