結果

問題 No.427 テレビ
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-19 12:58:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 2,698 ms
コンパイル使用メモリ 74,636 KB
実行使用メモリ 54,236 KB
最終ジャッジ日時 2024-04-10 06:03:15
合計ジャッジ時間 3,804 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
52,692 KB
testcase_01 AC 118 ms
53,868 KB
testcase_02 AC 115 ms
53,968 KB
testcase_03 AC 120 ms
53,860 KB
testcase_04 AC 121 ms
53,952 KB
testcase_05 AC 114 ms
53,900 KB
testcase_06 AC 124 ms
54,236 KB
testcase_07 AC 121 ms
54,080 KB
testcase_08 AC 116 ms
53,948 KB
testcase_09 AC 118 ms
53,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int H = sc.nextInt();
    int W = sc.nextInt();
    int g = gcd(Math.max(H, W), Math.min(H, W));
    H = H / g;
    String ans = "TATE";
    if(H == 3) ans = "YOKO";
    System.out.println(ans);
  }

  public static int gcd(int a, int b) {
    if(b == 0) return a;
    return gcd(b, a % b);
  }
}
0