結果
| 問題 |
No.396 クラス替え
|
| コンテスト | |
| ユーザー |
kapo
|
| 提出日時 | 2016-07-15 23:13:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 990 bytes |
| コンパイル時間 | 872 ms |
| コンパイル使用メモリ | 68,412 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 11:07:07 |
| 合計ジャッジ時間 | 1,195 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <sstream>
#include <cmath>
using namespace std;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
typedef pair<int, int> Pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
typedef long long ll;
const int inf = 1e9;
const int mod = 1e9 + 7;
int N, M, X, Y;
int main()
{
cin >> N >> M >> X >> Y;
int a = (X-1) % M;
int b = (Y-1) % M;
int a2 = (X-1) / M;
int b2 = (Y-1) / M;
//printf("a=%d b=%d a2=%d b2=%d\n",a,b,a2,b2);
if(a2%2==b2%2) {
if(a==b) cout << "YES" << endl;
else cout << "NO" << endl;
} else {
if(a2) {
if((M-a-1)==b) cout << "YES" << endl;
else cout << "NO" << endl;
} else if (b2) {
if((M-b-1)==a) cout << "YES" << endl;
else cout << "NO" << endl;
}
}
return 0;
}
kapo