# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
133803 | tdwn | Kralj (COCI16_kralj) | C++17 | 1095 ms | 19184 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int maxn = 500100;
int n, a[maxn], d[maxn], s[maxn];
int main() {
cin>>n;
for(int i=1;i<=n;i++) {
cin>>a[i];
}
for(int i=1;i<=n;i++) {
cin>>d[i];
}
for(int i=1;i<=n;i++) {
cin>>s[i];
}
sort(d, d+n);
sort(s, s+n);
int br = 0;
int i=1, j=1;
while(i <=n && j<=n) {
if(s[j] > d[i]) {
br++;
j++;
i++;
}
else if(s[j] <= d[i]) {
j++;
}
}
cout<<br<<"\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |