結果

問題 No.571 3人兄弟(その2)
ユーザー OlderInvestorOlderInvestor
提出日時 2017-10-30 17:35:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 784 bytes
コンパイル時間 3,848 ms
コンパイル使用メモリ 79,384 KB
実行使用メモリ 40,072 KB
最終ジャッジ日時 2023-08-14 13:14:33
合計ジャッジ時間 6,334 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
39,248 KB
testcase_01 AC 128 ms
39,704 KB
testcase_02 AC 128 ms
39,696 KB
testcase_03 AC 127 ms
39,556 KB
testcase_04 AC 126 ms
39,512 KB
testcase_05 AC 129 ms
39,744 KB
testcase_06 AC 129 ms
39,740 KB
testcase_07 AC 130 ms
39,496 KB
testcase_08 AC 129 ms
40,072 KB
testcase_09 AC 128 ms
39,992 KB
testcase_10 AC 128 ms
39,672 KB
testcase_11 AC 128 ms
39,720 KB
testcase_12 AC 128 ms
39,348 KB
testcase_13 AC 126 ms
39,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class No574 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<Character, Integer[]> map = new HashMap<>();

        for(int i = 0; i < 3; i++) {
            map.put((char)(65 + i), new Integer[]{sc.nextInt(), sc.nextInt()});
        }

        map.entrySet().stream().sorted(
                Map.Entry.comparingByValue((hu1, hu2) -> {
                    if(hu1[0] < hu2[0] || hu1[0].equals(hu2[0]) && hu1[1] > hu2[1]) {
                        return 1;
                    } else {
                        return -1;
                    }
                })
        ).forEach(m -> System.out.println(m.getKey()));
    }
}
0