# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
465961 |
2021-08-17T12:46:16 Z |
fuad27 |
Exam (eJOI20_exam) |
C++17 |
|
5 ms |
332 KB |
#include<bits/stdc++.h>
using namespace std;
int main () {
int n;
cin >> n;
int a[n], b[n];
for(int i = 0;i<n;i++)cin>>a[i];
for(int i =0;i<n;i++)cin>>b[i];
for(int i = 0;i<n;i++) {
if(a[i] == b[i]) {
for(int j = i-1;j>=0;j--) {
if(b[j] == a[i] and a[j] <= a[i]) {
a[j] = a[i];
}
else {
break;
}
}
for(int j = i+1;j<0;j++) {
if(b[j] == a[i] and a[j] <= a[i]) {
a[j] = a[i];
}
else {
break;
}
}
}
}
int ans = 0;
for(int i = 0;i<n;i++) {
if(a[i] == b[i])ans++;
}
cout<<ans<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |