結果
問題 | No.571 3人兄弟(その2) |
ユーザー |
|
提出日時 | 2017-10-29 09:42:54 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 140 ms / 2,000 ms |
コード長 | 814 bytes |
コンパイル時間 | 3,791 ms |
コンパイル使用メモリ | 80,584 KB |
実行使用メモリ | 41,572 KB |
最終ジャッジ日時 | 2024-11-22 05:04:45 |
合計ジャッジ時間 | 6,413 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
import java.util.LinkedHashMap;import java.util.Map;import java.util.Objects;import java.util.Scanner;public class No571 {public static void main(String[] args) {Scanner s = new Scanner(System.in);LinkedHashMap<String, Integer[]> map = new LinkedHashMap<>();map.put("A", new Integer[]{s.nextInt(), s.nextInt()});map.put("B", new Integer[]{s.nextInt(), s.nextInt()});map.put("C", new Integer[]{s.nextInt(), s.nextInt()});map.entrySet().stream().sorted(Map.Entry.comparingByValue((o1, o2) -> {if (o1[0] < o2[0] || Objects.equals(o1[0], o2[0]) && o1[1] > o2[1]) {return 1;}return -1;})).forEach(e -> System.out.println(e.getKey()));}}