結果

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

ソースコード

diff #

#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 26450 )
#pragma warning( disable : 26451 )
#pragma warning( disable : 26498 )
#pragma warning( disable : 4459 )
#endif
#include <atcoder/all>
#ifdef _MSC_VER
#pragma warning( pop )
#endif

auto& in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;


int main()
{
    using std::endl;
    in.sync_with_stdio(false);
    out.sync_with_stdio(false);
    in.tie(nullptr);
    out.tie(nullptr);

    int64_t x,y;
    in >> x >> y;


    if (x == 0) {
        if (y == 0) {
            out << "0\n"; return 0;
        }
        out << "1\n"; return 0;
    }
    if (y == 0) {
        out << "1\n"; return 0;
    }
    if (std::abs(x) == std::abs(y)) {
        out << "1\n"; return 0;
    }
    out << "2\n"; return 0;

    return 0;
}
#endif
0