結果

問題 No.531 エヌスクミ島の平和協定
ユーザー IchimiyaIchimiya
提出日時 2020-07-31 01:04:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 1,539 ms
コンパイル使用メモリ 166,000 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-05 02:41:26
合計ジャッジ時間 2,550 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 36 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL -1
using namespace std;
const int64_t MOD = 1e9 + 7;

int main() {
	int n, m;
	cin >> n >> m;

	if (n <= m) {
		cout << 1 << endl;
		return 0;
	}
	else {
		if (n % 2) {
			cout << -1 << endl;
			return 0;
		}
		else {
			if ((n % 2 == 0) && (n / 2 == m)) {
				cout << 2 << endl;
				return 0;
			}
		}
	}

	cout << -1 << endl;
	return 0;
}
0