Submission #640699

#TimeUsernameProblemLanguageResultExecution timeMemory
640699ck_platypusIntercastellar (JOI22_ho_t1)C++14
100 / 100
308 ms5612 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...