0% found this document useful (0 votes)
7 views2 pages

Zadanie 100pkt

Uploaded by

Hunger
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Zadanie 100pkt

Uploaded by

Hunger
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <bits/stdc++.

h>
using namespace std;
int tab[]

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n, m, x, mini = INT_MAX;

for(int i = 0; i < n; i++)


{
cin >> tab[i];
tab[i] =
}

return 0;
}

#include <bits/stdc++.h>
using namespace std;
int tab[300010];
int tab2[300010];

int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);

int n, m, x, mini;
cin >> n >> m;

for(int i = 0; i < n; i++)


{
cin >> tab[i];
tab[i] =
}
cin >> n >> m;
for(int i=0; i<n; i++)
{
cin >> tab[i];
}
cout << '\n';
int ile=1000000008;
for(int i=0; i<n; i++)
{
tab[i]=min(ile, tab[i]);
ile=min(tab[i], ile);
//cout << i << ' ' << tab[i] << endl;
}
//return 0;
int p, k, sr, kon=n;
for(int i=0; i<m; i++)
{
cin >> a;
p=0;
k=kon-1;
//cout << "TAB: " << tab[0] << endl;
//cout << "I: " << i << endl;
while(p<k)
{
//cout << p << ' ' << k << endl;
sr=(p+k+1)/2;
//cout << "SR: " << sr << ' ' << tab[sr] << endl;
if(tab[sr]<a)
{
k=sr-1;
}
else
{
p=sr;
}
}
//cout << p << ' ' << k << endl;
//cout << p << ' ';
if(p==0)
{
if(a>tab[0])
{
p--;
}
}
if(p==-1)
{
cout << 0;
return 0;
}
kon=p;
if(p==0)
{
cout << 0;
return 0;
}
//cout << p+1 << endl;
}
cout << kon+1;
}

You might also like