結果
問題 | No.683 Two Operations No.3 |
ユーザー | htensai |
提出日時 | 2020-05-08 16:37:14 |
言語 | Java21 (openjdk 21) |
結果 |
MLE
|
実行時間 | - |
コード長 | 944 bytes |
コンパイル時間 | 3,080 ms |
コンパイル使用メモリ | 71,640 KB |
実行使用メモリ | 834,724 KB |
最終ジャッジ日時 | 2023-09-16 08:30:26 |
合計ジャッジ時間 | 4,859 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 120 ms
55,644 KB |
testcase_01 | AC | 122 ms
55,764 KB |
testcase_02 | AC | 119 ms
55,200 KB |
testcase_03 | AC | 119 ms
55,396 KB |
testcase_04 | AC | 121 ms
55,616 KB |
testcase_05 | AC | 120 ms
55,724 KB |
testcase_06 | MLE | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
ソースコード
import java.util.*; public class Main { static int[] xArr; static int[] yArr; static int[] cArr; static int[][][] dp; static int fee; public static void main (String[] args) { Scanner sc = new Scanner(System.in); if (check(sc.nextLong(), sc.nextLong())) { System.out.println("Yes"); } else { System.out.println("No"); } } static boolean check(long a, long b) { if (a == 0 && b == 0) { return true; } if (a < 0 || b < 0) { return false; } if (a % 2 == 0) { if (b % 2 == 0) { if (check(a / 2, b - 1)) { return true; } else { return check(a - 1, b / 2); } } else { return check(a / 2, b - 1); } } else { if (b % 2 == 0) { return check(a - 1, b / 2); } else { return false; } } } }