結果
問題 | No.571 3人兄弟(その2) |
ユーザー |
|
提出日時 | 2017-10-29 09:39:19 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 774 bytes |
コンパイル時間 | 4,346 ms |
コンパイル使用メモリ | 80,944 KB |
実行使用メモリ | 41,788 KB |
最終ジャッジ日時 | 2024-11-22 05:04:27 |
合計ジャッジ時間 | 6,442 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 WA * 4 |
ソースコード
import java.util.LinkedHashMap; import java.util.Map; 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] || o1[0] == o2[0] && o1[1] < o2[1]) { return 1; } return -1; })) .forEach(e -> System.out.println(e.getKey())); } }