This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
#define vel vector<int>
#define rep(i,n) for(int i=0;i<n;i++)
int pr = 1000000007;
int ref(int &a) {
a = a % pr;
a += pr;
a = a % pr;
return a;
}
int main() {
int n;
cin >> n;
vel a(n);
vel b(n);
rep(i, n) { cin >> a[i] >> b[i]; }
vel ans(n, 1);
int ret = 0;
rep(i, n) {
rep(j, i) {
if (a[j] < a[i]) { ans[i] += ans[j]; ref(ans[i]); }
}
ret += ans[i]; ref(ans[i]);
}
cout << ret << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |