結果

問題 No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
ユーザー Cafe1942
提出日時 2025-09-06 13:18:16
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 982 bytes
コンパイル時間 1,097 ms
コンパイル使用メモリ 112,652 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-09-06 13:18:57
合計ジャッジ時間 1,989 ms
ジャッジサーバーID
(参考情報)
judge / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 4 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>//小数点出力用
//cout << fixed << setprecision(10) << ans;
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
using ll = long long;
using namespace std;
#define modPHash (ll)((1LL<<61)-1)
#define modP (ll)998244353
bool chkrng0idx(int pos, int sup) { return (0 <= pos && pos < sup); }
int clk4(int num) { return (num - 2) * (num % 2); }
void yn(bool tf) { cout << (tf ? "Yes\n" : "No\n"); }

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N;
	cin >> N;
	vector<int>L(N), R(N);
	for (int i = 0;i < N;i++) {
		cin >> L[i] >> R[i];
	}
	vector<int>V(N);
	for (int i = 0;i < N;i++)V[i] = i;
	int ans = 0;
	do {
		bool ok = 1;
		for (int i = 1;i < N;i++) {
			if (L[V[i]] <= R[V[i - 1]]) {

			}
			else {
				ok = 0;
			}
		}
		if (ok) {
			ans++;
		}
	} while (next_permutation(V.begin(), V.end()));
	cout << ans;
	return 0;
}

0