結果
問題 | No.396 クラス替え |
ユーザー |
![]() |
提出日時 | 2023-05-10 13:36:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 836 bytes |
コンパイル時間 | 1,071 ms |
コンパイル使用メモリ | 125,032 KB |
最終ジャッジ日時 | 2025-02-12 21:10:58 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <iostream> #include <fstream> #include <iomanip> #include <vector> #include <algorithm> #include <cmath> #include <unordered_map> #include <map> #include <queue> #include <string> #include <set> #include <list> #include <climits> #include <bitset> #include <numeric> #include <cassert> #include <regex> using std::cout; using std::cin; using std::string; using std::vector; int main() { int n, m; int x, y; cin >> n >> m; cin >> x >> y; x--; y--; int x_class, y_class; if (x/m % 2 == 0) { x_class = 1 + x%m; } else { x_class = m - x%m; } if (y/m % 2 == 0) { y_class = 1 + y%m; } else { y_class = m - y%m; } if (x_class == y_class) { cout << "YES\n"; } else { cout << "NO\n"; } }