제출 #1154018

#제출 시각아이디문제언어결과실행 시간메모리
1154018dnnndaIntercastellar (JOI22_ho_t1)C++20
100 / 100
45 ms6224 KiB
#include<bits/stdc++.h> using namespace std; #define S second #define F first #define ll long long //#pragma GCC optimize("Ofast, unroll-loop") //#pragma GCC target("avx,avx2") #pragma GCC optimize("O3") const int inf=0x3f3f3f3f; const ll inff=0x3f3f3f3f3f3f3f3f; const int X=998244353; ll lb(ll x){ return x&(-x); } int a[200005]; ll pre[200005]; signed main(){ ios::sync_with_stdio(0), cin.tie(0); int n; cin >> n; for(int i=1 ; i<=n ; i++) cin >> a[i]; for(int i=1 ; i<=n ; i++){ pre[i]=pre[i-1]+lb(a[i]); } int q; cin >> q; while(q--){ ll t; cin >> t; int pos=0; for(int jump=n ; jump ; jump>>=1){ while(jump+pos<=n&&pre[jump+pos]<t) pos+=jump; } pos++; cout << (a[pos]/lb(a[pos])) << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...