結果
| 問題 | No.3108 Luke or Bishop |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-02-10 02:17:39 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,128 bytes |
| 記録 | |
| コンパイル時間 | 3,659 ms |
| コンパイル使用メモリ | 332,484 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-02-10 02:17:44 |
| 合計ジャッジ時間 | 5,229 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 WA * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define VI vector<int>
#define VL vector<long long>
#define VVL vector<vector<long long>>
#define VVI vector<vector<int>>
#define VS vector<string>
#define ITR(var, start, end) for(int var = start; var < end; var++)
#define PUB push_back
#define POB pop_back
//macro for printing values of a one dimensional array (line by line)
#define OUT1(arr) ITR(i, 0, arr.size()) cout << arr[i] << endl;
//macro for printing values of a one dimensional array (space by space)
#define OUT2(arr) do {\
ITR(i, 0, arr.size()){\
i == arr.size() - 1 ? cout << arr[i] : cout << arr[i] << " ";\
}\
cout << "\n";\
} while(0)
//macro for printing values of a one dimensional array (line by line and with CASE)
#define OUT3(arr) do{\
ITR(i, 0, arr.size()){\
cout << "Case " << i + 1 << ": " << arr[i] << "\n";\
}\
} while(0)
//macro for printing the values of a two dimensional array (space by space)
#define OUT4(arr) do{\
ITR(i, 0, arr.size()){\
ITR(j, 0, arr[i].size()){\
j == arr[i].size() - 1 ? cout << arr[i][j] : cout << arr[i][j] << " ";\
}\
cout << "\n";\
}\
} while(0)
//macro for printing the values of a two dimensional array (space by space and with CASE)
#define OUT5(arr) do{\
ITR(i, 0, arr.size()){\
cout << "Case " << i + 1 << ":" << "\n";\
ITR(j, 0, arr[i].size()){\
j == arr[i].size() - 1 ? cout << arr[i][j] : cout << arr[i][j] << " ";\
}\
cout << "\n";\
}\
} while(0)
int main(void){
ios::sync_with_stdio(false);
cin.tie(nullptr);
//if the goal is lying on the diagonal where row and col abs diff is the same
//then the bishop will always be able to reach it in one step
//otherwise, if the bishop cannot directly in one step reach the goal
//then whichever cell it may be, the rook will always reach it in 2 steps
//only check if a == b since origin is always 0,0
LL a, b;
cin >> a >> b;
a = abs(a); b = abs(b);
a == b ? cout << 1 << endl : cout << 2 << endl;
}
vjudge1