Submission #941063

#TimeUsernameProblemLanguageResultExecution timeMemory
941063PringIntercastellar (JOI22_ho_t1)C++17
25 / 100
351 ms524288 KiB
#include <bits/stdc++.h>
using namespace std;

#ifdef MIKU
const string dbmc = "\033[1;38;2;57;197;187m", dbrs = "\033[0m";
#define debug(x...) cout << dbmc << "[" << #x << "]: ", dout(x)
void dout() { cout << dbrs << endl; }
template <typename T, typename ...U>
void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); }
#else
#define dout(...) 39
#endif

#define int long long
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
typedef pair<int, int> pii;

const int MXN = 200005;
int n, q, a;
vector<int> v;

void PUT(int x) {
    int y = 1;
    while (x % 2 == 0) {
        x /= 2;
        y *= 2;
    }
    while (y--) v.push_back(x);
}

void miku() {
    cin >> n;
    while (n--) {
        cin >> a;
        PUT(a);
    }
    cin >> q;
    while (q--) {
        cin >> a;
        cout << v[--a] << '\n';
    }
}

int32_t main() {
    cin.tie(0) -> sync_with_stdio(false);
    cin.exceptions(cin.failbit);
    miku();
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...