# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
468051 |
2021-08-26T09:03:05 Z |
Stickfish |
Exam (eJOI20_exam) |
C++17 |
|
56 ms |
1920 KB |
#include <iostream>
#include <set>
using namespace std;
const int MAXN = 1e5 + 123;
int a[MAXN];
int b[MAXN];
void solve_2(int n){
int cnt = 0;
bool isneeded = false;
int ans = 0;
for(int i = 0; i < n; ++i){
if(a[i] == b[0]){
isneeded = true;
}
if(a[i] > b[0]){
if(isneeded)
ans += cnt;
isneeded = false;
cnt = 0;
} else {
++cnt;
}
}
cout << ans + cnt << endl;
}
void solve_4(int n){
}
void solve_slow(int n){
}
signed main(){
int n;
cin >> n;
for(int i = 0; i < n; ++i)
cin >> a[i];
for(int i = 0; i < n; ++i)
cin >> b[i];
bool sub2 = true;
for(int i = 0; i < n; ++i){
if(b[i] != b[0])
sub2 = false;
}
if(sub2){
solve_2(n);
return 0;
}
bool sub4 = true;
set<int> st;
for(int i = 0; i < n; ++i){
if(st.find(a[i]) != st.end())
sub4 = false;
st.insert(a[i]);
}
if(sub4){
return 0;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
19 ms |
836 KB |
Output is correct |
3 |
Correct |
56 ms |
1920 KB |
Output is correct |
4 |
Incorrect |
38 ms |
1364 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
560 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |