結果

問題 No.396 クラス替え
ユーザー シャロルシャロル
提出日時 2016-07-15 22:50:32
言語 C++11
(gcc 11.4.0)
結果
MLE  
実行時間 -
コード長 582 bytes
コンパイル時間 1,147 ms
コンパイル使用メモリ 162,304 KB
実行使用メモリ 813,848 KB
最終ジャッジ日時 2024-04-23 05:00:02
合計ジャッジ時間 2,838 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 MLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define FOR(i,a,b) for(ll i = (a); i < (b); ++i)
#define REP(i,n) for(ll i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const int INF = 1e9;
const double PI = acos(-1.0);

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	ll N, M;
	ll X, Y;
	cin >> N >> M;
	cin >> X >> Y;
	
	vector<ll> p;
	ll m = 1;
	bool flag = true;
	REP(i, N) {
		if(m == 1) flag = true;
		if(!flag) --m;
		p.push_back(m);
		if(flag) ++m;
		if(m == M + 1) flag = false;
	}
	
	if(p[X - 1] == p[Y - 1]) cout << "YES";
	else cout << "NO";
	
	
	
	return 0;
}

0