結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define int long long

int N, M, X, Y;

int GetClass(int n)
{
	int res = (n - 1) % M;
	if ((n - 1)/M&1) res = M - 1 - res;
	return res + 1;
}

signed main()
{
	cin >> N >> M >> X >> Y;
	if (GetClass(X) == GetClass(Y)) puts("YES");
	else puts("NO");
	return 0;
}
0