結果

問題 No.396 クラス替え
ユーザー シャロルシャロル
提出日時 2016-07-15 22:49:03
言語 C++11
(gcc 11.4.0)
結果
MLE  
実行時間 -
コード長 588 bytes
コンパイル時間 1,111 ms
コンパイル使用メモリ 159,616 KB
実行使用メモリ 817,248 KB
最終ジャッジ日時 2024-04-23 04:58:46
合計ジャッジ時間 3,590 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 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(int i = (a); i < (b); ++i)
#define REP(i,n) for(int 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);
	
	int N, M;
	int X, Y;
	cin >> N >> M;
	cin >> X >> Y;
	
	vector<int> p;
	int 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