-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnumbering_to_map.cpp
More file actions
71 lines (49 loc) · 941 Bytes
/
numbering_to_map.cpp
File metadata and controls
71 lines (49 loc) · 941 Bytes
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
70
71
#include <iostream>
#include <vector>
using namespace std;
void dfs(struct numbering pos);
struct numbering{
int xpos;
int ypos;
};
int n;
int map[25][25];
int count;
vector<int> count_array;
int main(void){
int i, j;
cin >> n;
/*
for(i = 0; i < n; i++){
for(j = 0; j < n; j++){
cin >> map[i][j];
}
}
*/
struct numbering pos;
pos.xpos = 1;
pos.ypos = 1;
dfs(pos);
return 0;
}
void dfs(struct numbering pos){
if(pos.xpos == n-1 && pos.ypos == n-1){
return;
}
if( map[pos.ypos][pos.xpos] == 1){
}
map[pos.ypos][pos.xpos] = -1;
//move right
if(map[pos.ypos][pos.xpos+1] == 1){
}
//move left
//move up
//move down
}
/*
for(i = 0; i < n; i++){
for(j = 0; j < n; j++){
cout << " ij " << i << j << " " << map[i][j] << endl;
}
}
*/