| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1239132 | ebrambill | Intercastellar (JOI22_ho_t1) | C++20 | 264 ms | 5384 KiB |
//In the name of GOD
#include <bits/stdc++.h>
using namespace std;
const long long maxN=2e5+5;
long long n, q, a[maxN], ps[maxN];
int main(){
cin >>n;
for (long long i=1; i<=n; i++){
cin >>a[i];
ps[i]=ps[i-1]+(1<<__builtin_ctz(a[i]));
}
cin >>q;
while(q--){
long long x;
cin >>x;
long long l=0, r=n;
while(r-l>1){
long long mid=(r+l)>>1;
if(ps[mid]>=x) r=mid;
else l=mid;
}
cout <<(a[r]>>__builtin_ctz(a[r])) <<'\n';
}
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
