結果
問題 | No.683 Two Operations No.3 |
ユーザー | Daigo HIROOKA |
提出日時 | 2018-06-18 23:15:23 |
言語 | Java21 (openjdk 21) |
結果 |
MLE
|
実行時間 | - |
コード長 | 544 bytes |
コンパイル時間 | 3,052 ms |
コンパイル使用メモリ | 72,004 KB |
実行使用メモリ | 838,532 KB |
最終ジャッジ日時 | 2023-09-13 06:58:26 |
合計ジャッジ時間 | 7,469 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 117 ms
55,832 KB |
testcase_01 | AC | 118 ms
55,596 KB |
testcase_02 | AC | 119 ms
55,584 KB |
testcase_03 | AC | 121 ms
55,412 KB |
testcase_04 | MLE | - |
testcase_05 | AC | 120 ms
55,580 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 No683{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long A = sc.nextLong(); long B = sc.nextLong(); operate(A, B); System.out.println("No"); } private static void operate(long a, long b){ if(a == 0 && b == 0){ System.out.println("Yes"); System.exit(0); } else if(a%2 == 0 && b%2 == 0){ operate(a/2, b-1); operate(a-1, b/2); }else if(a%2 == 0 && b%2 != 0){ operate(a/2, b-1); }else if(a%2 != 0 && b%2 == 0){ operate(a-1, b/2); } } }