# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
833339 |
2023-08-22T04:42:41 Z |
vjudge1 |
Exam (eJOI20_exam) |
C++14 |
|
1000 ms |
340 KB |
#include<bits/stdc++.h>
using namespace std;
int main(){
//12 poin :))
int n;
cin>>n;
vector<int> a(n+2),b(n+2),c(n+2);
for(int i=1; i<=n; i++){
cin>>a[i];
}
for(int i=1; i<=n; i++){
cin>>b[i];
}
int x=b[1];
for(int i=1; i<=n;i++){
if(c[i]==1)continue;
if(a[i]==x){
c[i]=1;
int j=i+1;
while(a[j]<=x&&j<=n){
a[j]=x;
c[j]=1;
}
j=i-1;
while(a[j]<=x&&1<=j){
if(c[j]==1)break;
a[j]=x;
c[j]=1;
}
}
}
int ans=0;
for(int i=1;i<=n;i++){
if(a[i]==b[i])ans++;
}
cout<<ans<<"\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1064 ms |
212 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |