Submission #708833

# Submission time Handle Problem Language Result Execution time Memory
708833 2023-03-12T12:35:00 Z sofija6 Intercastellar (JOI22_ho_t1) C++14
100 / 100
77 ms 9384 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<ll> pref,val;
int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    ll n,a,q,x;
    cin >> n;
    for (ll i=1;i<=n;i++)
    {
        cin >> a;
        ll cnt=1;
        while (!(a&1))
        {
            a >>= 1;
            cnt <<= 1;
        }
        if (pref.empty())
            pref.push_back(cnt);
        else
            pref.push_back(pref[pref.size()-1]+cnt);
        val.push_back(a);
    }
    cin >> q;
    while (q--)
    {
        cin >> x;
        auto it=lower_bound(pref.begin(),pref.end(),x);
        cout << val[it-pref.begin()] << "\n";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 21 ms 4136 KB Output is correct
4 Correct 30 ms 2504 KB Output is correct
5 Correct 48 ms 5776 KB Output is correct
6 Correct 30 ms 4272 KB Output is correct
7 Correct 52 ms 5664 KB Output is correct
8 Correct 51 ms 5852 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 320 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 21 ms 4136 KB Output is correct
4 Correct 30 ms 2504 KB Output is correct
5 Correct 48 ms 5776 KB Output is correct
6 Correct 30 ms 4272 KB Output is correct
7 Correct 52 ms 5664 KB Output is correct
8 Correct 51 ms 5852 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 320 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 340 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 30 ms 3248 KB Output is correct
24 Correct 35 ms 5364 KB Output is correct
25 Correct 71 ms 8964 KB Output is correct
26 Correct 44 ms 5812 KB Output is correct
27 Correct 41 ms 5764 KB Output is correct
28 Correct 76 ms 9380 KB Output is correct
29 Correct 76 ms 8912 KB Output is correct
30 Correct 39 ms 3912 KB Output is correct
31 Correct 77 ms 9384 KB Output is correct