結果
問題 | No.851 テストケース |
ユーザー |
|
提出日時 | 2019-09-11 21:36:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 3,153 ms |
コード長 | 725 bytes |
コンパイル時間 | 1,673 ms |
コンパイル使用メモリ | 174,352 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 16:52:51 |
合計ジャッジ時間 | 2,580 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
/** @file 851.cpp @title No.851 テストケース - yukicoder @url https://yukicoder.me/problems/no/851 **/ #include <bits/stdc++.h> using namespace std; typedef long long LL; #define ALL(obj) (obj).begin(), (obj).end() #define REP(i, N) for (int i = 0; i < (N); ++i) int main() { int N; cin >> N; cin.ignore(); vector<LL> v; string S; for (int i = 0; i < N; ++i) { getline(cin, S); if (S.find(' ') != string::npos) { cout << "\"assert\"" << endl; return 0; } v.emplace_back(stoll(S)); } vector<LL> u{v[0] + v[1], v[0] + v[2], v[1] + v[2]}; sort(u.begin(), u.end(), greater<>()); u.erase(unique(u.begin(), u.end()), u.end()); cout << u[1] << "\n"; return 0; }