제출 #1196393

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

int main()
{
    cin.tie(nullptr); ios::sync_with_stdio(false);

    int n;
    cin >> n;

    vector<long long> a(n);
    for(int i=0; i<n; i++)
    {
        cin >> a[i];
    }

    vll nn;
    
    for(int i=0; i<n; i++)
    {
        int x = a[i];
        int count = 1;
        while(x %2 == 0)
        {
            x/=2;
            count++;
        }
        for(int j=0; j<a[i]/x; j++)
        {
            nn.push_back(x);
        }
    }

    // for(auto &a: nn)
    // {
    //     cout << a << " ";
    // }
    // cout << "   ";

    int q;
    cin >> q;

    while(q--)
    {
        int qi;
        cin >> qi;

        cout << nn[qi-1] << '\n';
    }

    return (0);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...