We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0b6edc commit 252e7ecCopy full SHA for 252e7ec
1840B - Binary Cafe.cpp
@@ -0,0 +1,26 @@
1
+// ॐ नमः शिवाय
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+#define ll long long
5
+
6
+// Code Written By: Vikash Patel
7
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8
9
+int solve(int n, int k)
10
+{
11
+ if(log2(n) < k)
12
+ return n+1;
13
+ return (int)pow(2, k);
14
+}
15
+int main()
16
17
+ int t;
18
+ cin>>t;
19
+ while(t--)
20
+ {
21
+ int n, k;
22
+ cin>>n>>k;
23
+ cout<<solve(n, k)<<endl;
24
+ }
25
+ return 0;
26
0 commit comments