結果

問題 No.570 3人兄弟(その1)
ユーザー OlderInvestorOlderInvestor
提出日時 2017-10-08 18:39:03
言語 Java19
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 633 bytes
コンパイル時間 3,343 ms
コンパイル使用メモリ 73,088 KB
実行使用メモリ 56,192 KB
最終ジャッジ日時 2023-08-10 20:19:00
合計ジャッジ時間 4,952 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,192 KB
testcase_01 AC 123 ms
55,816 KB
testcase_02 AC 122 ms
55,928 KB
testcase_03 AC 121 ms
55,804 KB
testcase_04 AC 120 ms
55,604 KB
testcase_05 AC 123 ms
55,648 KB
testcase_06 AC 123 ms
55,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.*;

public class No570 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Integer[] h = new Integer[3];
        for(int i = 0; i < h.length; i++) {
            h[i] = sc.nextInt();
        }

        Integer[] h2 = h.clone();
        Arrays.sort(h, Comparator.reverseOrder());
        for(Integer i : h) {
            if(i == h2[0]) {
                System.out.println('A');
            } else if(i == h2[1]) {
                System.out.println('B');
            } else {
                System.out.println('C');
            }
        }
    }
}
0