結果
問題 |
No.3108 Luke or Bishop
|
ユーザー |
|
提出日時 | 2025-04-18 22:17:36 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 838 bytes |
コンパイル時間 | 1,255 ms |
コンパイル使用メモリ | 129,072 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-04-18 22:17:38 |
合計ジャッジ時間 | 1,885 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 |
ソースコード
#include<iostream> #include<iomanip> #include<vector> #include<math.h> #include<algorithm> #include<map> #include<queue> #include<stack> #include<deque> #include<set> #include<cmath> #include<ctime> #include<bitset> #define rep(i,a,b) for(int i=a;i<=b;i++) using namespace std; using ll = long long; using vec = vector<ll>; using Graph = vector<vec>; using Pair = pair<ll,ll>; void debug1(vec v){for(auto x:v)cout << x << ' ';cout << endl;} void debug2(vector<Pair> v){for(auto x:v)cout << '(' << x.first << ',' << x.second << ')' << endl;} void debug3(Graph v){rep(i,0,v.size()-1)debug1(v[i]);cout << endl;} int main(){ ll gx,gy; cin >> gx >> gy; ll ans = 2; if(gx==0 and gy==0)ans = min(ans,(ll)0); if(!gx or !gy)ans = min(ans,(ll)1); if(abs(gx) == abs(gy))ans = min(ans,(ll)1); cout << ans << endl; }