結果
| 問題 |
No.851 テストケース
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-31 20:22:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 742 bytes |
| コンパイル時間 | 2,206 ms |
| コンパイル使用メモリ | 200,896 KB |
| 最終ジャッジ日時 | 2025-01-07 10:20:14 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 16 WA * 2 RE * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
auto get_ints = []() {
vector<int> res;
string buf;
getline(cin, buf);
stringstream ss(buf);
for (string s; ss >> s; ) {
res.push_back(stoi(s));
}
return res;
};
int N = get_ints()[0];
assert(N == 3);
vector<int> r1 = get_ints();
if (r1.size() == 3) {
cout << "\"assert\"" << endl;
} else {
r1.push_back(get_ints()[0]);
r1.push_back(get_ints()[0]);
vector<int> sums;
for (int i = 0; i < N; ++i) {
for (int j = i + 1; j < N; ++j) {
sums.push_back(r1[i] + r1[j]);
}
}
sort(sums.begin(), sums.end(), [](int x, int y) { return x > y; });
cout << sums[1] << endl;
}
return 0;
}