結果
| 問題 |
No.396 クラス替え
|
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2016-07-15 22:33:03 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 529 bytes |
| コンパイル時間 | 594 ms |
| コンパイル使用メモリ | 66,392 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 04:18:42 |
| 合計ジャッジ時間 | 1,257 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 WA * 4 |
ソースコード
#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
typedef long long ll;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll N, M, X, Y;
cin >> N >> M >> X >> Y;
X--, Y--;
int r1 = X / M, r2 = Y / M;
if(r1 % 2 == r2 % 2) {
if(X % M == Y % M) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
else {
if(X % M == (M - 1 + Y) % M) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
}
femto