답안 #532178

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
532178 2022-03-02T09:08:31 Z nicky4321 Intercastellar (JOI22_ho_t1) C++14
100 / 100
77 ms 7696 KB
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define F first
#define S second
#define PB push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pdd pair<double, double>
#define ALL(x) x.begin(), x.end()
#define vi vector<int>
#define CASE int t; cin >> t; for(int ca=1;ca<=t;ca++)
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int MAX = 1 << 20, MOD = 1e9 + 7;

void solve(){
	int n;
	cin >> n;
	vector<pii> v;
	for(int i = 0;i < n;i++){
		int a, t;
		cin >> a;
		t = a;
		while(t % 2 == 0){
			t /= 2;
		}
		v.PB({t, a / t});
	}
	int q;
	cin >> q;
	ll now = 0, sum = v[0].S;
	while(q--){
		ll x;
		cin >> x;
		while(sum < x){
			now++;
			sum += v[now].S;
		}
		cout << v[now].F << '\n';
	}
}

int main(){
    IOS
    solve();
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 18 ms 2996 KB Output is correct
4 Correct 26 ms 2028 KB Output is correct
5 Correct 47 ms 4048 KB Output is correct
6 Correct 26 ms 3016 KB Output is correct
7 Correct 49 ms 4196 KB Output is correct
8 Correct 45 ms 4088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 308 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 1 ms 332 KB Output is correct
8 Correct 1 ms 324 KB Output is correct
9 Correct 1 ms 308 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 332 KB Output is correct
12 Correct 1 ms 332 KB Output is correct
13 Correct 1 ms 332 KB Output is correct
14 Correct 1 ms 328 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 18 ms 2996 KB Output is correct
4 Correct 26 ms 2028 KB Output is correct
5 Correct 47 ms 4048 KB Output is correct
6 Correct 26 ms 3016 KB Output is correct
7 Correct 49 ms 4196 KB Output is correct
8 Correct 45 ms 4088 KB Output is correct
9 Correct 1 ms 308 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 332 KB Output is correct
15 Correct 1 ms 332 KB Output is correct
16 Correct 1 ms 324 KB Output is correct
17 Correct 1 ms 308 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 332 KB Output is correct
20 Correct 1 ms 332 KB Output is correct
21 Correct 1 ms 332 KB Output is correct
22 Correct 1 ms 328 KB Output is correct
23 Correct 25 ms 2912 KB Output is correct
24 Correct 35 ms 4148 KB Output is correct
25 Correct 60 ms 7224 KB Output is correct
26 Correct 43 ms 4656 KB Output is correct
27 Correct 51 ms 4524 KB Output is correct
28 Correct 73 ms 7696 KB Output is correct
29 Correct 77 ms 7204 KB Output is correct
30 Correct 37 ms 3628 KB Output is correct
31 Correct 74 ms 7608 KB Output is correct