제출 #1166019

#제출 시각아이디문제언어결과실행 시간메모리
1166019novemnotesIntercastellar (JOI22_ho_t1)C++20
25 / 100
750 ms589824 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long

int n;
vector<int> ans;

void solve(int x){
	if(x%2==1)ans.push_back(x);
	else for(int i=0;i<2;i++)solve(x/2);
}

int32_t main(){
	cin.tie(nullptr)->sync_with_stdio(false);
	cin >> n;
	while(n--){
		int x;cin >> x;
		solve(x);
	}
	int q;cin >> q;
	while(q--){
		int x;cin >> x;
		x--;
		cout << ans[x] << "\n";
	}
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...