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 <vector>
using namespace std;
int main() {
const int m = 1e9 + 7;
int n; cin >> n;
vector<int> a(n), b(n);
for (int i = 0; i < n; ++i) cin >> a[i] >> b[i];
int ans = 0;
vector<int> res(n, 1);
for (int i = 0; i < n; ++i){
for (int j = 0; j < i; ++j){
if (a[j] < a[i]) {
res[i] += res[j];
res[i] %= m;
}
}
ans += res[i];
ans %= m;
}
cout << ans << "\n";
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... |