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 <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <utility>
#include <bitset>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <queue>
#include <cstring>
#include <fstream>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define pll pair<ll, ll>
#define pii pair<int, int>
#define f first
#define s second
#define inf 1000000000000000
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
ll n;
cin >> n;
ll a,cnt=0, arr[n];
vector<ll> v;
for(int i=0;i<n;i++){
cin >> arr[i];
cnt+=arr[i]&-arr[i];
arr[i]/=arr[i]&-arr[i];
v.pb(cnt);
}
ll q;
cin >> q;
while(q--){
cin >> a;
cout << arr[lower_bound(v.begin(), v.end(), a)-v.begin()] << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |