結果
| 問題 | No.396 クラス替え |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-27 21:21:44 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 532 bytes |
| 記録 | |
| コンパイル時間 | 1,822 ms |
| コンパイル使用メモリ | 208,612 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-11 18:26:03 |
| 合計ジャッジ時間 | 2,129 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++)
#define ALL(x) (x).begin(), (x).end()
const double PI = acos(-1);
int calc(int x, int n, int m) {
x %= 2 * m;
return x < m ? x : 2*m-x-1;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, m, x, y;
cin >> n >> m >> x >> y;
--x, --y;
if (calc(x, n, m) == calc(y, n, m))
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
}