結果

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

ソースコード

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 == 0) {
		ansA = 1;
	} else if (A <= M) {
		ansA = A;
	} else {
		ansA = 2 * M - A + 1;
	}

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