Solution:
2 1 / 1 in 2
3 1 / 1 in 2
4 2 / 1 in 4
5 1 / 1 in 4
6 3 / 1 in 4
7 1 / 1 in 4
8 4 / 1 in 8
9 3 / 1 in 8
10 5 / 1 in 8
11 1
12 6
13 1
14 7
15 5
16 8
17 1
18 9
19 1
20 10
- #include<bits/stdc++.h>
- #define int long long
- #define oo LLONG_MAX
- #define FOR(i, a, b) for(int i=a; i<=b; i++)
- using namespace std;
- const int N= 1000111;
- int t, n;
- int a[N];
- void solve(){
- cin >> n;
- int x= 0;
- while(pow(2, x) <= n){
- x++;
- }
- cout<<(int)pow(2,x-1)<<"\n";
- }
- int32_t main(){
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cin >> t;
- while(t--){
- solve();
- }
No comments:
Post a Comment