# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
576592 |
2022-06-13T08:26:14 Z |
Jassar |
Exam (eJOI20_exam) |
C++14 |
|
22 ms |
1200 KB |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
bool h[100010];
int main()
{
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int n;
cin >> n;
int a[n],b[n];
for (int i=0; n>i; i++)
{
cin >> a[i];
}
int cnt = 0;
for (int i=0; n>i; i++)
{
cin >> b[i];
if (b[i] == a[i] && h[i] == 0)
{
int j=i;
int y=i;
for (; j>=0; j--)
{
if (a[j] > a[i])
{
break;
}
h[j] = 1;
}
for (; n>y; y++)
{
if (a[y] > a[i])
{
break;
}
h[y] = 1;
}
y--;
cnt += y - j;
}
}
cout << cnt << endl;
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 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
4 ms |
468 KB |
Output is correct |
3 |
Correct |
13 ms |
1028 KB |
Output is correct |
4 |
Correct |
10 ms |
1200 KB |
Output is correct |
5 |
Correct |
22 ms |
1200 KB |
Output is correct |
6 |
Correct |
10 ms |
1124 KB |
Output is correct |
7 |
Correct |
11 ms |
1108 KB |
Output is correct |
8 |
Correct |
19 ms |
1108 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 |
2 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 |
- |