結果

問題 No.396 クラス替え
ユーザー Ryu
提出日時 2018-02-07 14:27:08
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 731 bytes
コンパイル時間 986 ms
コンパイル使用メモリ 82,004 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 20:21:28
合計ジャッジ時間 2,105 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <numeric>
#include <cstring>
#include <cmath>
#include <set>
#include <queue>
#include <stack>

const int MOD = 1e9 + 7;
const int iINF = 1000000000;
const long long int llINF = 1000000000000000000;
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
using ll = long long int;
using P = pair<int, int>;
using edge = struct
{
    int to;
    int cost;
};

int main()
{
    int N, M, X, Y;
    cin >> N >> M >> X >> Y;
    X--; Y--;
    X = X % (2 * M);
    Y = Y % (2 * M);
    
    if(M <= X) X = M - 1 - (X % M);
    if(M <= Y) Y = M - 1 - (Y % M);

    cout << (X == Y ? "YES" : "NO") << endl; 
    return 0;
}
0