結果
| 問題 |
No.570 3人兄弟(その1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-02-13 16:23:06 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 144 ms / 2,000 ms |
| コード長 | 551 bytes |
| コンパイル時間 | 2,509 ms |
| コンパイル使用メモリ | 77,208 KB |
| 実行使用メモリ | 54,344 KB |
| 最終ジャッジ日時 | 2024-09-13 10:04:50 |
| 合計ジャッジ時間 | 4,337 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 |
ソースコード
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;}
}