結果
問題 |
No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
|
ユーザー |
|
提出日時 | 2025-09-11 18:29:04 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 657 bytes |
コンパイル時間 | 6,629 ms |
コンパイル使用メモリ | 259,384 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-09-11 18:29:12 |
合計ジャッジ時間 | 8,261 ms |
ジャッジサーバーID (参考情報) |
judge / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 4 WA * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int i = 0; i< (n); ++i) #define repi(i, a, b) for (int i = (a); i < (b); ++i) #define all(x) (x).begin(), (x).end() #define fore(i, a) for(auto &i:a) using ll = long long; #define DEBUG(x) cerr << #x << ": "; for (auto _ : x) cerr << _ << " "; cerr << endl; int main() { int n;cin >> n; vector<int> L(n), R(n), order(n); rep(i, n)cin >> L[i] >> R[i]; rep(i, n)order[i] = i; int ans = 0; do{ bool flag = true; rep(i, n-1){ if(L[order[i]] > R[order[i+1]])flag = false; } if(flag)ans++; }while(next_permutation(all(order))); cout << ans << endl; }