結果

問題 No.851 テストケース
ユーザー seriru13seriru13
提出日時 2019-07-26 21:35:57
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,547 bytes
コンパイル時間 1,275 ms
コンパイル使用メモリ 117,804 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-15 00:44:42
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <map>
#include <unordered_map>
#include <set>
using namespace std;

typedef long long ll;

#define INF 10e17
#define rep(i,n) for(long long i=0; i<n; i++)
#define repr(i,n,m) for(long long i=m; i<n; i++)
#define END cout << endl
#define MOD 1000000007
#define pb push_back
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<long long>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto&& itr : x) { debug(itr); }

template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}

int main() {
  string s1, s2, s3, s4;
  getline(cin, s1);
  getline(cin, s2);
  if (s2.size() > 1) {
    cout << "assert" << endl;
  } else {
    getline(cin, s3);
    getline(cin, s4);
    ll t1 = stol(s2), t2 = stol(s3), t3 = stol(s4);
    // cout << t1 << " " << t2 << " " << t3 << endl;
    ll p1 = t1 + t2, p2 = t2 + t3, p3 = t1 + t3;
    map<ll, bool> mp;
    mp[p1] = true;
    mp[p2] = true;
    mp[p3] = true;
    int cnt = 0;
    for (auto itr : mp) {
      cnt += 1;
      if (mp.size() == 2 and cnt == 1) {
        cout << itr.first << endl;
        return 0;
      } else if (mp.size() == 3 and cnt == 2) {
        cout << itr.first << endl;
        return 0;
      }
    }
  }
}
0