結果

問題 No.570 3人兄弟(その1)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2018-04-14 16:19:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 573 bytes
コンパイル時間 2,436 ms
コンパイル使用メモリ 83,624 KB
実行使用メモリ 57,064 KB
最終ジャッジ日時 2023-09-09 05:14:11
合計ジャッジ時間 4,576 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
56,904 KB
testcase_01 AC 159 ms
56,860 KB
testcase_02 AC 158 ms
56,820 KB
testcase_03 AC 158 ms
56,960 KB
testcase_04 AC 158 ms
56,764 KB
testcase_05 AC 155 ms
57,064 KB
testcase_06 AC 158 ms
56,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        List<String> list = new ArrayList<>();
        int num = 3;
        for(int i = 0; i < num; i++) {
            char c = (char)('A' + i);
            String s = sc.next() + c;
            list.add(s);
        }
        Collections.sort(list);
        Collections.reverse(list);
        for(String tmp: list) {
            System.out.println(tmp.charAt(tmp.length()-1));
        }
    }
}
0