結果

問題 No.3108 Luke or Bishop
ユーザー しとりん
提出日時 2025-04-18 20:44:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 791 bytes
コンパイル時間 1,681 ms
コンパイル使用メモリ 193,832 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-18 20:44:50
合計ジャッジ時間 2,516 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
template<typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); }
template<typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); }
#define int long long
const int INF = (1LL << 60);
//const int MOD = 1e9 + 7;
vector<int> dx = { 0,1 };
vector<int> dy = { 1,0 };

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