結果

問題 No.571 3人兄弟(その2)
ユーザー mmn15277198mmn15277198
提出日時 2020-07-15 22:10:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 875 bytes
コンパイル時間 930 ms
コンパイル使用メモリ 94,764 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-14 16:06:14
合計ジャッジ時間 1,801 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#pragma GCC optimize("Ofast")
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>

const long long INF_L = 1e17+7;
const long long INF_I = 1e9+7;
const long long MOD = 1e9+7;
const double EPS = 1e-8;
const double PI=acos(-1);

using namespace std;

struct A{
	int h;
	int w;
	char n;
};

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	struct A a[3];
	for(int i=0;i<3;i++){
		cin >> a[i].h >> a[i].w;
		a[i].n=(char)('A'+i);
	}
	
	for(int i=0;i<2;i++){
		for(int j=i+1;j<3;j++){
			struct A temp;
			if(a[i].h < a[j].h){
				temp=a[i];
				a[i]=a[j];
				a[j]=temp;
			}else if(a[i].h == a[j].h){
				if(a[i].w > a[j].w){
					temp=a[j];
					a[j]=a[i];
					a[i]=temp;
				}
			}
		}
	}
	
	for(int i=0;i<3;i++){
		cout << a[i].n << endl;
	}
			
	return 0;
}
0