8000 Create 1057_1.cpp · dostiny/basic-algo-lecture@cc985a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit cc985a2

Browse files
author
Haneul Kim
authored
Create 1057_1.cpp
1 parent 7f075a4 commit cc985a2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

0x12/solutions/1057_1.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Authored by : haneulkimdev
2+
// Co-authored by : -
3+
// http://boj.kr/ad7d6ee177654e6dbc83931bc7265b7a
4+
#include <bits/stdc++.h>
5+
using namespace std;
6+
7+
int main(void) {
8+
ios::sync_with_stdio(0);
9+
cin.tie(0);
10+
int n, a, b;
11+
cin >> n >> a >> b;
12+
int ans = 0;
13+
while (a != b) {
14+
a = (a + 1) / 2;
15+
b = (b + 1) / 2;
16+
ans++;
17+
}
18+
cout << ans;
19+
}

0 commit comments

Comments
 (0)
0