結果

問題 No.683 Two Operations No.3
ユーザー Hdz06052373Hdz06052373
提出日時 2018-05-17 22:14:39
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 1,875 ms
コンパイル使用メモリ 51,128 KB
実行使用メモリ 814,452 KB
最終ジャッジ日時 2023-09-10 22:41:09
合計ジャッジ時間 4,002 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 MLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘bool search(int, int)’:
main.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

ソースコード

diff #

#include <iostream>

using namespace std;

bool search(int a, int b) ;

int main() {
    int a, b;
    
    cin >> a >> b;
    
    if(search(a, b))
        cout << "YES" << endl;
    else
        cout << "NO" << endl;

    return 0;
}

bool search(int a, int b) {
    if((a == 0) || (b == 0))
        return true;
    else if((a%2 != 0) && (b%2 != 0))
        return false;
    else if((a%2 == 0) && (b%2 == 0))
        if(search(a, b))
            return true;
    else
        if(search(a,b))
            return true;
}
0