結果

問題 No.396 クラス替え
ユーザー kyo1
提出日時 2021-01-03 00:57:50
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 382 bytes
コンパイル時間 1,803 ms
コンパイル使用メモリ 192,084 KB
最終ジャッジ日時 2025-01-17 09:18:53
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, M, X, Y;
  cin >> N >> M >> X >> Y;
  X--, Y--;
  int a = X / M;
  int b = Y / M;
  X -= a * M;
  Y -= b * M;
  if (a % 2 != b % 2) {
    Y = (M - Y - 1) % M;
  }
  if (X != Y) {
    cout << "NO" << '\n';
  } else {
    cout << "YES" << '\n';
  }
  return 0;
}
0