結果

問題 No.571 3人兄弟(その2)
ユーザー arar
提出日時 2017-10-07 15:09:07
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,405 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 69,672 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-10 19:29:20
合計ジャッジ時間 1,319 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>

class Tribro{

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



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 >>a->weight>> b->length >> b->weight >> c->length>>c->weight;

	if (a->length > b->length)	{
		b->rank++;
	}
	else if(a->length < b->length) {
		a->rank++;
	}
	else if (a->weight < b->weight) {
		b->rank++;
	}
	else {
		a->rank++;
	}
	if (b->length > c->length){
		c->rank++;
	}
	else if(b->length < c->length){
		b->rank++;
	}
	else if (b->weight < c->weight) {
		c->rank++;
	}
	else {
		b->rank++;
	}
	if (c->length > a->length){
		a->rank++;
	}
	else if(c->length < a->length){
		c->rank++;
	}
	else if (c->weight < a->weight) {
		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