結果

問題 No.1829 Möbius Tunnelling
ユーザー Pres1dent
提出日時 2022-02-04 22:29:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,430 bytes
コンパイル時間 4,477 ms
コンパイル使用メモリ 250,584 KB
最終ジャッジ日時 2025-01-27 19:20:11
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#include <unistd.h>
using namespace std;
#include "atcoder/all"
using namespace atcoder;
using i64 = long long;
using uni64 = unsigned long long;
using ld = long double;
using i_i = pair<int, int>;
using i_b = pair<int, bool>;
using l_l = pair<i64, i64>;
using d_d = pair<double, double>;
using s_s = pair<string, string>;
using i_i_i = tuple<int, int, int>;
using i_i_i_i = tuple<int, int, int, int>;
using l_l_l = tuple<i64, i64, i64>;
using l_l_l_l = tuple<i64, i64, i64, i64>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define ifbit(n,k) ((n>>k)&1) //if kth bit of n is on then true (sitakara, 0-indexed)
#define zpad(i) cout << setfill('0') << setw(i)
#define dout cout << fixed << setprecision(10)
constexpr int INF = 2147483647;
constexpr i64 I64F = 9223372036854775807;
constexpr int m1007 = 1000000007;
constexpr int m9982 = 998244353;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
	int n; cin >> n;
	int a, b, c; cin >> a >> b >> c;
	if (c < a and a < b) {
		cout << "No" << endl;
		return 0;
	}
	if (c > a and a > b) {
		cout << "No" << endl;
		return 0;
	}
	if (b < a) {
		a = n - a + 1;
		b = n - b + 1;
		c = n - c + 1;
	}
	b = (b + n - a) % n;
	c = (c + n - a) % n;
	if (c >= b) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}
0