# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
217113 | 2020-03-29T02:00:58 Z | jamielim | Collecting Stamps 3 (JOI20_ho_t3) | C++14 | 5 ms | 256 KB |
#include <bits/stdc++.h> using namespace std; int main(){ int n,l; scanf("%d%d",&n,&l); int x[n],t[n]; for(int i=0;i<n;i++)scanf("%d",&x[i]); for(int i=0;i<n;i++)scanf("%d",&t[i]); int ans=0; for(int i=-1;i<n;i++){ int cur=0; for(int j=0;j<=i;j++){ if(x[j]<=t[j])cur++; } for(int j=n-1;j>i;j--){ if(l-x[j]+2*(i==-1?0:x[i])<=t[j])cur++; } ans=max(ans,cur); cur=0; for(int j=n-1;j>i;j--){ if(l-x[j]<=t[j])cur++; } for(int j=0;j<=i;j++){ if(x[j]+2*(l-(i==n-1?0:x[i+1]))<=t[j])cur++; } ans=max(ans,cur); } printf("%d",ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Incorrect | 5 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Incorrect | 5 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Incorrect | 5 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Incorrect | 5 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |