質問編集履歴
5
ソースコードの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -15,103 +15,10 @@
|
|
15
15
|
for(;jdg_t_c[times]<first[times]+gl_del_count_c[times];jdg_t_c[times]++)
|
16
16
|
|
17
17
|
for(;jdg_t_c[times]-first[times]<4;jdg_t_c[times]++)
|
18
|
-
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
19
|
-
int othello_AI(int n){
|
20
|
-
|
21
|
-
static int jdg_t_c[10]={0};//for添字
|
22
|
-
static int first[10]={0};//for添字
|
23
|
-
static int times=0;//for添字
|
24
|
-
int count=0,counta=0, countb=0, countc=0, countd=0, counte=0, tmp;//for添字 tmpは並び替えの時に一時的に入れておくための変数。
|
25
|
-
static int k[10][100]={{0},{0}};//for添字
|
26
|
-
static int jdg_GUIDE_num[10][1000]={{0},{0}};//for 次の手のGUIDEの数
|
27
|
-
static int jdg_minmax_dual_num[10][1000]={{0},{0}};//for jdg_GUIDE_numの最大最小を入れておく。
|
28
|
-
int jdg_est_num[10][1000]={{0},{0}};//for 各timesでのjdg_minmax_numの組み合わせを入れる。
|
29
|
-
int jdg_total_dual_count[10]={0};
|
30
|
-
static int jdg_minmax_num[10][100][1000]={{0},{0},{0}};//for 最小最大の被った数の保持する。
|
31
|
-
static int gl_del_count_c[10]={0};//for gl_del_countのコピー
|
32
|
-
static int gl__x_c[10][40],gl__y_c[10][40];//for gl__x,gl__yのコピー
|
33
|
-
static int jdg_count[10]={0};//for添字→ 関数の出入りの1かたまりの数をそれぞれ記録する。グループ分けとしての変数。
|
34
18
|
|
35
|
-
static int c1_mas[SIZE][SIZE]={
|
36
|
-
{1,1,1,1,1,1,1,1,1,1},
|
37
|
-
{1,0,0,0,0,0,0,0,0,1},
|
38
|
-
{1,0,0,0,0,0,0,0,0,1},
|
39
|
-
{1,0,0,0,0,0,0,0,0,1},
|
40
|
-
{1,0,0,0,0,0,0,0,0,1},
|
41
|
-
{1,0,0,0,0,0,0,0,0,1},
|
42
|
-
{1,0,0,0,0,0,0,0,0,1},
|
43
|
-
{1,0,0,0,0,0,0,0,0,1},
|
44
|
-
{1,0,0,0,0,0,0,0,0,1},
|
45
|
-
{1,1,1,1,1,1,1,1,1,1},
|
46
|
-
};
|
47
|
-
static int c2_mas[SIZE][SIZE]={
|
48
|
-
{1,1,1,1,1,1,1,1,1,1},
|
49
|
-
{1,0,0,0,0,0,0,0,0,1},
|
50
|
-
{1,0,0,0,0,0,0,0,0,1},
|
51
|
-
{1,0,0,0,0,0,0,0,0,1},
|
52
|
-
{1,0,0,0,0,0,0,0,0,1},
|
53
|
-
{1,0,0,0,0,0,0,0,0,1},
|
54
|
-
{1,0,0,0,0,0,0,0,0,1},
|
55
|
-
{1,0,0,0,0,0,0,0,0,1},
|
56
|
-
{1,0,0,0,0,0,0,0,0,1},
|
57
|
-
{1,1,1,1,1,1,1,1,1,1},
|
58
|
-
};
|
59
19
|
|
60
|
-
first[times]=jdg_t_c[times];
|
61
|
-
|
62
|
-
//for mas[SIZE][SIZE]のコピー
|
63
|
-
othello_mas_c(c1_mas, c2_mas, times);
|
64
|
-
//gl_del_countにGUIDEの個数をコピーするため。times==0の時はすでにもう入っている。
|
65
|
-
switch(times){
|
66
|
-
case 0:
|
67
|
-
break;
|
68
|
-
default:
|
69
|
-
del();
|
70
|
-
break;
|
71
|
-
}
|
72
|
-
//for mas[SIZE][SIZE]にコピーし直す。
|
73
|
-
othello_mas_c_r(c1_mas, c2_mas, times);
|
74
|
-
//for gl_del_count_cにgl_del_countをコピー
|
75
|
-
othello_gl_del_count_c(gl_del_count_c, times);
|
76
|
-
//for gl__x[],gl__y[]の座標のコピー これを行うには事前にdel()を呼び、gl_del_countにGUIDEの個数を入れておかなければならない。
|
77
|
-
othello_gl__xy_c(gl__x_c, gl__y_c, times);
|
78
|
-
|
79
|
-
|
80
|
-
if(n%2==0){
|
81
|
-
|
82
|
-
for(;jdg_t_c[times]-first[times]<gl_del_count_c[times];jdg_t_c[times]++){
|
83
|
-
printf("&w");
|
84
|
-
switch(mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]){
|
85
|
-
case GUIDE:
|
86
|
-
printf("&w+");
|
87
|
-
gl_x=gl__x_c[times][k[times][jdg_count[times]]];
|
88
|
-
gl_y=gl__y_c[times][k[times][jdg_count[times]]];
|
89
|
-
|
90
|
-
othello_gl_del_count_c_r(gl_del_count_c, times);
|
91
|
-
othello_gl__xy_c_r(gl__x_c, gl__y_c, times);
|
92
|
-
del();
|
93
|
-
mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]=WHITE;
|
94
|
-
|
95
|
-
jdg_GUIDE_num[times][jdg_t_c[times]]=10000*jdg_t_c[times]+100*jdg_count[times]+put1(n+1);
|
96
|
-
|
97
|
-
if(times<2){
|
98
|
-
times++;
|
99
|
-
othello_AI(n+1);
|
100
|
-
times--;
|
101
|
-
}
|
102
|
-
|
103
|
-
othello_mas_c_r(c1_mas, c2_mas, times);
|
104
|
-
|
105
|
-
break;
|
106
|
-
}
|
107
|
-
k[times][jdg_count[times]]++;
|
108
|
-
}
|
109
|
-
|
110
|
-
}
|
111
|
-
else{...
|
112
|
-
|
113
20
|
```
|
114
|
-
```
|
21
|
+
```c
|
115
22
|
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
116
23
|
int othello_AI(int n){
|
117
24
|
|
4
ソースコードの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -15,10 +15,200 @@
|
|
15
15
|
for(;jdg_t_c[times]<first[times]+gl_del_count_c[times];jdg_t_c[times]++)
|
16
16
|
|
17
17
|
for(;jdg_t_c[times]-first[times]<4;jdg_t_c[times]++)
|
18
|
+
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
19
|
+
int othello_AI(int n){
|
20
|
+
|
21
|
+
static int jdg_t_c[10]={0};//for添字
|
22
|
+
static int first[10]={0};//for添字
|
23
|
+
static int times=0;//for添字
|
24
|
+
int count=0,counta=0, countb=0, countc=0, countd=0, counte=0, tmp;//for添字 tmpは並び替えの時に一時的に入れておくための変数。
|
25
|
+
static int k[10][100]={{0},{0}};//for添字
|
26
|
+
static int jdg_GUIDE_num[10][1000]={{0},{0}};//for 次の手のGUIDEの数
|
27
|
+
static int jdg_minmax_dual_num[10][1000]={{0},{0}};//for jdg_GUIDE_numの最大最小を入れておく。
|
28
|
+
int jdg_est_num[10][1000]={{0},{0}};//for 各timesでのjdg_minmax_numの組み合わせを入れる。
|
29
|
+
int jdg_total_dual_count[10]={0};
|
30
|
+
static int jdg_minmax_num[10][100][1000]={{0},{0},{0}};//for 最小最大の被った数の保持する。
|
31
|
+
static int gl_del_count_c[10]={0};//for gl_del_countのコピー
|
32
|
+
static int gl__x_c[10][40],gl__y_c[10][40];//for gl__x,gl__yのコピー
|
33
|
+
static int jdg_count[10]={0};//for添字→ 関数の出入りの1かたまりの数をそれぞれ記録する。グループ分けとしての変数。
|
18
34
|
|
35
|
+
static int c1_mas[SIZE][SIZE]={
|
36
|
+
{1,1,1,1,1,1,1,1,1,1},
|
37
|
+
{1,0,0,0,0,0,0,0,0,1},
|
38
|
+
{1,0,0,0,0,0,0,0,0,1},
|
39
|
+
{1,0,0,0,0,0,0,0,0,1},
|
40
|
+
{1,0,0,0,0,0,0,0,0,1},
|
41
|
+
{1,0,0,0,0,0,0,0,0,1},
|
42
|
+
{1,0,0,0,0,0,0,0,0,1},
|
43
|
+
{1,0,0,0,0,0,0,0,0,1},
|
44
|
+
{1,0,0,0,0,0,0,0,0,1},
|
45
|
+
{1,1,1,1,1,1,1,1,1,1},
|
46
|
+
};
|
47
|
+
static int c2_mas[SIZE][SIZE]={
|
48
|
+
{1,1,1,1,1,1,1,1,1,1},
|
49
|
+
{1,0,0,0,0,0,0,0,0,1},
|
50
|
+
{1,0,0,0,0,0,0,0,0,1},
|
51
|
+
{1,0,0,0,0,0,0,0,0,1},
|
52
|
+
{1,0,0,0,0,0,0,0,0,1},
|
53
|
+
{1,0,0,0,0,0,0,0,0,1},
|
54
|
+
{1,0,0,0,0,0,0,0,0,1},
|
55
|
+
{1,0,0,0,0,0,0,0,0,1},
|
56
|
+
{1,0,0,0,0,0,0,0,0,1},
|
57
|
+
{1,1,1,1,1,1,1,1,1,1},
|
58
|
+
};
|
19
59
|
|
60
|
+
first[times]=jdg_t_c[times];
|
61
|
+
|
62
|
+
//for mas[SIZE][SIZE]のコピー
|
63
|
+
othello_mas_c(c1_mas, c2_mas, times);
|
64
|
+
//gl_del_countにGUIDEの個数をコピーするため。times==0の時はすでにもう入っている。
|
65
|
+
switch(times){
|
66
|
+
case 0:
|
67
|
+
break;
|
68
|
+
default:
|
69
|
+
del();
|
70
|
+
break;
|
71
|
+
}
|
72
|
+
//for mas[SIZE][SIZE]にコピーし直す。
|
73
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
74
|
+
//for gl_del_count_cにgl_del_countをコピー
|
75
|
+
othello_gl_del_count_c(gl_del_count_c, times);
|
76
|
+
//for gl__x[],gl__y[]の座標のコピー これを行うには事前にdel()を呼び、gl_del_countにGUIDEの個数を入れておかなければならない。
|
77
|
+
othello_gl__xy_c(gl__x_c, gl__y_c, times);
|
78
|
+
|
79
|
+
|
80
|
+
if(n%2==0){
|
81
|
+
|
82
|
+
for(;jdg_t_c[times]-first[times]<gl_del_count_c[times];jdg_t_c[times]++){
|
83
|
+
printf("&w");
|
84
|
+
switch(mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]){
|
85
|
+
case GUIDE:
|
86
|
+
printf("&w+");
|
87
|
+
gl_x=gl__x_c[times][k[times][jdg_count[times]]];
|
88
|
+
gl_y=gl__y_c[times][k[times][jdg_count[times]]];
|
89
|
+
|
90
|
+
othello_gl_del_count_c_r(gl_del_count_c, times);
|
91
|
+
othello_gl__xy_c_r(gl__x_c, gl__y_c, times);
|
92
|
+
del();
|
93
|
+
mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]=WHITE;
|
94
|
+
|
95
|
+
jdg_GUIDE_num[times][jdg_t_c[times]]=10000*jdg_t_c[times]+100*jdg_count[times]+put1(n+1);
|
96
|
+
|
97
|
+
if(times<2){
|
98
|
+
times++;
|
99
|
+
othello_AI(n+1);
|
100
|
+
times--;
|
101
|
+
}
|
102
|
+
|
103
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
104
|
+
|
105
|
+
break;
|
106
|
+
}
|
107
|
+
k[times][jdg_count[times]]++;
|
108
|
+
}
|
109
|
+
|
110
|
+
}
|
111
|
+
else{...
|
112
|
+
|
20
113
|
```
|
114
|
+
```
|
115
|
+
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
116
|
+
int othello_AI(int n){
|
117
|
+
|
118
|
+
static int jdg_t_c[10]={0};//for添字
|
119
|
+
static int first[10]={0};//for添字
|
120
|
+
static int times=0;//for添字
|
121
|
+
int count=0,counta=0, countb=0, countc=0, countd=0, counte=0, tmp;//for添字 tmpは並び替えの時に一時的に入れておくための変数。
|
122
|
+
static int k[10][100]={{0},{0}};//for添字
|
123
|
+
static int jdg_GUIDE_num[10][1000]={{0},{0}};//for 次の手のGUIDEの数
|
124
|
+
static int jdg_minmax_dual_num[10][1000]={{0},{0}};//for jdg_GUIDE_numの最大最小を入れておく。
|
125
|
+
int jdg_est_num[10][1000]={{0},{0}};//for 各timesでのjdg_minmax_numの組み合わせを入れる。
|
126
|
+
int jdg_total_dual_count[10]={0};
|
127
|
+
static int jdg_minmax_num[10][100][1000]={{0},{0},{0}};//for 最小最大の被った数の保持する。
|
128
|
+
static int gl_del_count_c[10]={0};//for gl_del_countのコピー
|
129
|
+
static int gl__x_c[10][40],gl__y_c[10][40];//for gl__x,gl__yのコピー
|
130
|
+
static int jdg_count[10]={0};//for添字→ 関数の出入りの1かたまりの数をそれぞれ記録する。グループ分けとしての変数。
|
21
131
|
|
132
|
+
static int c1_mas[SIZE][SIZE]={
|
133
|
+
{1,1,1,1,1,1,1,1,1,1},
|
134
|
+
{1,0,0,0,0,0,0,0,0,1},
|
135
|
+
{1,0,0,0,0,0,0,0,0,1},
|
136
|
+
{1,0,0,0,0,0,0,0,0,1},
|
137
|
+
{1,0,0,0,0,0,0,0,0,1},
|
138
|
+
{1,0,0,0,0,0,0,0,0,1},
|
139
|
+
{1,0,0,0,0,0,0,0,0,1},
|
140
|
+
{1,0,0,0,0,0,0,0,0,1},
|
141
|
+
{1,0,0,0,0,0,0,0,0,1},
|
142
|
+
{1,1,1,1,1,1,1,1,1,1},
|
143
|
+
};
|
144
|
+
static int c2_mas[SIZE][SIZE]={
|
145
|
+
{1,1,1,1,1,1,1,1,1,1},
|
146
|
+
{1,0,0,0,0,0,0,0,0,1},
|
147
|
+
{1,0,0,0,0,0,0,0,0,1},
|
148
|
+
{1,0,0,0,0,0,0,0,0,1},
|
149
|
+
{1,0,0,0,0,0,0,0,0,1},
|
150
|
+
{1,0,0,0,0,0,0,0,0,1},
|
151
|
+
{1,0,0,0,0,0,0,0,0,1},
|
152
|
+
{1,0,0,0,0,0,0,0,0,1},
|
153
|
+
{1,0,0,0,0,0,0,0,0,1},
|
154
|
+
{1,1,1,1,1,1,1,1,1,1},
|
155
|
+
};
|
156
|
+
|
157
|
+
first[times]=jdg_t_c[times];
|
158
|
+
|
159
|
+
//for mas[SIZE][SIZE]のコピー
|
160
|
+
othello_mas_c(c1_mas, c2_mas, times);
|
161
|
+
//gl_del_countにGUIDEの個数をコピーするため。times==0の時はすでにもう入っている。
|
162
|
+
switch(times){
|
163
|
+
case 0:
|
164
|
+
break;
|
165
|
+
default:
|
166
|
+
del();
|
167
|
+
break;
|
168
|
+
}
|
169
|
+
//for mas[SIZE][SIZE]にコピーし直す。
|
170
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
171
|
+
//for gl_del_count_cにgl_del_countをコピー
|
172
|
+
othello_gl_del_count_c(gl_del_count_c, times);
|
173
|
+
//for gl__x[],gl__y[]の座標のコピー これを行うには事前にdel()を呼び、gl_del_countにGUIDEの個数を入れておかなければならない。
|
174
|
+
othello_gl__xy_c(gl__x_c, gl__y_c, times);
|
175
|
+
|
176
|
+
|
177
|
+
if(n%2==0){
|
178
|
+
|
179
|
+
for(;jdg_t_c[times]-first[times]<gl_del_count_c[times];jdg_t_c[times]++){
|
180
|
+
printf("&w");
|
181
|
+
switch(mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]){
|
182
|
+
case GUIDE:
|
183
|
+
printf("&w+");
|
184
|
+
gl_x=gl__x_c[times][k[times][jdg_count[times]]];
|
185
|
+
gl_y=gl__y_c[times][k[times][jdg_count[times]]];
|
186
|
+
|
187
|
+
othello_gl_del_count_c_r(gl_del_count_c, times);
|
188
|
+
othello_gl__xy_c_r(gl__x_c, gl__y_c, times);
|
189
|
+
del();
|
190
|
+
mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]=WHITE;
|
191
|
+
|
192
|
+
jdg_GUIDE_num[times][jdg_t_c[times]]=10000*jdg_t_c[times]+100*jdg_count[times]+put1(n+1);
|
193
|
+
|
194
|
+
if(times<2){
|
195
|
+
times++;
|
196
|
+
othello_AI(n+1);
|
197
|
+
times--;
|
198
|
+
}
|
199
|
+
|
200
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
201
|
+
|
202
|
+
break;
|
203
|
+
}
|
204
|
+
k[times][jdg_count[times]]++;
|
205
|
+
}
|
206
|
+
|
207
|
+
}
|
208
|
+
else{...
|
209
|
+
```
|
210
|
+
|
211
|
+
|
22
212
|
### 試したこと
|
23
213
|
どの配列もstatic int型で、定義の時点で、全てに0を格納しており、上記の場合も、条件を満たすように何かしらの整数が入っています。
|
24
214
|
|
3
ソースコードの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -16,100 +16,7 @@
|
|
16
16
|
|
17
17
|
for(;jdg_t_c[times]-first[times]<4;jdg_t_c[times]++)
|
18
18
|
|
19
|
-
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
20
|
-
int othello_AI(int n){
|
21
|
-
|
22
|
-
static int jdg_t_c[10]={0};//for添字
|
23
|
-
static int first[10]={0};//for添字
|
24
|
-
static int times=0;//for添字
|
25
|
-
int count=0,counta=0, countb=0, countc=0, countd=0, counte=0, tmp;//for添字 tmpは並び替えの時に一時的に入れておくための変数。
|
26
|
-
static int k[10][100]={{0},{0}};//for添字
|
27
|
-
static int jdg_GUIDE_num[10][1000]={{0},{0}};//for 次の手のGUIDEの数
|
28
|
-
static int jdg_minmax_dual_num[10][1000]={{0},{0}};//for jdg_GUIDE_numの最大最小を入れておく。
|
29
|
-
int jdg_est_num[10][1000]={{0},{0}};//for 各timesでのjdg_minmax_numの組み合わせを入れる。
|
30
|
-
int jdg_total_dual_count[10]={0};
|
31
|
-
static int jdg_minmax_num[10][100][1000]={{0},{0},{0}};//for 最小最大の被った数の保持する。
|
32
|
-
static int gl_del_count_c[10]={0};//for gl_del_countのコピー
|
33
|
-
static int gl__x_c[10][40],gl__y_c[10][40];//for gl__x,gl__yのコピー
|
34
|
-
static int jdg_count[10]={0};//for添字→ 関数の出入りの1かたまりの数をそれぞれ記録する。グループ分けとしての変数。
|
35
19
|
|
36
|
-
static int c1_mas[SIZE][SIZE]={
|
37
|
-
{1,1,1,1,1,1,1,1,1,1},
|
38
|
-
{1,0,0,0,0,0,0,0,0,1},
|
39
|
-
{1,0,0,0,0,0,0,0,0,1},
|
40
|
-
{1,0,0,0,0,0,0,0,0,1},
|
41
|
-
{1,0,0,0,0,0,0,0,0,1},
|
42
|
-
{1,0,0,0,0,0,0,0,0,1},
|
43
|
-
{1,0,0,0,0,0,0,0,0,1},
|
44
|
-
{1,0,0,0,0,0,0,0,0,1},
|
45
|
-
{1,0,0,0,0,0,0,0,0,1},
|
46
|
-
{1,1,1,1,1,1,1,1,1,1},
|
47
|
-
};
|
48
|
-
static int c2_mas[SIZE][SIZE]={
|
49
|
-
{1,1,1,1,1,1,1,1,1,1},
|
50
|
-
{1,0,0,0,0,0,0,0,0,1},
|
51
|
-
{1,0,0,0,0,0,0,0,0,1},
|
52
|
-
{1,0,0,0,0,0,0,0,0,1},
|
53
|
-
{1,0,0,0,0,0,0,0,0,1},
|
54
|
-
{1,0,0,0,0,0,0,0,0,1},
|
55
|
-
{1,0,0,0,0,0,0,0,0,1},
|
56
|
-
{1,0,0,0,0,0,0,0,0,1},
|
57
|
-
{1,0,0,0,0,0,0,0,0,1},
|
58
|
-
{1,1,1,1,1,1,1,1,1,1},
|
59
|
-
};
|
60
|
-
|
61
|
-
first[times]=jdg_t_c[times];
|
62
|
-
|
63
|
-
//for mas[SIZE][SIZE]のコピー
|
64
|
-
othello_mas_c(c1_mas, c2_mas, times);
|
65
|
-
//gl_del_countにGUIDEの個数をコピーするため。times==0の時はすでにもう入っている。
|
66
|
-
switch(times){
|
67
|
-
case 0:
|
68
|
-
break;
|
69
|
-
default:
|
70
|
-
del();
|
71
|
-
break;
|
72
|
-
}
|
73
|
-
//for mas[SIZE][SIZE]にコピーし直す。
|
74
|
-
othello_mas_c_r(c1_mas, c2_mas, times);
|
75
|
-
//for gl_del_count_cにgl_del_countをコピー
|
76
|
-
othello_gl_del_count_c(gl_del_count_c, times);
|
77
|
-
//for gl__x[],gl__y[]の座標のコピー これを行うには事前にdel()を呼び、gl_del_countにGUIDEの個数を入れておかなければならない。
|
78
|
-
othello_gl__xy_c(gl__x_c, gl__y_c, times);
|
79
|
-
|
80
|
-
|
81
|
-
if(n%2==0){
|
82
|
-
|
83
|
-
for(;jdg_t_c[times]-first[times]<gl_del_count_c[times];jdg_t_c[times]++){
|
84
|
-
printf("&w");
|
85
|
-
switch(mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]){
|
86
|
-
case GUIDE:
|
87
|
-
printf("&w+");
|
88
|
-
gl_x=gl__x_c[times][k[times][jdg_count[times]]];
|
89
|
-
gl_y=gl__y_c[times][k[times][jdg_count[times]]];
|
90
|
-
|
91
|
-
othello_gl_del_count_c_r(gl_del_count_c, times);
|
92
|
-
othello_gl__xy_c_r(gl__x_c, gl__y_c, times);
|
93
|
-
del();
|
94
|
-
mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]=WHITE;
|
95
|
-
|
96
|
-
jdg_GUIDE_num[times][jdg_t_c[times]]=10000*jdg_t_c[times]+100*jdg_count[times]+put1(n+1);
|
97
|
-
|
98
|
-
if(times<2){
|
99
|
-
times++;
|
100
|
-
othello_AI(n+1);
|
101
|
-
times--;
|
102
|
-
}
|
103
|
-
|
104
|
-
othello_mas_c_r(c1_mas, c2_mas, times);
|
105
|
-
|
106
|
-
break;
|
107
|
-
}
|
108
|
-
k[times][jdg_count[times]]++;
|
109
|
-
}
|
110
|
-
|
111
|
-
}
|
112
|
-
else{...
|
113
20
|
```
|
114
21
|
|
115
22
|
### 試したこと
|
2
ソースコードの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -15,6 +15,101 @@
|
|
15
15
|
for(;jdg_t_c[times]<first[times]+gl_del_count_c[times];jdg_t_c[times]++)
|
16
16
|
|
17
17
|
for(;jdg_t_c[times]-first[times]<4;jdg_t_c[times]++)
|
18
|
+
|
19
|
+
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
20
|
+
int othello_AI(int n){
|
21
|
+
|
22
|
+
static int jdg_t_c[10]={0};//for添字
|
23
|
+
static int first[10]={0};//for添字
|
24
|
+
static int times=0;//for添字
|
25
|
+
int count=0,counta=0, countb=0, countc=0, countd=0, counte=0, tmp;//for添字 tmpは並び替えの時に一時的に入れておくための変数。
|
26
|
+
static int k[10][100]={{0},{0}};//for添字
|
27
|
+
static int jdg_GUIDE_num[10][1000]={{0},{0}};//for 次の手のGUIDEの数
|
28
|
+
static int jdg_minmax_dual_num[10][1000]={{0},{0}};//for jdg_GUIDE_numの最大最小を入れておく。
|
29
|
+
int jdg_est_num[10][1000]={{0},{0}};//for 各timesでのjdg_minmax_numの組み合わせを入れる。
|
30
|
+
int jdg_total_dual_count[10]={0};
|
31
|
+
static int jdg_minmax_num[10][100][1000]={{0},{0},{0}};//for 最小最大の被った数の保持する。
|
32
|
+
static int gl_del_count_c[10]={0};//for gl_del_countのコピー
|
33
|
+
static int gl__x_c[10][40],gl__y_c[10][40];//for gl__x,gl__yのコピー
|
34
|
+
static int jdg_count[10]={0};//for添字→ 関数の出入りの1かたまりの数をそれぞれ記録する。グループ分けとしての変数。
|
35
|
+
|
36
|
+
static int c1_mas[SIZE][SIZE]={
|
37
|
+
{1,1,1,1,1,1,1,1,1,1},
|
38
|
+
{1,0,0,0,0,0,0,0,0,1},
|
39
|
+
{1,0,0,0,0,0,0,0,0,1},
|
40
|
+
{1,0,0,0,0,0,0,0,0,1},
|
41
|
+
{1,0,0,0,0,0,0,0,0,1},
|
42
|
+
{1,0,0,0,0,0,0,0,0,1},
|
43
|
+
{1,0,0,0,0,0,0,0,0,1},
|
44
|
+
{1,0,0,0,0,0,0,0,0,1},
|
45
|
+
{1,0,0,0,0,0,0,0,0,1},
|
46
|
+
{1,1,1,1,1,1,1,1,1,1},
|
47
|
+
};
|
48
|
+
static int c2_mas[SIZE][SIZE]={
|
49
|
+
{1,1,1,1,1,1,1,1,1,1},
|
50
|
+
{1,0,0,0,0,0,0,0,0,1},
|
51
|
+
{1,0,0,0,0,0,0,0,0,1},
|
52
|
+
{1,0,0,0,0,0,0,0,0,1},
|
53
|
+
{1,0,0,0,0,0,0,0,0,1},
|
54
|
+
{1,0,0,0,0,0,0,0,0,1},
|
55
|
+
{1,0,0,0,0,0,0,0,0,1},
|
56
|
+
{1,0,0,0,0,0,0,0,0,1},
|
57
|
+
{1,0,0,0,0,0,0,0,0,1},
|
58
|
+
{1,1,1,1,1,1,1,1,1,1},
|
59
|
+
};
|
60
|
+
|
61
|
+
first[times]=jdg_t_c[times];
|
62
|
+
|
63
|
+
//for mas[SIZE][SIZE]のコピー
|
64
|
+
othello_mas_c(c1_mas, c2_mas, times);
|
65
|
+
//gl_del_countにGUIDEの個数をコピーするため。times==0の時はすでにもう入っている。
|
66
|
+
switch(times){
|
67
|
+
case 0:
|
68
|
+
break;
|
69
|
+
default:
|
70
|
+
del();
|
71
|
+
break;
|
72
|
+
}
|
73
|
+
//for mas[SIZE][SIZE]にコピーし直す。
|
74
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
75
|
+
//for gl_del_count_cにgl_del_countをコピー
|
76
|
+
othello_gl_del_count_c(gl_del_count_c, times);
|
77
|
+
//for gl__x[],gl__y[]の座標のコピー これを行うには事前にdel()を呼び、gl_del_countにGUIDEの個数を入れておかなければならない。
|
78
|
+
othello_gl__xy_c(gl__x_c, gl__y_c, times);
|
79
|
+
|
80
|
+
|
81
|
+
if(n%2==0){
|
82
|
+
|
83
|
+
for(;jdg_t_c[times]-first[times]<gl_del_count_c[times];jdg_t_c[times]++){
|
84
|
+
printf("&w");
|
85
|
+
switch(mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]){
|
86
|
+
case GUIDE:
|
87
|
+
printf("&w+");
|
88
|
+
gl_x=gl__x_c[times][k[times][jdg_count[times]]];
|
89
|
+
gl_y=gl__y_c[times][k[times][jdg_count[times]]];
|
90
|
+
|
91
|
+
othello_gl_del_count_c_r(gl_del_count_c, times);
|
92
|
+
othello_gl__xy_c_r(gl__x_c, gl__y_c, times);
|
93
|
+
del();
|
94
|
+
mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]=WHITE;
|
95
|
+
|
96
|
+
jdg_GUIDE_num[times][jdg_t_c[times]]=10000*jdg_t_c[times]+100*jdg_count[times]+put1(n+1);
|
97
|
+
|
98
|
+
if(times<2){
|
99
|
+
times++;
|
100
|
+
othello_AI(n+1);
|
101
|
+
times--;
|
102
|
+
}
|
103
|
+
|
104
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
105
|
+
|
106
|
+
break;
|
107
|
+
}
|
108
|
+
k[times][jdg_count[times]]++;
|
109
|
+
}
|
110
|
+
|
111
|
+
}
|
112
|
+
else{...
|
18
113
|
```
|
19
114
|
|
20
115
|
### 試したこと
|
1
タイトルの補足
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
Bus errorの原因を知りたい
|
1
|
+
Bus error:10の原因を知りたい
|
body
CHANGED
File without changes
|