結果

問題 No.396 クラス替え
ユーザー femto
提出日時 2016-07-15 22:40:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 527 bytes
コンパイル時間 755 ms
コンパイル使用メモリ 66,524 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 10:45:28
合計ジャッジ時間 1,273 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
typedef long long ll;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	ll N, M, X, Y;
	cin >> N >> M >> X >> Y;
	X--, Y--;

	int r1 = X / M, r2 = Y / M;
	if(r1 % 2 == r2 % 2) {
		if(X % M == Y % M) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	else {
		if(X % M == M - 1 - Y % M) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
}
0