結果

問題 No.570 3人兄弟(その1)
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-13 16:23:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 551 bytes
コンパイル時間 2,719 ms
コンパイル使用メモリ 77,548 KB
実行使用メモリ 56,132 KB
最終ジャッジ日時 2023-10-11 11:19:15
合計ジャッジ時間 4,455 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
56,108 KB
testcase_01 AC 132 ms
56,104 KB
testcase_02 AC 131 ms
56,112 KB
testcase_03 AC 131 ms
55,956 KB
testcase_04 AC 129 ms
55,892 KB
testcase_05 AC 131 ms
55,804 KB
testcase_06 AC 133 ms
56,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		Human[] brother = new Human[3];
		for (int i=0; i<3; i++) {
			brother[i] = new Human(String.valueOf((char)(i+65)), sc.nextInt());
		}
		Arrays.sort(brother, Comparator.comparing(Human::getHeight).reversed());
		
		for (int i=0; i<3; i++) {
			System.out.println(brother[i].name);
		}
		
	}
}

class Human {
	String name;
	int height;
	Human(String s, int n) {
		name = s;
		height = n;
	}
	int getHeight() {return height;}
}
0