# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
576512 |
2022-06-13T07:04:02 Z |
MrM7md |
Exam (eJOI20_exam) |
C++17 |
|
2 ms |
340 KB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
const int MOD = 1e9 + 7;
pair<int,int> a[10000000];
signed 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;i<n;i++)cin >> a[i];
for(int i=0;i<n;i++)cin >> b[i];
int ans=0,num=b[0];
int cur=0;
bool bl=0;
for(int i=0;i<n;i++){
if(a[i]>num){
if(bl){
ans+=cur;
cur=0;
}
bl=0;
}
if(a[i]==num){
cur++;
bl=1;
}
if(a[i]<num){
cur++;
}
}
if(bl)ans+=cur;
cout<<ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
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 |
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 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |