# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
534073 | LittleOrange | Intercastellar (JOI22_ho_t1) | C++17 | 72 ms | 6836 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ios::sync_with_stdio(0);cin.tie(0);
int n;
cin >> n;
vector<ll> a(n,0);
for (int i = 0;i<n;i++){
cin >> a[i];
}
vector<pair<ll,ll> > dat(n+1);
dat[0] = {0,0};
for (int i = 0;i<n;i++){
ll v = a[i];
ll c = 1;
while (v&1^1){
v>>=1;
c<<=1;
}
dat[i+1] = {dat[i].first+c,v};
}
int q;
cin >> q;
while (q--){
ll x;
cin >> x;
cout << (*lower_bound(dat.begin(),dat.end(),make_pair(x,0LL))).second << "\n";
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |