結果

問題 No.571 3人兄弟(その2)
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-11 03:07:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 542 bytes
コンパイル時間 2,351 ms
コンパイル使用メモリ 77,628 KB
実行使用メモリ 41,336 KB
最終ジャッジ日時 2024-04-24 15:49:43
合計ジャッジ時間 4,869 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
39,948 KB
testcase_01 AC 131 ms
41,140 KB
testcase_02 AC 118 ms
40,208 KB
testcase_03 AC 132 ms
41,228 KB
testcase_04 AC 113 ms
39,868 KB
testcase_05 AC 120 ms
40,744 KB
testcase_06 AC 118 ms
40,144 KB
testcase_07 AC 115 ms
40,216 KB
testcase_08 AC 114 ms
39,868 KB
testcase_09 AC 124 ms
40,980 KB
testcase_10 AC 121 ms
41,104 KB
testcase_11 AC 127 ms
41,076 KB
testcase_12 AC 121 ms
40,568 KB
testcase_13 AC 125 ms
41,336 KB
権限があれば一括ダウンロードができます

ソースコード

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