結果

問題 No.571 3人兄弟(その2)
ユーザー 西尾
提出日時 2018-03-16 17:04:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,164 bytes
コンパイル時間 1,495 ms
コンパイル使用メモリ 168,864 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-21 14:30:24
合計ジャッジ時間 2,108 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int Comp( const int H0, const int W0,
		const int H1, const int W1 )
{
	if( H0 < H1 )
		return  - 1;
	else if( H0 > H1 )
		return 1;

	if( W0 < W1 )
		return  1;
	else if( W0 > W1 )
		return - 1;

	return 0;
}

int main()
{
int HA;
int HB;
int HC;
int WA;
int WB;
int WC;

	cin >> HA;
	cin >> WA;
	cin >> HB;
	cin >> WB;
	cin >> HC;
	cin >> WC;

	if( Comp( HA, WA, HB, WB ) > 0 )
	{
		if( Comp( HC, WC, HB, WB ) < 0 )
		{
			cout << "A" << endl;
			cout << "B" << endl;
			cout << "C" << endl;
			
			return 0;
		}
		
		if( Comp( HA, WA, HC, WC ) > 0 )
		{
			cout << "A" << endl;
			cout << "C" << endl;
			cout << "B" << endl;
			
			return 0;
		}
		else
		{
			cout << "C" << endl;
			cout << "A" << endl;
			cout << "B" << endl;
			
			return 0;
		}
	}

	if( Comp( HC, WC, HB, WB ) > 0 )
	{
		cout << "C" << endl;
		cout << "B" << endl;
		cout << "A" << endl;
		
		return 0;
	}
	
	if( Comp( HA, WA, HC, WC ) > 0 )
	{
		cout << "B" << endl;
		cout << "A" << endl;
		cout << "C" << endl;
		
		return 0;
	}
	else
	{
		cout << "B" << endl;
		cout << "C" << endl;
		cout << "A" << endl;
		
		return 0;
	}

	return 0;
}
0