結果

問題 No.643 Two Operations No.2
コンテスト
ユーザー 193s
提出日時 2018-02-03 10:35:23
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 898 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 27 ms
最終ジャッジ日時 2026-03-04 21:44:19
合計ジャッジ時間 260 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
7b5103d1d40b
[/j_bin/judge_tool judge 40000 ../CompileMemory.txt /dev/null sud /dev/null _ g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out main.cpp]
strconv.Atoi: parsing "../CompileMemory.txt": invalid syntax
goroutine 1 [running]:
runtime/debug.Stack()
	/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/debug/stack.go:26 +0x5e
main.main.func1()
	/home/yuki2006/gopath/src/yukicoder/judge/main.go:22 +0x57
panic({0x7d6880?, 0xc0000f6240?})
	/home/yuki2006/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/panic.go:783 +0x132
main.judgeMain({0xc000012150, 0x5?, 0x0?})
	/home/yuki2006/gopath/src/yukicoder/judge/judge_linux.go:121 +0x4b1
main.main()
	/home/yuki2006/gopath/src/yukicoder/judge/main.go:97 +0x277

ソースコード

diff #
raw source code

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <bitset>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define index(xs, x) (int)(lower_bound(all(xs), x) - xs.begin())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int X, Y;
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> X >> Y;
  if (X == Y) {
    cout << 0 << "\n";
  }
  else if (X == 0) {
    cout << 2 << "\n";
  }
  else if (Y == 0) {
    cout << 1 << "\n";
  }
  else if (X == -Y) {
    cout << 3 << "\n";
  }
  else cout << -1 << "\n";
  return 0;
}
0