結果

問題 No.571 3人兄弟(その2)
ユーザー 西尾西尾
提出日時 2018-03-16 17:04:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,164 bytes
コンパイル時間 1,599 ms
コンパイル使用メモリ 164,380 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-23 11:50:39
合計ジャッジ時間 2,127 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 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,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 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,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,500 KB
権限があれば一括ダウンロードができます

ソースコード

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