# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
833562 |
2023-08-22T06:51:47 Z |
vjudge1 |
Exam (eJOI20_exam) |
C++17 |
|
18 ms |
3028 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MX = 1e5 + 5;
int N;
int H[MX], T[MX];
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
cin >> N;
for(int i = 1; i <= N; i++) cin >> H[i];
for(int i = 1; i <= N; i++) cin >> T[i];
int ans = 0;
for(int i = 1; i <= N; i++) {
if(H[i] > T[1]) continue;
int j = i;
bool hv = H[i] == T[1];
while(j + 1 <= N && H[j + 1] <= T[1]) {
j++;
hv |= H[j] == T[1];
}
if(hv) {
ans += j - i + 1;
i = j;
}
}
cout << ans << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
4 ms |
844 KB |
Output is correct |
3 |
Correct |
18 ms |
2004 KB |
Output is correct |
4 |
Correct |
8 ms |
1492 KB |
Output is correct |
5 |
Correct |
17 ms |
3028 KB |
Output is correct |
6 |
Correct |
9 ms |
1492 KB |
Output is correct |
7 |
Correct |
9 ms |
1620 KB |
Output is correct |
8 |
Correct |
17 ms |
3008 KB |
Output is correct |
# |
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 |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |