Submission #824337

#TimeUsernameProblemLanguageResultExecution timeMemory
824337petezaIntercastellar (JOI22_ho_t1)C++14
100 / 100
60 ms5560 KiB
#include <bits/stdc++.h> using namespace std; int n, q; long long x, cidx = 1; vector<pair<long long, long long>> vec; int main() { cin.tie(0) -> sync_with_stdio(0); cin >> n; while(n--) { cin >> x; vec.emplace_back(cidx, (x >> __builtin_ctz(x))); cidx += (x&-x); } cin >> q; while(q--) { cin >> x; auto it = --upper_bound(vec.begin(), vec.end(), pair<long long, long long>(x, LLONG_MAX)); cout << it->second << '\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...