# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
373963 |
2021-03-06T09:58:34 Z |
FEDIKUS |
Exam (eJOI20_exam) |
C++17 |
|
88 ms |
3308 KB |
#include <bits/stdc++.h>
#define xx first
#define yy second
using namespace std;
typedef pair<int,int> pii;
int main()
{
int n;
cin>>n;
vector<pii> niz(n);
int maxi=0;
int mini=INT_MAX;
for(int i=0;i<n;i++) cin>>niz[i].xx;
for(int i=0;i<n;i++) cin>>niz[i].yy,mini=min(mini,niz[i].yy),maxi=max(maxi,niz[i].yy);
if(mini==maxi){
int ima=false;
int res=0;
int koliko=0;
for(int i=0;i<n;i++){
if(niz[i].yy<niz[i].xx) res+=(ima ? koliko:0),ima=false,koliko=0;
if(niz[i].yy<niz[i].xx) continue;
koliko++;
if(niz[i].yy==niz[i].xx) ima=true;
}
res+=(ima ? koliko:0);
cout<<res;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
17 ms |
876 KB |
Output is correct |
3 |
Correct |
53 ms |
2028 KB |
Output is correct |
4 |
Correct |
34 ms |
1516 KB |
Output is correct |
5 |
Correct |
88 ms |
3308 KB |
Output is correct |
6 |
Correct |
37 ms |
1516 KB |
Output is correct |
7 |
Correct |
40 ms |
1644 KB |
Output is correct |
8 |
Correct |
85 ms |
3052 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
492 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |