結果

問題 No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
ユーザー D M
提出日時 2025-09-08 16:15:02
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 707 bytes
コンパイル時間 6,110 ms
コンパイル使用メモリ 335,068 KB
実行使用メモリ 7,712 KB
最終ジャッジ日時 2025-09-08 16:15:10
合計ジャッジ時間 7,642 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
const ll MOD = 998244353;
#include<atcoder/all>
using namespace atcoder;
using mint = modint998244353;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n;cin>>n;
  vector<pair<ll,ll>> A(n);
  rep(i,n){
    cin>>A[i].first>>A[i].second;
  }
  sort(all(A));
  ll ans=0;
  do{
    ll base=0;
    bool f=true;
    for(auto I:A){
        if(base>I.second){
            f=false;
            break;
        }else{
            base=max(base,I.first);
        }
    }
    ans+=f;
  }while(next_permutation(all(A)));
  cout<<ans<<endl;
}
0