結果
| 問題 |
No.851 テストケース
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-26 21:54:08 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 3,153 ms |
| コード長 | 633 bytes |
| コンパイル時間 | 5,152 ms |
| コンパイル使用メモリ | 205,072 KB |
| 最終ジャッジ日時 | 2025-01-07 07:51:53 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
ios::sync_with_stdio(false); cin.tie(0);
int n;
cin >> n;
long long a[3];
string s;
cin.ignore();
getline(cin, s);
for (char c : s) {
if (c == ' ') {
cout << '"' << "assert" << '"' << endl;
return 0;
}
}
//cerr << s << endl;
a[0] = stol(s);
cin >> a[1] >> a[2];
vector<long long> sums = {a[0] + a[1], a[1] + a[2], a[0] + a[2]};
sort(sums.begin(), sums.end());
sums.erase(unique(sums.begin(), sums.end()), sums.end());
sort(sums.rbegin(), sums.rend());
cout << sums[1] << endl;
return 0;
}