結果
| 問題 | No.571 3人兄弟(その2) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-01-01 12:30:35 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 571 bytes | 
| コンパイル時間 | 2,009 ms | 
| コンパイル使用メモリ | 175,368 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-06 22:58:53 | 
| 合計ジャッジ時間 | 2,691 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 12 | 
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:17:41: warning: narrowing conversion of '(i + 65)' from 'int' to 'char' [-Wnarrowing]
   17 |                 a.push_back({{x, y},  i + 'A'});
      |                                       ~~^~~~~
            
            ソースコード
#include <bits/stdc++.h>
using namespace std;
bool comp (const pair<pair<int, int>, char> x, const pair<pair<int ,int>, char> y) {
	if(x.first.first != y.first.first) {
		return x.first.first < y.first.first;
	} else {
		return x.first.second > y.first.second;
	}
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0); 
	vector<pair<pair<int, int>, char>> a;
	for(int i = 0; i < 3; i++) {
		int x, y;
		cin >> x >> y;
		a.push_back({{x, y},  i + 'A'});
	}
	sort(a.rbegin(), a.rend(), comp);
	for(int i = 0; i < 3; i++) {
		cout << a[i].second << endl;
	}
	return 0;
}
            
            
            
        