結果

問題 No.571 3人兄弟(その2)
ユーザー OlderInvestorOlderInvestor
提出日時 2017-10-30 16:00:19
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 784 bytes
コンパイル時間 4,216 ms
コンパイル使用メモリ 76,372 KB
実行使用メモリ 41,496 KB
最終ジャッジ日時 2024-11-22 10:40:39
合計ジャッジ時間 6,882 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

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

public class No574 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Integer[] h = new Integer[3], w = new Integer[3];
        int change;

        for(int i = 0; i < 3; i++) {
            h[i] = sc.nextInt() * 100 + 65 + i;
            w[i] = sc.nextInt();
        }

        Arrays.sort(h, Comparator.reverseOrder());
        for(int i = 0; i < 2; i++) {
            if(h[i] == h[i + 1] && w[i] > w[i + 1]) {
                change = h[i];
                h[i] = h[i + 1];
                h[i + 1] = change;
            }
        }

        for(int each : h) {
            System.out.println((char)(each % 100));
        }
    }
}
0