Submission #109290

#TimeUsernameProblemLanguageResultExecution timeMemory
109290b2563125Boat (APIO16_boat)C++14
9 / 100
6 ms512 KiB
#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(ret); } cout << ret << endl; 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...