結果

問題 No.571 3人兄弟(その2)
ユーザー takeya_okinotakeya_okino
提出日時 2017-10-22 18:38:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 1,043 bytes
コンパイル時間 1,969 ms
コンパイル使用メモリ 74,064 KB
実行使用メモリ 58,272 KB
最終ジャッジ日時 2023-08-13 17:38:13
合計ジャッジ時間 4,757 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
54,384 KB
testcase_01 AC 120 ms
55,724 KB
testcase_02 AC 120 ms
55,556 KB
testcase_03 AC 122 ms
56,116 KB
testcase_04 AC 120 ms
55,700 KB
testcase_05 AC 123 ms
57,868 KB
testcase_06 AC 120 ms
56,012 KB
testcase_07 AC 120 ms
58,272 KB
testcase_08 AC 120 ms
55,532 KB
testcase_09 AC 122 ms
55,660 KB
testcase_10 AC 123 ms
56,156 KB
testcase_11 AC 119 ms
55,620 KB
testcase_12 AC 120 ms
55,296 KB
testcase_13 AC 119 ms
56,068 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