結果
| 問題 | No.571 3人兄弟(その2) | 
| コンテスト | |
| ユーザー |  hatsuka_iwa | 
| 提出日時 | 2021-01-31 22:45:17 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 784 bytes | 
| コンパイル時間 | 1,388 ms | 
| コンパイル使用メモリ | 172,784 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-29 13:28:21 | 
| 合計ジャッジ時間 | 1,990 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 12 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<tuple<int, int, char>> brothers(3);
  cin >> get<0>(brothers.at(0)) >> get<1>(brothers.at(0));
  cin >> get<0>(brothers.at(1)) >> get<1>(brothers.at(1));
  cin >> get<0>(brothers.at(2)) >> get<1>(brothers.at(2));
  get<2>(brothers.at(0)) = 'A';
  get<2>(brothers.at(1)) = 'B';
  get<2>(brothers.at(2)) = 'C';
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2 - i; j++) {
      if (get<0>(brothers.at(j)) < get<0>(brothers.at(j + 1)) ||
          (get<0>(brothers.at(j)) == get<0>(brothers.at(j + 1)) &&
          get<1>(brothers.at(j)) > get<1>(brothers.at(j + 1))))
          swap(brothers.at(j), brothers.at(j + 1));
    }
  }
  for (tuple<int, int, char> t : brothers)
    cout << get<2>(t) << endl;
}
            
            
            
        