結果

問題 No.570 3人兄弟(その1)
ユーザー __eggshell
提出日時 2017-12-21 17:10:56
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 884 ms
コンパイル使用メモリ 72,720 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-17 22:31:27
合計ジャッジ時間 1,350 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <string.h>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

bool pairCompare(const pair<string, int>& fir, const pair<string, int>& sec){
    return fir.second > sec.second;
}

int main(){
    vector<pair<string, int>> bro;
    int a,b,c;
    cin >> a >> b >> c;
    bro.push_back(make_pair("A", a));
    bro.push_back(make_pair("B", b));
    bro.push_back(make_pair("C", c));
    sort(bro.begin(), bro.end(), pairCompare);
    cout << bro[0].first << endl << bro[1].first << endl << bro[2].first;
}
0