結果
問題 |
No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
|
ユーザー |
|
提出日時 | 2025-09-06 15:18:45 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 600 bytes |
コンパイル時間 | 3,576 ms |
コンパイル使用メモリ | 279,856 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-09-06 15:19:10 |
合計ジャッジ時間 | 4,169 ms |
ジャッジサーバーID (参考情報) |
judge / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll =long long; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll N; cin>>N; vector<array<ll,2>> P(N); for(int i=0;i<N;i++)cin>>P[i][0]>>P[i][1]; vector<ll> Q(N); for(int q=0;q<N;q++)Q[q]=q; ll an=0; do{ ll x=-1; bool OK=1; for(int i=0;i<N;i++){ if(x>P[Q[i]][1]){ OK=0; break; } x=max(x,P[Q[i]][0]); } if(OK)an++; }while(next_permutation(Q.begin(),Q.end())); cout<<an<<"\n"; }