Pagini recente » Cod sursa (job #1274558) | Cod sursa (job #1039848) | Cod sursa (job #1368925) | Cod sursa (job #174630) | Cod sursa (job #1130565)
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<cstring>
#include<set>
#include<map>
using namespace std ;
#define maxn 100005
int N ;
int v[maxn] ;
int Q ;
int main()
{
std::ios_base::sync_with_stdio(false) ;
freopen("cautbin.in", "r", stdin);
freopen("cautbin.out", "w", stdout);
cin >> N ;
for(int i = 1; i <= N; ++i )
cin >> v[i] ;
sort( v + 1, v + N + 1 ) ;
cin >> Q ;
/*while( Q-- )
{
int op, x ;
cin >> op >> x ;
if( op == 0 )
{
int sol = upper_bound( v + 1, v + N + 1, x ) - v - 1 ;
if( sol <= N && sol >= 1 && v[sol] == x )
cout << sol << "\n" ;
else
cout << "-1\n" ;
}
if( op == 1 )
{
int sol = lower_bound( v + 1, v + N + 1, x + 1 ) - v - 1 ;
cout << sol << "\n" ;
}
if( op == 2 )
{
int sol = upper_bound( v + 1, v + N + 1, x - 1 ) - v ;
cout << sol << "\n" ;
}
}
*/
return 0 ;
}