結果

問題 No.396 クラス替え
コンテスト
ユーザー newlife171128
提出日時 2018-01-17 00:29:32
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 1,000 ms
+ 269µs
コード長 684 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 440 ms
コンパイル使用メモリ 102,152 KB
実行使用メモリ 9,872 KB
最終ジャッジ日時 2026-10-07 02:41:32
合計ジャッジ時間 1,873 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cmath>
#include <stack>
#include <queue>
#include <cctype>
#include <stdio.h>
#include <map>
#include <string.h>
#include <utility>

typedef long long ll;


using namespace std;

int main() {

	long  n=0 ,m=0;
	cin>>n>>m;
	int x=0, y=0;
	cin>>x>>y;

	int miss_x=0;
	if(((x-1)/m) %2 ==0){
		miss_x = (x-1)%m;
	}else {
		int tmp = (x-1)%m;

		miss_x = m-1-tmp;
	}

	int mr_y=0;
	if(((y-1)/m) %2 ==0){
		mr_y = (y-1)%m;
	}else {
		int tmp = (y-1)%m;

		mr_y = m-1-tmp;
	}

	if(mr_y == miss_x){
		cout<<"YES"<<endl;
	}else {
		cout<<"NO"<<endl;
	}



	return 0;
}
0