結果
| 問題 | No.570 3人兄弟(その1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-02-13 16:23:06 |
| 言語 | Java (openjdk 26.0.2.1) |
| 結果 |
AC
|
| 実行時間 | 64 ms / 2,000 ms |
| + 242µs | |
| コード長 | 551 bytes |
| 記録 | |
| コンパイル時間 | 3,334 ms |
| コンパイル使用メモリ | 85,924 KB |
| 実行使用メモリ | 43,744 KB |
| 最終ジャッジ日時 | 2026-08-26 02:23:51 |
| 合計ジャッジ時間 | 4,466 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;}
}