답안 #532384

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
532384 2022-03-02T20:04:08 Z Marceantasy Intercastellar (JOI22_ho_t1) C++17
100 / 100
451 ms 9204 KB
#include <bits/stdc++.h>
using namespace std; 

#define ll long long 
#define ar array

const int mxN = 2e5+5, M = 1e9+7;
int n, q; 
pair<ll, ll> a[mxN];

int main(){
    cin >> n; 
    for(int i = 0; i<n; ++i){
        ll num; 
        cin >> num;  
        ll cnt = 1; 
        while(num % 2 == 0){
            num /= 2; 
            cnt *= 2;
        }
        a[i] = make_pair(num, cnt);
    }
    cin >> q;
    ll flag = 0;
    int idx = 0; 
    while(q--){
        ll x;
        cin >> x;
        while(idx < n && flag + a[idx].second < x){
            flag += a[idx++].second;
        }
        cout << a[idx].first << "\n";
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 83 ms 3980 KB Output is correct
4 Correct 230 ms 2324 KB Output is correct
5 Correct 320 ms 5460 KB Output is correct
6 Correct 173 ms 4200 KB Output is correct
7 Correct 333 ms 5440 KB Output is correct
8 Correct 326 ms 5568 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 3 ms 332 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 3 ms 332 KB Output is correct
12 Correct 2 ms 332 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 2 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 83 ms 3980 KB Output is correct
4 Correct 230 ms 2324 KB Output is correct
5 Correct 320 ms 5460 KB Output is correct
6 Correct 173 ms 4200 KB Output is correct
7 Correct 333 ms 5440 KB Output is correct
8 Correct 326 ms 5568 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 0 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 3 ms 332 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 3 ms 332 KB Output is correct
20 Correct 2 ms 332 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 2 ms 332 KB Output is correct
23 Correct 212 ms 2980 KB Output is correct
24 Correct 182 ms 5192 KB Output is correct
25 Correct 381 ms 8680 KB Output is correct
26 Correct 240 ms 5436 KB Output is correct
27 Correct 198 ms 5428 KB Output is correct
28 Correct 451 ms 9204 KB Output is correct
29 Correct 425 ms 8828 KB Output is correct
30 Correct 279 ms 3652 KB Output is correct
31 Correct 432 ms 9028 KB Output is correct