結果

問題 No.3108 Luke or Bishop
コンテスト
ユーザー 中野晴登
提出日時 2025-04-18 23:25:34
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 0 ms / 2,000 ms
コード長 1,176 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,659 ms
コンパイル使用メモリ 208,632 KB
実行使用メモリ 5,632 KB
最終ジャッジ日時 2026-07-09 20:14:26
合計ジャッジ時間 2,425 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VVL = vector<vector<long long>>;
using VL = vector<long long>;
using PLL = pair<ll, ll>;
#define m_p(a, b) make_pair(a, b)
#define rep(i,n) for(long long i = 0; i < n; i++)
#define Rrep(i,n) for(long long i = n-1; i >= 0; i--)
#define Srep(i,si,n) for(long long i = si; i < n; i++)
using ld = long double;
using cll = const long long;
const long long llmax = 9223372036854775807;
const int intmax = 2147483647;
const ll ll1 = 1;
const ll mod = 998244353;
const ll mod_two = 1e+9 +7;
const ld pi = acos(-1.0);
// g++ -g -fsanitize=address
// -Wall -Wextra

int main(){
  //cout << fixed << setprecision(0);
  //指数表記になったときに弄って使う
  //random_device r_d;
  //uniform_int_distribution int_rand(a, b);
  //int_rand(r_d)で a <= n <= bのnが出力される(一様分布)
  //ランダムテンプレ
  long long n, m;
  long long a, b;
  long long i, j, k;
  long long count = 0, ans = 0;
  string s, t;
  cin >> a >> b;
  if(a == 0 && b == 0){
  	cout << 0 << endl;
  }else if(abs(a) == abs(b) || (a == 0 || b == 0)){
  	cout << 1 << endl;
  }else{
  	cout << 2 << endl;
  }
}
0