結果

問題 No.571 3人兄弟(その2)
ユーザー LavenderLavender
提出日時 2019-09-15 17:51:02
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 644 bytes
コンパイル時間 1,476 ms
コンパイル使用メモリ 167,200 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-21 04:10:17
合計ジャッジ時間 2,364 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main()
{
    pair<int, int> p[3];
    vector<int> ran{0, 1, 2};
    int max_h;

    for (int i = 0; i < 3; i++) {
        cin >> p[i].first;
        cin >> p[i].second;
    }
    
    if (p[ran[0]].first < p[ran[1]].first) swap(ran[0], ran[1]);
    if (p[ran[1]].first < p[ran[2]].first) swap(ran[1], ran[2]);
    if (p[ran[0]].first < p[ran[1]].first) swap(ran[0], ran[1]);

    for (int i = 0; i < 2; i++) if (p[ran[i]].first == p[ran[i+1]].first) if (p[ran[i]].second > p[ran[i+1]].second) swap(ran[i], ran[i+1]);
    for (int i = 0; i < 3; i++) printf("%c\n", 'A' + ran[i]);
    return 0;
}
0