結果
問題 |
No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
|
ユーザー |
![]() |
提出日時 | 2025-09-06 13:34:54 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 535 bytes |
コンパイル時間 | 3,422 ms |
コンパイル使用メモリ | 278,440 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-06 13:34:59 |
合計ジャッジ時間 | 4,385 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i, N) for(i = 0; i < N; i++) #define ll long long int main(void) { ll N; ll L[8]; ll R[8]; ll i, j, k; cin>>N; rep(i, 8) cin>>L[i]>>R[i]; vector<ll>P; rep(i,N)P.push_back(i); ll ans=0; do{ bool can=1; ll now=0; rep(i,N){ now=max(now,L[P[i]]); if(R[P[i]]<now)can=0; } ans+=can; }while(next_permutation(P.begin(), P.end())); cout<<ans<<endl; return 0; }