結果

問題 No.643 Two Operations No.2
ユーザー MisterMister
提出日時 2020-04-16 09:39:04
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 392 bytes
コンパイル時間 523 ms
コンパイル使用メモリ 67,940 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-07-24 23:51:55
合計ジャッジ時間 1,428 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 WA -
testcase_07 AC 2 ms
4,376 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,384 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

void solve() {
    int x, y;
    std::cin >> x >> y;

    int ans;
    if (x == y) {
        ans = 0;
    } else if (y == 0) {
        ans = 1;
    } else if (x == 0) {
        ans = 2;
    } else {
        ans = -1;
    }

    std::cout << ans << std::endl;
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}
0