제출 #1267649

#제출 시각아이디문제언어결과실행 시간메모리
1267649SofiatpcIntercastellar (JOI22_ho_t1)C++20
100 / 100
52 ms6980 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int MAXN = 2*1e5+5; int a[MAXN], qtd[MAXN], sum[MAXN]; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; cin>>n; for(int i = 1; i <= n; i++){ cin>>a[i]; int x = a[i]; qtd[i] = 1; while((x&1) == 0){ qtd[i] = qtd[i]<<1; x = x>>1; } sum[i] = sum[i-1]+qtd[i]; } int q; cin>>q; while(q--){ int x; cin>>x; int id = lower_bound(sum+1,sum+1+n, x)-sum; cout<<a[id]/qtd[id]<<"\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...