結果

問題 No.3108 Luke or Bishop
ユーザー Yu_212
提出日時 2025-04-19 08:31:57
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 564 bytes
コンパイル時間 3,623 ms
コンパイル使用メモリ 274,100 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-04-19 08:32:02
合計ジャッジ時間 4,472 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;

const int iinf = 1e9;
const ll inf = 1e18;

template<typename T>
ostream& operator<<(ostream &o, vector<T> v) {
    for (int i = 0; i < v.size(); i++)
        o << v[i] << (i+1<v.size()?" ":"");
    return o;
}

int main() {
    cin.tie(0)->sync_with_stdio(false);
    int gx, gy;
    cin >> gx >> gy;
    if (gx == 0 && gy == 0) {
        cout << 0 << endl;
    } else if (gx == 0 || gy == 0 || gx == gy || gx == -gy) {
        cout << 1 << endl;
    } else {
        cout << 2 << endl;
    }

}
0