Submission #928218

# Submission time Handle Problem Language Result Execution time Memory
928218 2024-02-16T05:06:43 Z pcc Intercastellar (JOI22_ho_t1) C++17
100 / 100
64 ms 9920 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pll pair<ll,ll>
#define fs first
#define sc second

ll N,Q;
vector<pll> v;

int main(){
	ios::sync_with_stdio(0);cin.tie(0);
	cin>>N;
	for(int i = 0;i<N;i++){
		ll k;
		cin>>k;
		ll c = 1;
		while(k%2 == 0)k>>=1,c<<=1;
		v.push_back({c,k});
	}
	for(int i = 1;i<v.size();i++)v[i].fs += v[i-1].fs;
	cin>>Q;
	while(Q--){
		ll pos;
		cin>>pos;
		pll tmp = make_pair(pos,-1);
		cout<<(lower_bound(v.begin(),v.end(),tmp)->sc)<<'\n';
	}
	return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:22:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |  for(int i = 1;i<v.size();i++)v[i].fs += v[i-1].fs;
      |                ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 18 ms 6612 KB Output is correct
4 Correct 25 ms 2516 KB Output is correct
5 Correct 45 ms 6320 KB Output is correct
6 Correct 25 ms 5588 KB Output is correct
7 Correct 43 ms 6356 KB Output is correct
8 Correct 42 ms 6096 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 456 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 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 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 18 ms 6612 KB Output is correct
4 Correct 25 ms 2516 KB Output is correct
5 Correct 45 ms 6320 KB Output is correct
6 Correct 25 ms 5588 KB Output is correct
7 Correct 43 ms 6356 KB Output is correct
8 Correct 42 ms 6096 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 456 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 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 468 KB Output is correct
23 Correct 23 ms 3224 KB Output is correct
24 Correct 28 ms 6988 KB Output is correct
25 Correct 61 ms 9228 KB Output is correct
26 Correct 35 ms 5632 KB Output is correct
27 Correct 37 ms 6612 KB Output is correct
28 Correct 60 ms 9664 KB Output is correct
29 Correct 58 ms 8968 KB Output is correct
30 Correct 34 ms 4084 KB Output is correct
31 Correct 64 ms 9920 KB Output is correct