結果

問題 No.571 3人兄弟(その2)
ユーザー Grun1396Grun1396
提出日時 2017-10-13 18:34:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 703 bytes
コンパイル時間 726 ms
コンパイル使用メモリ 80,472 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-11 00:23:24
合計ジャッジ時間 1,680 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <vector>
#include <string>
#include <utility>
#include <tuple>
#include <iostream>
#include <algorithm>

using namespace std;
using ll = long long;
using pll = pair<ll,ll>;
using tiii = tuple<int,int,int>;
#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)

int main(){
    vector<tiii> v(3);
    rep(i,3){
        int x,y;
        cin >> x >> y;
        v[i] = make_tuple(i,x,y);
    }
    string str = "ABC";
    sort(v.begin(),v.end(),[](const tiii& a, const tiii& b){
        return get<1>(a) == get<1>(b) ?
             get<2>(a) < get<2>(b): get<1>(a) > get<1>(b);
    });

    rep(i,3){
        cout << str[get<0>(v[i])] << endl;
    }

    return 0;
}
0