| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 789410 | Andrey | Intercastellar (JOI22_ho_t1) | C++14 | 65 ms | 9384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long n,q,a,l,r,m;
cin >> n;
vector<long long> pr(1);
vector<long long> haha(0);
for(long long i = 0; i < n; i++) {
cin >> a;
pr.push_back(1);
while(a%2 == 0) {
a/=2;
pr[i+1]*=2;
}
haha.push_back(a);
}
for(long long i = 1; i <= n; i++) {
pr[i]+=pr[i-1];
}
cin >> q;
for(long long i = 0; i < q; i++) {
cin >> a;
l = 0;
r = n;
while(l < r) {
m = (l+r)/2;
if(pr[m] >= a) {
r = m;
}
else {
l = m+1;
}
}
cout << haha[l-1] << "\n";
}
return 0;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
