結果
問題 |
No.396 クラス替え
|
ユーザー |
![]() |
提出日時 | 2023-05-10 13:31:54 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 836 bytes |
コンパイル時間 | 1,205 ms |
コンパイル使用メモリ | 125,432 KB |
最終ジャッジ日時 | 2025-02-12 21:10:53 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 WA * 7 |
ソースコード
#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 = 4 - x%m; } if (y/m % 2 == 0) { y_class = 1 + y%m; } else { y_class = 4 - y%m; } if (x_class == y_class) { cout << "YES\n"; } else { cout << "NO\n"; } }