結果

問題 No.571 3人兄弟(その2)
コンテスト
ユーザー Mcpu3
提出日時 2018-05-13 17:00:43
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 820 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 244 ms
コンパイル使用メモリ 39,616 KB
最終ジャッジ日時 2026-02-22 01:08:22
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>

typedef struct {
	char name;
	int h, w;
}data;

int main(void)
{
	data a = { 65 }, b = { 66 }, c = { 67 }, t;
	int i;
	scanf("%d%d%d%d%d%d", &a.h, &a.w, &b.h, &b.w, &c.h, &c.w);
	for (i = 0; i < 2; i++) {
		if (a.h < b.h) {
			t = a;
			a = b;
			b = t;
		}
		if (b.h < c.h) {
			t = b;
			b = c;
			c = t;
		}
	}
	if (a.h == b.h == c.h) {
		for (i = 0; i < 2; i++) {
			if (a.w > b.w) {
				t = a;
				a = b;
				b = t;
			}
			if (b.w > c.w) {
				t = b;
				b = c;
				c = t;
			}
		}
	}
	else if (a.h == b.h&&a.w > b.w) {
		t = a;
		a = b;
		b = t;
	}
	else if (b.h == c.h&&b.w > c.w) {
		t = b;
		b = c;
		c = t;
	}
	else if (a.h == c.h&&a.w > c.w) {
		t = a;
		a = c;
		c = t;
	}
	printf("%c\n%c\n%c", a.name, b.name, c.name);
	return 0;
}
0