結果

問題 No.851 テストケース
ユーザー r1933r1933
提出日時 2019-07-26 22:18:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,122 bytes
コンパイル時間 1,726 ms
コンパイル使用メモリ 171,700 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-15 01:58:26
合計ジャッジ時間 2,863 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define reps(i, m, n) for (int i = m; i <= n; ++i)

using i64 = long long;
using pii = pair<i64, i64>;

template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0;}

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = int(1e9) + 7;

signed main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  cin.ignore();
  string s;
  getline(cin, s);
  for (auto e : s) {
    if (e == ' ') {
      cout << '"' <<  "assert" << '"' << "\n";
      return 0;
    }
  }

  i64 a[4];
  a[0] = stoi(s);

  s.clear();

  vector<i64> vec;
  cin >> a[1] >> a[2];
  i64 case1 = a[0] + a[1];
  i64 case2 = a[1] + a[2];
  i64 case3 = a[0] + a[2];

  vec.push_back(case1);
  vec.push_back(case2);
  vec.push_back(case3);

  sort(all(vec), greater<i64>());

  cout << (vec[0] == vec[1] ? vec[2] : vec[1]) << "\n";

  return 0;
}
0