結果

問題 No.851 テストケース
ユーザー MayimgMayimg
提出日時 2019-07-26 21:54:08
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 3,153 ms
コード長 633 bytes
コンパイル時間 2,206 ms
コンパイル使用メモリ 209,344 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-15 01:13:13
合計ジャッジ時間 3,157 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0