Submission #1277089

#TimeUsernameProblemLanguageResultExecution timeMemory
1277089khoavn2008Intercastellar (JOI22_ho_t1)C++20
100 / 100
41 ms4560 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld double #define FOR(i,l,r) for(ll i = (l), _r = (r); i <= _r; i++) #define FORNG(i,r,l) for(ll i = (r), _l = (l); i >= _l; i--) #define REP(i,r) for(ll i = 0, _r = (r); i < _r; i++) #define endl '\n' #define fi first #define se second #define pb push_back #define size(v) ((ll)(v).size()) #define all(v) (v).begin(),(v).end() #define MASK(x) (1LL << (x)) #define BIT(x,i) (((x) >> (i)) & 1) const ll MOD = 1e9 + 7, N = 2e5 + 10, INF = 1e18, LOG = 21; ll n,a[N]; int main(){ ios_base::sync_with_stdio(0);cin.tie(0); cin>>n; FOR(i,1,n)cin>>a[i]; ll cur = 0, j = 0; ll q;cin>>q; while(q--){ ll x;cin>>x; while(cur < x)++j,cur += MASK(__builtin_ctzll(a[j])); cout<<a[j] / MASK(__builtin_ctzll(a[j]))<<endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...