結果
問題 | No.851 テストケース |
ユーザー |
|
提出日時 | 2024-03-28 10:36:04 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 3,153 ms |
コード長 | 596 bytes |
コンパイル時間 | 3,565 ms |
コンパイル使用メモリ | 255,440 KB |
最終ジャッジ日時 | 2025-02-20 14:12:09 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; using ld = long double; int main() { int N; cin >> N; string dummy; getline(cin, dummy); ll a[3]; int i = 0; string num; while (i < 3) { getline(cin, num); if (num.find(' ') != -1) { cout << "\"assert\"" << endl; return 0; } a[i] = stoll(num); i++; } set<ll> ans; for (int i = 0; i < 3; i++) { for (int j = i + 1; j < 3; j++) { ans.insert(a[i] + a[j]); } } cout << *prev(prev(ans.end())) << endl; return 0; }