結果
問題 | No.851 テストケース |
ユーザー |
![]() |
提出日時 | 2019-08-23 18:33:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 3,153 ms |
コード長 | 837 bytes |
コンパイル時間 | 1,639 ms |
コンパイル使用メモリ | 177,784 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 14:33:36 |
合計ジャッジ時間 | 2,341 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
// ※※※ 解答不能. ※※※ // 以下のソースコード参照. // heno_code氏. // https://yukicoder.me/submissions/362244 #include <bits/stdc++.h> using namespace std; using LL = long long; void solve(){ int n; cin >> n; string s; getline(cin, s); getline(cin, s); for(int i = 0; i < s.length(); i++){ if(s[i] == ' '){ cout << "\"assert\"" << endl; return; } } LL c[3]; c[0] = stoll(s); cin >> c[1] >> c[2]; vector<LL> v; for(int i = 0; i < 3; i++) v.push_back(c[0] + c[1] + c[2] - c[i]); sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); sort(v.begin(), v.end(), greater<LL>()); cout << v[1] << endl; } signed main(){ ios::sync_with_stdio(false); cin.tie(0); solve(); return 0; }