結果
| 問題 |
No.396 クラス替え
|
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2016-07-15 22:58:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 369 bytes |
| コンパイル時間 | 806 ms |
| コンパイル使用メモリ | 58,328 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 11:06:10 |
| 合計ジャッジ時間 | 1,289 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <iostream>
#include <cmath>
using namespace std;
int main() {
long long int n, m, x, y;
cin >> n >> m >> x >> y;
long long int a, b;
a = ceil((double)x / m);
b = ceil((double)y / m);
x -= m*(a-1);
y -= m*(b-1);
if (!(a % 2)) x = m - x + 1;
if (!(b % 2)) y = m - y + 1;
if (x == y) cout << "YES" << endl;
else cout << "NO" << endl;
return 0;
}
kurenai3110