結果
| 問題 |
No.396 クラス替え
|
| コンテスト | |
| ユーザー |
🍡yurahuna
|
| 提出日時 | 2016-07-15 22:34:23 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 910 bytes |
| コンパイル時間 | 1,667 ms |
| コンパイル使用メモリ | 165,520 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 10:44:09 |
| 合計ジャッジ時間 | 2,264 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define int long long // <-----!!!!!!!!!!!!!!!!!!!
#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
typedef vector<vector<int>> Graph;
const int inf = 1e9;
const int mod = 1e9 + 7;
int n, m;
int f(int x) {
x--;
x %= 2 * m;
if (x < m) return x % m;
return m - 1 - (x % m);
}
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
cin >> n >> m;
int x, y;
cin >> x >> y;
x = f(x);
y = f(y);
// cout << x << " " << y << endl;
cout << (x == y ? "YES" : "NO") << endl;
}
🍡yurahuna