結果

問題 No.396 クラス替え
ユーザー okayunonaha
提出日時 2016-07-15 23:38:27
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 376 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 54,684 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-15 04:49:00
合計ジャッジ時間 1,028 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(void) {
	int N, M, X, Y, A, ansA, B, ansB;

	cin >> N >> M;
	cin >> X >> Y;

	A = X % (2 * M);
	B = Y % (2 * M);
	if (A <= M) {
		ansA = A;
	} else {
		ansA = 2 * M - A + 1;
	}
	if (B <= M) {
		ansB = B;
	} else {
		ansB = 2 * M - B + 1;
	}
	if (ansA == ansB) {
		cout << "YES\n";
	} else {
		cout << "NO\n";
	}
	return 0;
}
0