# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
833222 |
2023-08-22T03:22:00 Z |
vjudge1 |
Exam (eJOI20_exam) |
C++ |
|
59 ms |
1972 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 |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
12 ms |
596 KB |
Output is correct |
3 |
Correct |
36 ms |
1724 KB |
Output is correct |
4 |
Correct |
23 ms |
1972 KB |
Output is correct |
5 |
Correct |
59 ms |
1852 KB |
Output is correct |
6 |
Correct |
23 ms |
1824 KB |
Output is correct |
7 |
Correct |
26 ms |
1884 KB |
Output is correct |
8 |
Correct |
55 ms |
1740 KB |
Output is correct |
# |
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 |
4 ms |
336 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 |
- |