# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
833219 |
2023-08-22T03:20:49 Z |
vjudge1 |
Exam (eJOI20_exam) |
C++ |
|
3 ms |
340 KB |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define fi first
#define se second
const ll N = 1e5+10;
ll n,ans;
ll h[N],t[N];
bool vis[N];
int main() {
cin >> n;
for(int i=1; i<=n; i++) {
cin >> h[i];
}
for(int i=1; i<=n; i++) {
cin >> t[i];
}
for(int i=1; i<=n; i++) {
if(h[i] == t[1]) {
for(int j=i-1; j>=1; j++) {
if(vis[j]) break;
if(h[j] < h[i]) {
h[j] = h[i];
vis[j] = true;
}
else break;
}
for(int j=i+1; j<=n; j++) {
if(vis[j]) break;
if(h[j] < h[i]) {
h[j] = h[i];
vis[j] = true;
}
else break;
}
}
}
for(int i=1; i<=n; i++) if(h[i] == t[i]) ans++;
cout << ans << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 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 |
- |
# |
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 |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |