結果

問題 No.3108 Luke or Bishop
ユーザー nvvy
提出日時 2025-04-20 05:43:41
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 979 bytes
コンパイル時間 3,552 ms
コンパイル使用メモリ 273,988 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-20 05:43:46
合計ジャッジ時間 4,162 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *  author: saad khurshid
 *  created: 2025.04.20 01:42:56
 **/

#include <bits/stdc++.h>
#define fli(i,fc,n) for(int i=fc;i<n;i++)
#define rli(i,n,rc) for(int i=n;i>rc;i--)
#define sz(a) a.size()
#define ll long long
#define pb push_back
#define vi vector<int>
#define vll vector<ll>
#define pi vector<pair<int,int>>
#define pll vector<pair<ll,ll>>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define nl "\n"
using namespace std;

#ifndef ONLINE_JUDGE
#include "algo/debug.h"
#else
#define debug(...) 42
#endif


void saad(){
    ll gx, gy; cin >> gx >> gy;

    ll r = 0;
    if(gx != 0 && gy != 0) r = 2;
    else if(gx != 0 || gy != 0) r = 1;

    ll b = 1e9;
    if((gx + gy) % 2 == 0){
        if(gx == 0 && gy == 0) b = 0;
        else if(abs(gx) == abs(gy)) b = 1;
        else b = 2;
    }

    cout << min(r,b) << nl;
}

int main() {
    ios::sync_with_stdio(false),cin.tie(nullptr);
    int t = 1;
    while(t--){
        saad();
    }
}
0