Submission #447462

#TimeUsernameProblemLanguageResultExecution timeMemory
447462snasibov05Boat (APIO16_boat)C++14
9 / 100
2 ms300 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...