結果
| 問題 |
No.851 テストケース
|
| コンテスト | |
| ユーザー |
seriru13
|
| 提出日時 | 2019-07-26 21:42:24 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 22 ms / 3,153 ms |
| コード長 | 1,602 bytes |
| コンパイル時間 | 1,322 ms |
| コンパイル使用メモリ | 114,636 KB |
| 最終ジャッジ日時 | 2025-01-07 07:46:07 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#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);
for (auto itr : s2) {
if (itr == ' ') {
cout << "\"assert\"" << endl;
return 0;
}
}
{
getline(cin, s3);
getline(cin, s4);
ll t1 = stoll(s2), t2 = stoll(s3), t3 = stoll(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;
}
}
}
}
seriru13