結果
| 問題 |
No.1047 Zero (Novice)
|
| コンテスト | |
| ユーザー |
iqueue02
|
| 提出日時 | 2020-05-08 21:43:43 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 44 ms / 2,000 ms |
| コード長 | 437 bytes |
| コンパイル時間 | 2,018 ms |
| コンパイル使用メモリ | 191,324 KB |
| 最終ジャッジ日時 | 2025-01-10 08:29:23 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
constexpr int INF = 2e9;
int main() {
int a, b;
cin >> a >> b;
if (b == 0) {
cout << 1 << endl;
return 0;
}
if (a > 0) {
cout << -1 << endl;
return 0;
}
if (a * b + b == 0) {
cout << 2 << endl;
} else cout << -1 << endl;
return 0;
}
iqueue02