結果

問題 No.571 3人兄弟(その2)
ユーザー takeya_okinotakeya_okino
提出日時 2017-10-22 18:38:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 1,043 bytes
コンパイル時間 2,106 ms
コンパイル使用メモリ 77,176 KB
実行使用メモリ 54,188 KB
最終ジャッジ日時 2024-05-01 10:18:29
合計ジャッジ時間 4,689 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
53,972 KB
testcase_01 AC 134 ms
53,960 KB
testcase_02 AC 134 ms
54,124 KB
testcase_03 AC 137 ms
53,816 KB
testcase_04 AC 133 ms
53,972 KB
testcase_05 AC 133 ms
54,188 KB
testcase_06 AC 136 ms
54,096 KB
testcase_07 AC 132 ms
53,824 KB
testcase_08 AC 134 ms
54,052 KB
testcase_09 AC 139 ms
53,960 KB
testcase_10 AC 133 ms
54,040 KB
testcase_11 AC 135 ms
54,188 KB
testcase_12 AC 134 ms
54,176 KB
testcase_13 AC 134 ms
53,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

    if(h[0] > h[1]) {
      ord[0]++;
    } else if(h[0] < h[1]) {
      ord[1]++;
    } else {
      if(w[0] < w[1]) {
        ord[0]++;
      } else {
        ord[1]++;
      }
    }

    if(h[0] > h[2]) {
      ord[0]++;
    } else if(h[0] < h[2]) {
      ord[2]++;
    } else {
      if(w[0] < w[2]) {
        ord[0]++;
      } else {
        ord[2]++;
      }
    }

    if(h[2] > h[1]) {
      ord[2]++;
    } else if(h[2] < h[1]) {
      ord[1]++;
    } else {
      if(w[2] < w[1]) {
        ord[2]++;
      } else {
        ord[1]++;
      }
    }

    for(int i = 2; i >= 0; i--) {
      if(ord[0] == i) System.out.println("A");
      if(ord[1] == i) System.out.println("B");
      if(ord[2] == i) System.out.println("C");
    }
  }
}
0