답안 #1026223

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1026223 2024-07-17T17:53:41 Z overwatch9 Intercastellar (JOI22_ho_t1) C++17
100 / 100
87 ms 10924 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    vector <ll> a(n+1);
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    vector <ll> pfx(n+1);
    vector <ll> val(n+1);
    ll cnt = 0;
    for (int i = 1; i <= n; i++) {
        ll tp = 1;
        ll tp2 = a[i];
        while (tp2 % 2 == 0) {
            tp *= 2;
            tp2 /= 2;
        }
        cnt += tp;
        pfx[i] = cnt;
        val[i] = tp2;
    }
    int q;
    cin >> q;
    while (q--) {
        ll x;
        cin >> x;
        auto it = lower_bound(pfx.begin(), pfx.end(), x) - pfx.begin();
        cout << val[it] << '\n';
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 14 ms 4984 KB Output is correct
4 Correct 19 ms 2908 KB Output is correct
5 Correct 35 ms 7252 KB Output is correct
6 Correct 21 ms 5468 KB Output is correct
7 Correct 42 ms 7140 KB Output is correct
8 Correct 35 ms 7252 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 14 ms 4984 KB Output is correct
4 Correct 19 ms 2908 KB Output is correct
5 Correct 35 ms 7252 KB Output is correct
6 Correct 21 ms 5468 KB Output is correct
7 Correct 42 ms 7140 KB Output is correct
8 Correct 35 ms 7252 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 19 ms 3276 KB Output is correct
24 Correct 25 ms 6488 KB Output is correct
25 Correct 46 ms 10396 KB Output is correct
26 Correct 40 ms 6484 KB Output is correct
27 Correct 28 ms 6748 KB Output is correct
28 Correct 69 ms 10924 KB Output is correct
29 Correct 87 ms 10328 KB Output is correct
30 Correct 27 ms 3924 KB Output is correct
31 Correct 59 ms 10836 KB Output is correct