Submission #932470

#TimeUsernameProblemLanguageResultExecution timeMemory
932470koukirocksIntercastellar (JOI22_ho_t1)C++17
100 / 100
60 ms9276 KiB
#include <bits/stdc++.h> #define speed ios_base::sync_with_stdio(0); cin.tie(0) #define all(x) (x).begin(),(x).end() using namespace std; typedef long long ll; typedef long double ldb; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const ll MAX=2e5+10,P=998244353; const ll INF=0x3f3f3f3f,oo=0x3f3f3f3f3f3f3f3f; int n,q; ll a[MAX]; ll pre[MAX]; int main() { speed; cin>>n; pre[0]=0; for (int i=1;i<=n;i++) { cin>>a[i]; ll num=0; while (a[i]%2==0) { a[i]/=2; num++; } pre[i]=pre[i-1]+(1ll<<num); } cin>>q; while (q--) { ll x; cin>>x; int id=lower_bound(pre+1,pre+n+1,x)-pre; cout<<a[id]<<"\n"; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...