結果
問題 | No.396 クラス替え |
ユーザー |
|
提出日時 | 2017-07-06 21:16:56 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 761 bytes |
コンパイル時間 | 632 ms |
コンパイル使用メモリ | 73,644 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-06 03:47:55 |
合計ジャッジ時間 | 1,577 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include<cstdio> #include<iostream> #include<algorithm> #include<string> #include<queue> #include<vector> #include<functional> #include<cmath> #include<map> #include<stack> #include<set> #include<numeric> using namespace std; typedef long long ll; typedef pair<int, int> pi; typedef pair<ll, ll> pl; int main() { ll N, M, X, Y; cin >> N >> M; cin >> X >> Y; ll hanako, tarou; if ((X / M) % 2 == 0) { hanako = X % M; if (X%M == 0)hanako = 1; } else { int a = X % M; if (X % M == 0)a = 1; hanako = (M - a) + 1; } if ((Y / M) % 2 == 0) { tarou = Y % M; if (Y%M == 0)tarou = 1; } else { int a = Y%M; if (Y%M == 0)a = 1; tarou = (M- a) + 1; } if (hanako == tarou)cout << "YES" << endl; else cout << "NO" << endl; return 0; }