結果
問題 |
No.396 クラス替え
|
ユーザー |
![]() |
提出日時 | 2025-05-20 21:17:38 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 830 bytes |
コンパイル時間 | 3,707 ms |
コンパイル使用メモリ | 274,016 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-05-20 21:17:43 |
合計ジャッジ時間 | 3,841 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 20 |
ソースコード
#include <bits/stdc++.h> #define int long long //#define USE_FREOPEN //#define MUL_TEST #define FILENAME "class" using namespace std; // class x: I (n-1)%(2m)=x-1 // II (n-1)%(2m)=2m-x+1 void solve() { int n, m, x, y; cin >> n >> m >> x >> y; int xc, yc; if ((x - 1) % (2 * m) < m) xc = ((x - 1) % (2 * m)) + 1; else xc = 2 * m - ((x - 1) % (2 * m)); if ((y - 1) % (2 * m) < m) yc = ((y - 1) % (2 * m)) + 1; else yc = 2 * m - ((y - 1) % (2 * m)); // cerr << xc << ' ' << yc << '\n'; cout << (xc == yc ? "Yes\n" : "No\n"); } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); #ifdef USE_FREOPEN freopen(FILENAME ".in","r",stdin); freopen(FILENAME ".out","w",stdout); #endif int _ = 1; #ifdef MUL_TEST cin >> _; #endif while (_--) solve(); _^=_; return 0^_^0; }