結果

問題 No.570 3人兄弟(その1)
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-07 03:02:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 668 bytes
コンパイル時間 2,028 ms
コンパイル使用メモリ 75,712 KB
実行使用メモリ 54,204 KB
最終ジャッジ日時 2024-04-28 12:02:20
合計ジャッジ時間 3,598 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
54,204 KB
testcase_01 AC 122 ms
54,168 KB
testcase_02 AC 121 ms
54,128 KB
testcase_03 AC 116 ms
54,172 KB
testcase_04 AC 103 ms
53,060 KB
testcase_05 AC 118 ms
53,932 KB
testcase_06 AC 113 ms
54,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder174;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		Pair[] p = {new Pair(a, 'A'), new Pair(b, 'B'), new Pair(c, 'C')};
		Arrays.sort(p, new Comparator<Pair>() {
			public int compare(Pair p1, Pair p2) {
				return Integer.compare(p2.a, p1.a);
			}
		});
		for(int i = 0 ; i < 3 ; i++) {
			System.out.println(p[i].c);
		}
	}

	public static class Pair {
		int a; char c;
		public Pair(int a, char c) {
			this.a = a; this.c = c;
		}
	}

}

0