結果

問題 No.570 3人兄弟(その1)
ユーザー arar
提出日時 2017-10-07 14:50:05
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,053 bytes
コンパイル時間 905 ms
コンパイル使用メモリ 67,468 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-10 19:28:48
合計ジャッジ時間 1,107 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>

class Tribro{

public:
	int length;
	std::string name;
	char rank = 1;
};



int main() {

	Tribro *a = new Tribro;
	Tribro *b = new Tribro;
	Tribro *c = new Tribro;

	a->name = "A";
	b->name = "B";
	c->name = "C";

	std::cin >> a->length >> b->length >> c->length;

	if (a->length > b->length)	{
		b->rank++;
	}
	else {
		a->rank++;
	}
	if (b->length > c->length){
		c->rank++;
	}
	else {
		b->rank++;
	}
	if (c->length > a->length){
		a->rank++;
	}
	else {
		c->rank++;
	}

	if (a->rank==1) {
		std::cout << a->name << std::endl;
	}
	if (b->rank==1) {
		std::cout << b->name<< std::endl;
	}
	if (c->rank == 1) {
		std::cout << c->name << std::endl;
	}
	if (a->rank == 2) {
		std::cout << a->name << std::endl;
	}
	if (b->rank== 2) {
		std::cout << b->name<< std::endl;
	}
	if (c->rank== 2) {
		std::cout << c->name<< std::endl;
	}
	if (a->rank== 3) {
		std::cout << a->name << std::endl;
	}
	if (b->rank== 3) {
		std::cout << b->name << std::endl;
	}
	if (c->rank== 3) {
		std::cout << c->name << std::endl;
	}
}
0