Submission #447803

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4478032021-07-27 14:48:57dutchBoat (APIO16_boat)C++17
100 / 100
1503 ms4424 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define valid(x, y) (a[x] <= pts[y] && pts[y+1] <= b[x]+1)
const int MOD = 1e9+7, LIM = 501;
int modInverse(int x){
int r = 1, p = (MOD - 2) * 2;
for(int y=x; p/=2; y=(y*y) % MOD)
if(p & 1) r = (r*y) % MOD;
return r;
}
int n, a[LIM], b[LIM], dp[LIM][LIM*2], F[LIM], invF[LIM], C[LIM];
vector<int> pts;
int nCr(int x, int y){
return (((F[x] * invF[y]) % MOD) * invF[x-y]) % MOD;
}
signed main(){
cin.tie(0)->sync_with_stdio(0);
cin >> n;
for(int i=0; i<n; ++i){
cin >> a[i] >> b[i];
pts.push_back(a[i]);
pts.push_back(b[i]+1);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...