| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1267649 | Sofiatpc | Intercastellar (JOI22_ho_t1) | C++20 | 52 ms | 6980 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 time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
