結果
| 問題 | No.396 クラス替え |
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2016-07-15 22:40:16 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 527 bytes |
| 記録 | |
| コンパイル時間 | 520 ms |
| コンパイル使用メモリ | 86,064 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-05-12 08:33:03 |
| 合計ジャッジ時間 | 2,039 ms |
|
ジャッジサーバーID (参考情報) |
tmp-judge_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
typedef long long ll;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll N, M, X, Y;
cin >> N >> M >> X >> Y;
X--, Y--;
int r1 = X / M, r2 = Y / M;
if(r1 % 2 == r2 % 2) {
if(X % M == Y % M) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
else {
if(X % M == M - 1 - Y % M) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
}
femto