eolymp
bolt
Try our new interface for solving problems
Məsələlər

Böyük bitləri kəsməli

dərc olunub 12.02.24 14:26:34

include <bits/stdc++.h>

using namespace std;

typedef long long ll; typedef long double ld;

void solve() {

int n,k;
cin >> n >> k;
int ans = (1<<k-1);

cout << (n&ans) << '\n';

}

int main() { iosbase::syncwith_stdio(false), cin.tie(NULL), cout.tie(NULL); solve();

return 0;

}

dərc olunub 16.02.24 07:18:34

include <bits/stdc++.h>

using namespace std; int main () { int k,n,ans; cin>>n>>k; n&=(1<<k)-1; cout<<n; }