結果
問題 |
No.571 3人兄弟(その2)
|
ユーザー |
![]() |
提出日時 | 2017-12-15 23:00:44 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,282 bytes |
コンパイル時間 | 1,056 ms |
コンパイル使用メモリ | 92,772 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-14 16:02:43 |
合計ジャッジ時間 | 1,716 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 WA * 7 |
ソースコード
#include <iostream> #include <stdio.h> #include <algorithm> #include <vector> #include <cmath> #include <string> #include <sstream> #include<sstream> #include <queue> #include <limits> #include <cstdlib> #include <deque> #include <map> #include <set> #include <iomanip> using namespace std; int main() { vector<pair<int, int> > height_weight; pair<int, int> a; pair<int, int> b; pair<int, int> c; int first = 0; int second = 0; int mozi[301]; cin >> first >> second; a = make_pair(first, second); mozi[a.first+a.second] = 0; cin >> first >> second; b = make_pair(first, second); mozi[b.first+b.second] = 1; cin >> first >> second; c = make_pair(first, second); mozi[c.first+c.second] = 2; height_weight.push_back(a); height_weight.push_back(b); height_weight.push_back(c); sort(height_weight.begin(), height_weight.end(), greater<pair<int, int> >()); if (height_weight[0].first == height_weight[1].first) { if (height_weight[0].second > height_weight[1].second) { if (mozi[height_weight[1].first+height_weight[1].second] == 0) { cout << "A" << endl; } else if (mozi[height_weight[1].first+height_weight[1].second] == 1) { cout << "B" << endl; } else { cout << "C" << endl; } } else { if (mozi[height_weight[0].first+height_weight[0].second] == 0) { cout << "A" << endl; } else if (mozi[height_weight[0].first+height_weight[0].second] == 1) { cout << "B" << endl; } else { cout << "C" << endl; } } } else { if (mozi[height_weight[0].first+height_weight[0].second] == 0) { cout << "A" << endl; } else if (mozi[height_weight[0].first+height_weight[0].second] == 1) { cout << "B" << endl; } else { cout << "C" << endl; } } if (height_weight[1].first == height_weight[2].first) { if (height_weight[1].second > height_weight[2].second) { if (mozi[height_weight[2].first+height_weight[2].second] == 0) { cout << "A" << endl; } else if (mozi[height_weight[2].first+height_weight[2].second] == 1) { cout << "B" << endl; } else { cout << "C" << endl; } if (mozi[height_weight[1].first+height_weight[1].second] == 0) { cout << "A" << endl; } else if (mozi[height_weight[1].first+height_weight[1].second] == 1) { cout << "B" << endl; } else { cout << "C" << endl; } } else { if (mozi[height_weight[1].first+height_weight[1].second] == 0) { cout << "A" << endl; } else if (mozi[height_weight[1].first+height_weight[1].second] == 1) { cout << "B" << endl; } else { cout << "C" << endl; } if (mozi[height_weight[2].first+height_weight[2].second] == 0) { cout << "A" << endl; } else if (mozi[height_weight[2].first+height_weight[2].second] == 1) { cout << "B" << endl; } else { cout << "C" << endl; } } } else { if (mozi[height_weight[1].first+height_weight[1].second] == 0) { cout << "A" << endl; } else if (mozi[height_weight[1].first+height_weight[1].second] == 1) { cout << "B" << endl; } else { cout << "C" << endl; } if (mozi[height_weight[2].first+height_weight[2].second] == 0) { cout << "A" << endl; } else if (mozi[height_weight[2].first+height_weight[2].second] == 1) { cout << "B" << endl; } else { cout << "C" << endl; } } return 0; }