# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
799671 |
2023-07-31T18:48:56 Z |
josiftepe |
Exam (eJOI20_exam) |
C++14 |
|
2 ms |
576 KB |
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <stack>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 10;
int n;
int a[maxn], b[maxn];
void solve_subtask2() {
int x = b[0];
int res = 0;
for(int i = 0; i < n; i++) {
if(a[i] == x) {
int j = i - 1;
while(j >= 0 and a[j] <= x) {
j--;
res++;
}
j = i + 1;
while(j < n and a[j] <= x) {
res++;
j++;
}
i = j - 1;
}
}
cout << res << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin >> n;
set<int> st;
for(int i = 0; i < n; i++) {
cin >> a[i];
}
for(int i = 0; i < n; i++) {
cin >> b[i];
st.insert(b[i]);
}
if((int) st.size() == 1) {
solve_subtask2();
return 0;
}
return 0;
}
# |
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 |
344 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 |
2 ms |
576 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 |
- |