結果

問題 No.3108 Luke or Bishop
ユーザー ruase_
提出日時 2025-08-15 10:33:35
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 842 ms
コンパイル使用メモリ 99,232 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-08-15 10:33:38
合計ジャッジ時間 2,205 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

# include <iostream>
# include <iomanip>
# include <algorithm>

using namespace std;


int main()
{
    int gx, gy;
    cin >> gx >> gy;
    int ans = 0;
    if (gx == 0 && gy == 0) {
        ans = 0;
    } else if (abs(gx) == abs(gy) || gx==0 || gy == 0) {
        ans = 1;
    } else {
        ans = 2;
    }
    cout << ans << endl;
}


0