結果
| 問題 |
No.1556 Power Equality
|
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2021-06-25 21:25:00 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 498 bytes |
| コンパイル時間 | 2,205 ms |
| コンパイル使用メモリ | 74,476 KB |
| 実行使用メモリ | 54,436 KB |
| 最終ジャッジ日時 | 2024-06-25 09:07:27 |
| 合計ジャッジ時間 | 4,449 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 1 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
sc.close();
if (a == b) {
System.out.println("Yes");
} else {
int x = Math.min(a, b);
int y = Math.max(a, b);
if (x == 2) {
for (int i = 2; i < 31; i++) {
if (1 << i == y) {
System.out.println("Yes");
return;
}
}
}
System.out.println("No");
}
}
}
ks2m