# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23660 | 2017-05-18T10:27:07 Z | TAMREF | Boat (APIO16_boat) | C++11 | 0 ms | 3456 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MX=100005; const int mod=1000000007; int N, A[MX], B[MX]; void input(){ scanf("%d",&N); for(int i=1;i<=N;i++) scanf("%d %d",&A[i],&B[i]); } void task1(){ ll D[MX]={1}; for(int i=1,j;i<=N;i++){ for(j=N-1;j&&B[j]>=B[i];--j); D[i]=(D[i-1]+D[j])%mod; } printf("%lld\n",((D[N]-1)%mod+mod)%mod); } int main(){ input(); task1(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 3456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 3456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 3456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 3456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |