結果

問題 No.571 3人兄弟(その2)
ユーザー Tsukasa_Type
提出日時 2018-02-11 03:07:30
言語 Java
(openjdk 23)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 542 bytes
コンパイル時間 2,353 ms
コンパイル使用メモリ 76,464 KB
実行使用メモリ 41,632 KB
最終ジャッジ日時 2024-11-07 00:25:30
合計ジャッジ時間 5,136 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int[] height = new int[3];
		int[] weight = new int[3];
		String[] name = {"A","B","C"};
		Map<Integer,String> map = new TreeMap<>(Comparator.reverseOrder());
		
		for (int i=0; i<3; i++) {
			height[i] = sc.nextInt()*1000;
			weight[i] = -(sc.nextInt());
			map.put(height[i]+weight[i],name[i]);
		}
		
		for (Map.Entry<Integer,String> entry : map.entrySet()) {
			System.out.println(entry.getValue());
		}
	}
}
0