結果

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

ソースコード

diff #
raw source code

#include <iostream>
#include <string>

using namespace std;

int main() {
  int x, y; cin >> x >> y;
  if (x == 0 && y == 0) {
    cout << 0 << endl;
  }
  else if (abs(x) == abs(y)) {
    cout << 1 << endl;
  }
  else if (x == 0 || y == 0) {
    cout << 1 << endl;
  }
  else {
    cout << 2 << endl;
  }
  return 0;
}
0