結果

問題 No.571 3人兄弟(その2)
ユーザー byamibyami
提出日時 2017-11-18 13:11:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 1,580 ms
コンパイル使用メモリ 169,812 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-16 21:09:53
合計ジャッジ時間 2,545 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:10:25: 警告: narrowing conversion of ‘(65 + i)’ from ‘int’ to ‘char’ [-Wnarrowing]
   10 |         A[i]={{-a,b},'A'+i};
      |                      ~~~^~

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,a,n) for (int i = a;i < n;i++)
using namespace std;

pair<pair<int,int>,char> A[3];
int main(){
    rep(i,0,3) {
        int a,b;
        cin>>a>>b;
        A[i]={{-a,b},'A'+i};
    }
    sort(A,A+3);
    rep(i,0,3){
        cout << A[i].second << endl;
    }
}
0