-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBOJ12851.cpp
69 lines (69 loc) · 1.36 KB
/
BOJ12851.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
////
//// Created by 전형진 on 2019-04-02.
////
//
////
//// Created by 전형진 on 2019-04-02.
////
//
//#include <stdio.h>
//#include <queue>
//#include <vector>
//
//int arr[100001];
//bool c[100001];
//using namespace std;
//int n,k,cnt;
//int mins = 999999;
//
//
//void bfs(int n, int k){
// int counts = 0;
// int dx[] = {1,-1};
// queue<int> q;
//
// q.push(n);
//
//
// while(!q.empty()){
// int qs=q.size();
// while(qs--) {
// int x = q.front();
// c[x] = true;
// q.pop();
// if (x == k){
// if(counts <=mins){
// mins = counts;
// cnt++;
// }
// else
// return;
//
// }
// int nx;
// for (int i = 0; i < 3; i++) {
// if (i < 2) {
// nx = x + dx[i];
// }
// else {
// nx = 2 * x;
// }
// if(nx >= 0 && nx<=100000) {
// if (!c[nx]) {
// q.push(nx);
// }
// }
// }
// }
// counts++;
//
// }
//}
//int main(){
// scanf("%d %d",&n,&k);
// arr[n] = n;
// arr[k] = k;
// bfs(arr[n],arr[k]);
// printf("%d\n",mins);
// printf("%d",cnt);
//}