제출 #534072

#제출 시각아이디문제언어결과실행 시간메모리
534072PixelCatIntercastellar (JOI22_ho_t1)C++14
100 / 100
83 ms5356 KiB
#include <bits/stdc++.h> #define For(i,a,b) for(int i=a;i<=b;i++) #define Forr(i,a,b) for(int i=a;i>=b;i--) #define F first #define S second #define sz(x) ((int)x.size()) #define all(x) x.begin(),x.end() #define eb emplace_back #define INF (ll)(9e18) #define int LL using namespace std; using LL=long long; using pii=pair<int,int>; int x[200020]; int s[200020]; int32_t main(){ ios::sync_with_stdio(false); cin.tie(0); // OAO int n; cin>>n; For(i,1,n){ int t; cin>>t; int c=1; while((~t)&1){ t>>=1; c<<=1; } s[i]=s[i-1]+c; x[i]=t; } int q; cin>>q; while(q--){ int t; cin>>t; auto it=lower_bound(s,s+n+1,t)-s; cout<<x[it]<<"\n"; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...