Skip to content

Commit 38762bf

Browse files
committed
atcoder/abc076B
1 parent 0578db8 commit 38762bf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

atcoder/abc076/B/main.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
using ll = long long;
5+
6+
int solve(int N, int K) {
7+
int v = 1;
8+
for (int i = 0; i < N; ++i) {
9+
int nv1 = v * 2, nv2 = v + K;
10+
v = min(nv1, nv2);
11+
}
12+
return v;
13+
}
14+
15+
int main() {
16+
ios_base::sync_with_stdio(false);
17+
cin.tie(0); cout.tie(0);
18+
19+
int N, K;
20+
cin >> N >> K;
21+
cout << solve(N, K) << endl;
22+
23+
return 0;
24+
}

0 commit comments

Comments
 (0)