質問編集履歴
5
ソースコードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,6 +32,14 @@
|
|
32
32
|
|
33
33
|
for(;jdg_t_c[times]-first[times]<4;jdg_t_c[times]++)
|
34
34
|
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
```
|
40
|
+
|
41
|
+
```c
|
42
|
+
|
35
43
|
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
36
44
|
|
37
45
|
int othello_AI(int n){
|
@@ -220,200 +228,6 @@
|
|
220
228
|
|
221
229
|
else{...
|
222
230
|
|
223
|
-
|
224
|
-
|
225
|
-
```
|
226
|
-
|
227
|
-
```
|
228
|
-
|
229
|
-
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
230
|
-
|
231
|
-
int othello_AI(int n){
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
static int jdg_t_c[10]={0};//for添字
|
236
|
-
|
237
|
-
static int first[10]={0};//for添字
|
238
|
-
|
239
|
-
static int times=0;//for添字
|
240
|
-
|
241
|
-
int count=0,counta=0, countb=0, countc=0, countd=0, counte=0, tmp;//for添字 tmpは並び替えの時に一時的に入れておくための変数。
|
242
|
-
|
243
|
-
static int k[10][100]={{0},{0}};//for添字
|
244
|
-
|
245
|
-
static int jdg_GUIDE_num[10][1000]={{0},{0}};//for 次の手のGUIDEの数
|
246
|
-
|
247
|
-
static int jdg_minmax_dual_num[10][1000]={{0},{0}};//for jdg_GUIDE_numの最大最小を入れておく。
|
248
|
-
|
249
|
-
int jdg_est_num[10][1000]={{0},{0}};//for 各timesでのjdg_minmax_numの組み合わせを入れる。
|
250
|
-
|
251
|
-
int jdg_total_dual_count[10]={0};
|
252
|
-
|
253
|
-
static int jdg_minmax_num[10][100][1000]={{0},{0},{0}};//for 最小最大の被った数の保持する。
|
254
|
-
|
255
|
-
static int gl_del_count_c[10]={0};//for gl_del_countのコピー
|
256
|
-
|
257
|
-
static int gl__x_c[10][40],gl__y_c[10][40];//for gl__x,gl__yのコピー
|
258
|
-
|
259
|
-
static int jdg_count[10]={0};//for添字→ 関数の出入りの1かたまりの数をそれぞれ記録する。グループ分けとしての変数。
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
static int c1_mas[SIZE][SIZE]={
|
264
|
-
|
265
|
-
{1,1,1,1,1,1,1,1,1,1},
|
266
|
-
|
267
|
-
{1,0,0,0,0,0,0,0,0,1},
|
268
|
-
|
269
|
-
{1,0,0,0,0,0,0,0,0,1},
|
270
|
-
|
271
|
-
{1,0,0,0,0,0,0,0,0,1},
|
272
|
-
|
273
|
-
{1,0,0,0,0,0,0,0,0,1},
|
274
|
-
|
275
|
-
{1,0,0,0,0,0,0,0,0,1},
|
276
|
-
|
277
|
-
{1,0,0,0,0,0,0,0,0,1},
|
278
|
-
|
279
|
-
{1,0,0,0,0,0,0,0,0,1},
|
280
|
-
|
281
|
-
{1,0,0,0,0,0,0,0,0,1},
|
282
|
-
|
283
|
-
{1,1,1,1,1,1,1,1,1,1},
|
284
|
-
|
285
|
-
};
|
286
|
-
|
287
|
-
static int c2_mas[SIZE][SIZE]={
|
288
|
-
|
289
|
-
{1,1,1,1,1,1,1,1,1,1},
|
290
|
-
|
291
|
-
{1,0,0,0,0,0,0,0,0,1},
|
292
|
-
|
293
|
-
{1,0,0,0,0,0,0,0,0,1},
|
294
|
-
|
295
|
-
{1,0,0,0,0,0,0,0,0,1},
|
296
|
-
|
297
|
-
{1,0,0,0,0,0,0,0,0,1},
|
298
|
-
|
299
|
-
{1,0,0,0,0,0,0,0,0,1},
|
300
|
-
|
301
|
-
{1,0,0,0,0,0,0,0,0,1},
|
302
|
-
|
303
|
-
{1,0,0,0,0,0,0,0,0,1},
|
304
|
-
|
305
|
-
{1,0,0,0,0,0,0,0,0,1},
|
306
|
-
|
307
|
-
{1,1,1,1,1,1,1,1,1,1},
|
308
|
-
|
309
|
-
};
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
first[times]=jdg_t_c[times];
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
//for mas[SIZE][SIZE]のコピー
|
318
|
-
|
319
|
-
othello_mas_c(c1_mas, c2_mas, times);
|
320
|
-
|
321
|
-
//gl_del_countにGUIDEの個数をコピーするため。times==0の時はすでにもう入っている。
|
322
|
-
|
323
|
-
switch(times){
|
324
|
-
|
325
|
-
case 0:
|
326
|
-
|
327
|
-
break;
|
328
|
-
|
329
|
-
default:
|
330
|
-
|
331
|
-
del();
|
332
|
-
|
333
|
-
break;
|
334
|
-
|
335
|
-
}
|
336
|
-
|
337
|
-
//for mas[SIZE][SIZE]にコピーし直す。
|
338
|
-
|
339
|
-
othello_mas_c_r(c1_mas, c2_mas, times);
|
340
|
-
|
341
|
-
//for gl_del_count_cにgl_del_countをコピー
|
342
|
-
|
343
|
-
othello_gl_del_count_c(gl_del_count_c, times);
|
344
|
-
|
345
|
-
//for gl__x[],gl__y[]の座標のコピー これを行うには事前にdel()を呼び、gl_del_countにGUIDEの個数を入れておかなければならない。
|
346
|
-
|
347
|
-
othello_gl__xy_c(gl__x_c, gl__y_c, times);
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
if(n%2==0){
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
for(;jdg_t_c[times]-first[times]<gl_del_count_c[times];jdg_t_c[times]++){
|
358
|
-
|
359
|
-
printf("&w");
|
360
|
-
|
361
|
-
switch(mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]){
|
362
|
-
|
363
|
-
case GUIDE:
|
364
|
-
|
365
|
-
printf("&w+");
|
366
|
-
|
367
|
-
gl_x=gl__x_c[times][k[times][jdg_count[times]]];
|
368
|
-
|
369
|
-
gl_y=gl__y_c[times][k[times][jdg_count[times]]];
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
othello_gl_del_count_c_r(gl_del_count_c, times);
|
374
|
-
|
375
|
-
othello_gl__xy_c_r(gl__x_c, gl__y_c, times);
|
376
|
-
|
377
|
-
del();
|
378
|
-
|
379
|
-
mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]=WHITE;
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
jdg_GUIDE_num[times][jdg_t_c[times]]=10000*jdg_t_c[times]+100*jdg_count[times]+put1(n+1);
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
if(times<2){
|
388
|
-
|
389
|
-
times++;
|
390
|
-
|
391
|
-
othello_AI(n+1);
|
392
|
-
|
393
|
-
times--;
|
394
|
-
|
395
|
-
}
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
othello_mas_c_r(c1_mas, c2_mas, times);
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
break;
|
404
|
-
|
405
|
-
}
|
406
|
-
|
407
|
-
k[times][jdg_count[times]]++;
|
408
|
-
|
409
|
-
}
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
}
|
414
|
-
|
415
|
-
else{...
|
416
|
-
|
417
231
|
```
|
418
232
|
|
419
233
|
|
4
ソースコードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,12 +32,392 @@
|
|
32
32
|
|
33
33
|
for(;jdg_t_c[times]-first[times]<4;jdg_t_c[times]++)
|
34
34
|
|
35
|
-
|
35
|
+
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
36
|
+
|
37
|
+
int othello_AI(int n){
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
static int jdg_t_c[10]={0};//for添字
|
42
|
+
|
43
|
+
static int first[10]={0};//for添字
|
44
|
+
|
45
|
+
static int times=0;//for添字
|
46
|
+
|
47
|
+
int count=0,counta=0, countb=0, countc=0, countd=0, counte=0, tmp;//for添字 tmpは並び替えの時に一時的に入れておくための変数。
|
48
|
+
|
49
|
+
static int k[10][100]={{0},{0}};//for添字
|
50
|
+
|
51
|
+
static int jdg_GUIDE_num[10][1000]={{0},{0}};//for 次の手のGUIDEの数
|
52
|
+
|
53
|
+
static int jdg_minmax_dual_num[10][1000]={{0},{0}};//for jdg_GUIDE_numの最大最小を入れておく。
|
54
|
+
|
55
|
+
int jdg_est_num[10][1000]={{0},{0}};//for 各timesでのjdg_minmax_numの組み合わせを入れる。
|
56
|
+
|
57
|
+
int jdg_total_dual_count[10]={0};
|
58
|
+
|
59
|
+
static int jdg_minmax_num[10][100][1000]={{0},{0},{0}};//for 最小最大の被った数の保持する。
|
60
|
+
|
61
|
+
static int gl_del_count_c[10]={0};//for gl_del_countのコピー
|
62
|
+
|
63
|
+
static int gl__x_c[10][40],gl__y_c[10][40];//for gl__x,gl__yのコピー
|
64
|
+
|
65
|
+
static int jdg_count[10]={0};//for添字→ 関数の出入りの1かたまりの数をそれぞれ記録する。グループ分けとしての変数。
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
static int c1_mas[SIZE][SIZE]={
|
70
|
+
|
71
|
+
{1,1,1,1,1,1,1,1,1,1},
|
72
|
+
|
73
|
+
{1,0,0,0,0,0,0,0,0,1},
|
74
|
+
|
75
|
+
{1,0,0,0,0,0,0,0,0,1},
|
76
|
+
|
77
|
+
{1,0,0,0,0,0,0,0,0,1},
|
78
|
+
|
79
|
+
{1,0,0,0,0,0,0,0,0,1},
|
80
|
+
|
81
|
+
{1,0,0,0,0,0,0,0,0,1},
|
82
|
+
|
83
|
+
{1,0,0,0,0,0,0,0,0,1},
|
84
|
+
|
85
|
+
{1,0,0,0,0,0,0,0,0,1},
|
86
|
+
|
87
|
+
{1,0,0,0,0,0,0,0,0,1},
|
88
|
+
|
89
|
+
{1,1,1,1,1,1,1,1,1,1},
|
90
|
+
|
91
|
+
};
|
92
|
+
|
93
|
+
static int c2_mas[SIZE][SIZE]={
|
94
|
+
|
95
|
+
{1,1,1,1,1,1,1,1,1,1},
|
96
|
+
|
97
|
+
{1,0,0,0,0,0,0,0,0,1},
|
98
|
+
|
99
|
+
{1,0,0,0,0,0,0,0,0,1},
|
100
|
+
|
101
|
+
{1,0,0,0,0,0,0,0,0,1},
|
102
|
+
|
103
|
+
{1,0,0,0,0,0,0,0,0,1},
|
104
|
+
|
105
|
+
{1,0,0,0,0,0,0,0,0,1},
|
106
|
+
|
107
|
+
{1,0,0,0,0,0,0,0,0,1},
|
108
|
+
|
109
|
+
{1,0,0,0,0,0,0,0,0,1},
|
110
|
+
|
111
|
+
{1,0,0,0,0,0,0,0,0,1},
|
112
|
+
|
113
|
+
{1,1,1,1,1,1,1,1,1,1},
|
114
|
+
|
115
|
+
};
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
first[times]=jdg_t_c[times];
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
//for mas[SIZE][SIZE]のコピー
|
124
|
+
|
125
|
+
othello_mas_c(c1_mas, c2_mas, times);
|
126
|
+
|
127
|
+
//gl_del_countにGUIDEの個数をコピーするため。times==0の時はすでにもう入っている。
|
128
|
+
|
129
|
+
switch(times){
|
130
|
+
|
131
|
+
case 0:
|
132
|
+
|
133
|
+
break;
|
134
|
+
|
135
|
+
default:
|
136
|
+
|
137
|
+
del();
|
138
|
+
|
139
|
+
break;
|
140
|
+
|
141
|
+
}
|
142
|
+
|
143
|
+
//for mas[SIZE][SIZE]にコピーし直す。
|
144
|
+
|
145
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
146
|
+
|
147
|
+
//for gl_del_count_cにgl_del_countをコピー
|
148
|
+
|
149
|
+
othello_gl_del_count_c(gl_del_count_c, times);
|
150
|
+
|
151
|
+
//for gl__x[],gl__y[]の座標のコピー これを行うには事前にdel()を呼び、gl_del_countにGUIDEの個数を入れておかなければならない。
|
152
|
+
|
153
|
+
othello_gl__xy_c(gl__x_c, gl__y_c, times);
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
if(n%2==0){
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
for(;jdg_t_c[times]-first[times]<gl_del_count_c[times];jdg_t_c[times]++){
|
164
|
+
|
165
|
+
printf("&w");
|
166
|
+
|
167
|
+
switch(mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]){
|
168
|
+
|
169
|
+
case GUIDE:
|
170
|
+
|
171
|
+
printf("&w+");
|
172
|
+
|
173
|
+
gl_x=gl__x_c[times][k[times][jdg_count[times]]];
|
174
|
+
|
175
|
+
gl_y=gl__y_c[times][k[times][jdg_count[times]]];
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
othello_gl_del_count_c_r(gl_del_count_c, times);
|
180
|
+
|
181
|
+
othello_gl__xy_c_r(gl__x_c, gl__y_c, times);
|
182
|
+
|
183
|
+
del();
|
184
|
+
|
185
|
+
mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]=WHITE;
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
jdg_GUIDE_num[times][jdg_t_c[times]]=10000*jdg_t_c[times]+100*jdg_count[times]+put1(n+1);
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
if(times<2){
|
194
|
+
|
195
|
+
times++;
|
196
|
+
|
197
|
+
othello_AI(n+1);
|
198
|
+
|
199
|
+
times--;
|
200
|
+
|
201
|
+
}
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
break;
|
210
|
+
|
211
|
+
}
|
212
|
+
|
213
|
+
k[times][jdg_count[times]]++;
|
214
|
+
|
215
|
+
}
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
}
|
220
|
+
|
221
|
+
else{...
|
36
222
|
|
37
223
|
|
38
224
|
|
39
225
|
```
|
40
226
|
|
227
|
+
```
|
228
|
+
|
229
|
+
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
230
|
+
|
231
|
+
int othello_AI(int n){
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
static int jdg_t_c[10]={0};//for添字
|
236
|
+
|
237
|
+
static int first[10]={0};//for添字
|
238
|
+
|
239
|
+
static int times=0;//for添字
|
240
|
+
|
241
|
+
int count=0,counta=0, countb=0, countc=0, countd=0, counte=0, tmp;//for添字 tmpは並び替えの時に一時的に入れておくための変数。
|
242
|
+
|
243
|
+
static int k[10][100]={{0},{0}};//for添字
|
244
|
+
|
245
|
+
static int jdg_GUIDE_num[10][1000]={{0},{0}};//for 次の手のGUIDEの数
|
246
|
+
|
247
|
+
static int jdg_minmax_dual_num[10][1000]={{0},{0}};//for jdg_GUIDE_numの最大最小を入れておく。
|
248
|
+
|
249
|
+
int jdg_est_num[10][1000]={{0},{0}};//for 各timesでのjdg_minmax_numの組み合わせを入れる。
|
250
|
+
|
251
|
+
int jdg_total_dual_count[10]={0};
|
252
|
+
|
253
|
+
static int jdg_minmax_num[10][100][1000]={{0},{0},{0}};//for 最小最大の被った数の保持する。
|
254
|
+
|
255
|
+
static int gl_del_count_c[10]={0};//for gl_del_countのコピー
|
256
|
+
|
257
|
+
static int gl__x_c[10][40],gl__y_c[10][40];//for gl__x,gl__yのコピー
|
258
|
+
|
259
|
+
static int jdg_count[10]={0};//for添字→ 関数の出入りの1かたまりの数をそれぞれ記録する。グループ分けとしての変数。
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
static int c1_mas[SIZE][SIZE]={
|
264
|
+
|
265
|
+
{1,1,1,1,1,1,1,1,1,1},
|
266
|
+
|
267
|
+
{1,0,0,0,0,0,0,0,0,1},
|
268
|
+
|
269
|
+
{1,0,0,0,0,0,0,0,0,1},
|
270
|
+
|
271
|
+
{1,0,0,0,0,0,0,0,0,1},
|
272
|
+
|
273
|
+
{1,0,0,0,0,0,0,0,0,1},
|
274
|
+
|
275
|
+
{1,0,0,0,0,0,0,0,0,1},
|
276
|
+
|
277
|
+
{1,0,0,0,0,0,0,0,0,1},
|
278
|
+
|
279
|
+
{1,0,0,0,0,0,0,0,0,1},
|
280
|
+
|
281
|
+
{1,0,0,0,0,0,0,0,0,1},
|
282
|
+
|
283
|
+
{1,1,1,1,1,1,1,1,1,1},
|
284
|
+
|
285
|
+
};
|
286
|
+
|
287
|
+
static int c2_mas[SIZE][SIZE]={
|
288
|
+
|
289
|
+
{1,1,1,1,1,1,1,1,1,1},
|
290
|
+
|
291
|
+
{1,0,0,0,0,0,0,0,0,1},
|
292
|
+
|
293
|
+
{1,0,0,0,0,0,0,0,0,1},
|
294
|
+
|
295
|
+
{1,0,0,0,0,0,0,0,0,1},
|
296
|
+
|
297
|
+
{1,0,0,0,0,0,0,0,0,1},
|
298
|
+
|
299
|
+
{1,0,0,0,0,0,0,0,0,1},
|
300
|
+
|
301
|
+
{1,0,0,0,0,0,0,0,0,1},
|
302
|
+
|
303
|
+
{1,0,0,0,0,0,0,0,0,1},
|
304
|
+
|
305
|
+
{1,0,0,0,0,0,0,0,0,1},
|
306
|
+
|
307
|
+
{1,1,1,1,1,1,1,1,1,1},
|
308
|
+
|
309
|
+
};
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
first[times]=jdg_t_c[times];
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
//for mas[SIZE][SIZE]のコピー
|
318
|
+
|
319
|
+
othello_mas_c(c1_mas, c2_mas, times);
|
320
|
+
|
321
|
+
//gl_del_countにGUIDEの個数をコピーするため。times==0の時はすでにもう入っている。
|
322
|
+
|
323
|
+
switch(times){
|
324
|
+
|
325
|
+
case 0:
|
326
|
+
|
327
|
+
break;
|
328
|
+
|
329
|
+
default:
|
330
|
+
|
331
|
+
del();
|
332
|
+
|
333
|
+
break;
|
334
|
+
|
335
|
+
}
|
336
|
+
|
337
|
+
//for mas[SIZE][SIZE]にコピーし直す。
|
338
|
+
|
339
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
340
|
+
|
341
|
+
//for gl_del_count_cにgl_del_countをコピー
|
342
|
+
|
343
|
+
othello_gl_del_count_c(gl_del_count_c, times);
|
344
|
+
|
345
|
+
//for gl__x[],gl__y[]の座標のコピー これを行うには事前にdel()を呼び、gl_del_countにGUIDEの個数を入れておかなければならない。
|
346
|
+
|
347
|
+
othello_gl__xy_c(gl__x_c, gl__y_c, times);
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
if(n%2==0){
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
for(;jdg_t_c[times]-first[times]<gl_del_count_c[times];jdg_t_c[times]++){
|
358
|
+
|
359
|
+
printf("&w");
|
360
|
+
|
361
|
+
switch(mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]){
|
362
|
+
|
363
|
+
case GUIDE:
|
364
|
+
|
365
|
+
printf("&w+");
|
366
|
+
|
367
|
+
gl_x=gl__x_c[times][k[times][jdg_count[times]]];
|
368
|
+
|
369
|
+
gl_y=gl__y_c[times][k[times][jdg_count[times]]];
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
othello_gl_del_count_c_r(gl_del_count_c, times);
|
374
|
+
|
375
|
+
othello_gl__xy_c_r(gl__x_c, gl__y_c, times);
|
376
|
+
|
377
|
+
del();
|
378
|
+
|
379
|
+
mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]=WHITE;
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
jdg_GUIDE_num[times][jdg_t_c[times]]=10000*jdg_t_c[times]+100*jdg_count[times]+put1(n+1);
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
if(times<2){
|
388
|
+
|
389
|
+
times++;
|
390
|
+
|
391
|
+
othello_AI(n+1);
|
392
|
+
|
393
|
+
times--;
|
394
|
+
|
395
|
+
}
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
break;
|
404
|
+
|
405
|
+
}
|
406
|
+
|
407
|
+
k[times][jdg_count[times]]++;
|
408
|
+
|
409
|
+
}
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
}
|
414
|
+
|
415
|
+
else{...
|
416
|
+
|
417
|
+
```
|
418
|
+
|
419
|
+
|
420
|
+
|
41
421
|
|
42
422
|
|
43
423
|
### 試したこと
|
3
ソースコードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,193 +34,7 @@
|
|
34
34
|
|
35
35
|
|
36
36
|
|
37
|
-
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
38
37
|
|
39
|
-
int othello_AI(int n){
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
static int jdg_t_c[10]={0};//for添字
|
44
|
-
|
45
|
-
static int first[10]={0};//for添字
|
46
|
-
|
47
|
-
static int times=0;//for添字
|
48
|
-
|
49
|
-
int count=0,counta=0, countb=0, countc=0, countd=0, counte=0, tmp;//for添字 tmpは並び替えの時に一時的に入れておくための変数。
|
50
|
-
|
51
|
-
static int k[10][100]={{0},{0}};//for添字
|
52
|
-
|
53
|
-
static int jdg_GUIDE_num[10][1000]={{0},{0}};//for 次の手のGUIDEの数
|
54
|
-
|
55
|
-
static int jdg_minmax_dual_num[10][1000]={{0},{0}};//for jdg_GUIDE_numの最大最小を入れておく。
|
56
|
-
|
57
|
-
int jdg_est_num[10][1000]={{0},{0}};//for 各timesでのjdg_minmax_numの組み合わせを入れる。
|
58
|
-
|
59
|
-
int jdg_total_dual_count[10]={0};
|
60
|
-
|
61
|
-
static int jdg_minmax_num[10][100][1000]={{0},{0},{0}};//for 最小最大の被った数の保持する。
|
62
|
-
|
63
|
-
static int gl_del_count_c[10]={0};//for gl_del_countのコピー
|
64
|
-
|
65
|
-
static int gl__x_c[10][40],gl__y_c[10][40];//for gl__x,gl__yのコピー
|
66
|
-
|
67
|
-
static int jdg_count[10]={0};//for添字→ 関数の出入りの1かたまりの数をそれぞれ記録する。グループ分けとしての変数。
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
static int c1_mas[SIZE][SIZE]={
|
72
|
-
|
73
|
-
{1,1,1,1,1,1,1,1,1,1},
|
74
|
-
|
75
|
-
{1,0,0,0,0,0,0,0,0,1},
|
76
|
-
|
77
|
-
{1,0,0,0,0,0,0,0,0,1},
|
78
|
-
|
79
|
-
{1,0,0,0,0,0,0,0,0,1},
|
80
|
-
|
81
|
-
{1,0,0,0,0,0,0,0,0,1},
|
82
|
-
|
83
|
-
{1,0,0,0,0,0,0,0,0,1},
|
84
|
-
|
85
|
-
{1,0,0,0,0,0,0,0,0,1},
|
86
|
-
|
87
|
-
{1,0,0,0,0,0,0,0,0,1},
|
88
|
-
|
89
|
-
{1,0,0,0,0,0,0,0,0,1},
|
90
|
-
|
91
|
-
{1,1,1,1,1,1,1,1,1,1},
|
92
|
-
|
93
|
-
};
|
94
|
-
|
95
|
-
static int c2_mas[SIZE][SIZE]={
|
96
|
-
|
97
|
-
{1,1,1,1,1,1,1,1,1,1},
|
98
|
-
|
99
|
-
{1,0,0,0,0,0,0,0,0,1},
|
100
|
-
|
101
|
-
{1,0,0,0,0,0,0,0,0,1},
|
102
|
-
|
103
|
-
{1,0,0,0,0,0,0,0,0,1},
|
104
|
-
|
105
|
-
{1,0,0,0,0,0,0,0,0,1},
|
106
|
-
|
107
|
-
{1,0,0,0,0,0,0,0,0,1},
|
108
|
-
|
109
|
-
{1,0,0,0,0,0,0,0,0,1},
|
110
|
-
|
111
|
-
{1,0,0,0,0,0,0,0,0,1},
|
112
|
-
|
113
|
-
{1,0,0,0,0,0,0,0,0,1},
|
114
|
-
|
115
|
-
{1,1,1,1,1,1,1,1,1,1},
|
116
|
-
|
117
|
-
};
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
first[times]=jdg_t_c[times];
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
//for mas[SIZE][SIZE]のコピー
|
126
|
-
|
127
|
-
othello_mas_c(c1_mas, c2_mas, times);
|
128
|
-
|
129
|
-
//gl_del_countにGUIDEの個数をコピーするため。times==0の時はすでにもう入っている。
|
130
|
-
|
131
|
-
switch(times){
|
132
|
-
|
133
|
-
case 0:
|
134
|
-
|
135
|
-
break;
|
136
|
-
|
137
|
-
default:
|
138
|
-
|
139
|
-
del();
|
140
|
-
|
141
|
-
break;
|
142
|
-
|
143
|
-
}
|
144
|
-
|
145
|
-
//for mas[SIZE][SIZE]にコピーし直す。
|
146
|
-
|
147
|
-
othello_mas_c_r(c1_mas, c2_mas, times);
|
148
|
-
|
149
|
-
//for gl_del_count_cにgl_del_countをコピー
|
150
|
-
|
151
|
-
othello_gl_del_count_c(gl_del_count_c, times);
|
152
|
-
|
153
|
-
//for gl__x[],gl__y[]の座標のコピー これを行うには事前にdel()を呼び、gl_del_countにGUIDEの個数を入れておかなければならない。
|
154
|
-
|
155
|
-
othello_gl__xy_c(gl__x_c, gl__y_c, times);
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
if(n%2==0){
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
for(;jdg_t_c[times]-first[times]<gl_del_count_c[times];jdg_t_c[times]++){
|
166
|
-
|
167
|
-
printf("&w");
|
168
|
-
|
169
|
-
switch(mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]){
|
170
|
-
|
171
|
-
case GUIDE:
|
172
|
-
|
173
|
-
printf("&w+");
|
174
|
-
|
175
|
-
gl_x=gl__x_c[times][k[times][jdg_count[times]]];
|
176
|
-
|
177
|
-
gl_y=gl__y_c[times][k[times][jdg_count[times]]];
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
othello_gl_del_count_c_r(gl_del_count_c, times);
|
182
|
-
|
183
|
-
othello_gl__xy_c_r(gl__x_c, gl__y_c, times);
|
184
|
-
|
185
|
-
del();
|
186
|
-
|
187
|
-
mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]=WHITE;
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
jdg_GUIDE_num[times][jdg_t_c[times]]=10000*jdg_t_c[times]+100*jdg_count[times]+put1(n+1);
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
if(times<2){
|
196
|
-
|
197
|
-
times++;
|
198
|
-
|
199
|
-
othello_AI(n+1);
|
200
|
-
|
201
|
-
times--;
|
202
|
-
|
203
|
-
}
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
othello_mas_c_r(c1_mas, c2_mas, times);
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
break;
|
212
|
-
|
213
|
-
}
|
214
|
-
|
215
|
-
k[times][jdg_count[times]]++;
|
216
|
-
|
217
|
-
}
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
}
|
222
|
-
|
223
|
-
else{...
|
224
38
|
|
225
39
|
```
|
226
40
|
|
2
ソースコードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,6 +32,196 @@
|
|
32
32
|
|
33
33
|
for(;jdg_t_c[times]-first[times]<4;jdg_t_c[times]++)
|
34
34
|
|
35
|
+
|
36
|
+
|
37
|
+
全体を載せると3000行を超えるので、問題の関数内のところにしています。
|
38
|
+
|
39
|
+
int othello_AI(int n){
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
static int jdg_t_c[10]={0};//for添字
|
44
|
+
|
45
|
+
static int first[10]={0};//for添字
|
46
|
+
|
47
|
+
static int times=0;//for添字
|
48
|
+
|
49
|
+
int count=0,counta=0, countb=0, countc=0, countd=0, counte=0, tmp;//for添字 tmpは並び替えの時に一時的に入れておくための変数。
|
50
|
+
|
51
|
+
static int k[10][100]={{0},{0}};//for添字
|
52
|
+
|
53
|
+
static int jdg_GUIDE_num[10][1000]={{0},{0}};//for 次の手のGUIDEの数
|
54
|
+
|
55
|
+
static int jdg_minmax_dual_num[10][1000]={{0},{0}};//for jdg_GUIDE_numの最大最小を入れておく。
|
56
|
+
|
57
|
+
int jdg_est_num[10][1000]={{0},{0}};//for 各timesでのjdg_minmax_numの組み合わせを入れる。
|
58
|
+
|
59
|
+
int jdg_total_dual_count[10]={0};
|
60
|
+
|
61
|
+
static int jdg_minmax_num[10][100][1000]={{0},{0},{0}};//for 最小最大の被った数の保持する。
|
62
|
+
|
63
|
+
static int gl_del_count_c[10]={0};//for gl_del_countのコピー
|
64
|
+
|
65
|
+
static int gl__x_c[10][40],gl__y_c[10][40];//for gl__x,gl__yのコピー
|
66
|
+
|
67
|
+
static int jdg_count[10]={0};//for添字→ 関数の出入りの1かたまりの数をそれぞれ記録する。グループ分けとしての変数。
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
static int c1_mas[SIZE][SIZE]={
|
72
|
+
|
73
|
+
{1,1,1,1,1,1,1,1,1,1},
|
74
|
+
|
75
|
+
{1,0,0,0,0,0,0,0,0,1},
|
76
|
+
|
77
|
+
{1,0,0,0,0,0,0,0,0,1},
|
78
|
+
|
79
|
+
{1,0,0,0,0,0,0,0,0,1},
|
80
|
+
|
81
|
+
{1,0,0,0,0,0,0,0,0,1},
|
82
|
+
|
83
|
+
{1,0,0,0,0,0,0,0,0,1},
|
84
|
+
|
85
|
+
{1,0,0,0,0,0,0,0,0,1},
|
86
|
+
|
87
|
+
{1,0,0,0,0,0,0,0,0,1},
|
88
|
+
|
89
|
+
{1,0,0,0,0,0,0,0,0,1},
|
90
|
+
|
91
|
+
{1,1,1,1,1,1,1,1,1,1},
|
92
|
+
|
93
|
+
};
|
94
|
+
|
95
|
+
static int c2_mas[SIZE][SIZE]={
|
96
|
+
|
97
|
+
{1,1,1,1,1,1,1,1,1,1},
|
98
|
+
|
99
|
+
{1,0,0,0,0,0,0,0,0,1},
|
100
|
+
|
101
|
+
{1,0,0,0,0,0,0,0,0,1},
|
102
|
+
|
103
|
+
{1,0,0,0,0,0,0,0,0,1},
|
104
|
+
|
105
|
+
{1,0,0,0,0,0,0,0,0,1},
|
106
|
+
|
107
|
+
{1,0,0,0,0,0,0,0,0,1},
|
108
|
+
|
109
|
+
{1,0,0,0,0,0,0,0,0,1},
|
110
|
+
|
111
|
+
{1,0,0,0,0,0,0,0,0,1},
|
112
|
+
|
113
|
+
{1,0,0,0,0,0,0,0,0,1},
|
114
|
+
|
115
|
+
{1,1,1,1,1,1,1,1,1,1},
|
116
|
+
|
117
|
+
};
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
first[times]=jdg_t_c[times];
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
//for mas[SIZE][SIZE]のコピー
|
126
|
+
|
127
|
+
othello_mas_c(c1_mas, c2_mas, times);
|
128
|
+
|
129
|
+
//gl_del_countにGUIDEの個数をコピーするため。times==0の時はすでにもう入っている。
|
130
|
+
|
131
|
+
switch(times){
|
132
|
+
|
133
|
+
case 0:
|
134
|
+
|
135
|
+
break;
|
136
|
+
|
137
|
+
default:
|
138
|
+
|
139
|
+
del();
|
140
|
+
|
141
|
+
break;
|
142
|
+
|
143
|
+
}
|
144
|
+
|
145
|
+
//for mas[SIZE][SIZE]にコピーし直す。
|
146
|
+
|
147
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
148
|
+
|
149
|
+
//for gl_del_count_cにgl_del_countをコピー
|
150
|
+
|
151
|
+
othello_gl_del_count_c(gl_del_count_c, times);
|
152
|
+
|
153
|
+
//for gl__x[],gl__y[]の座標のコピー これを行うには事前にdel()を呼び、gl_del_countにGUIDEの個数を入れておかなければならない。
|
154
|
+
|
155
|
+
othello_gl__xy_c(gl__x_c, gl__y_c, times);
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
if(n%2==0){
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
for(;jdg_t_c[times]-first[times]<gl_del_count_c[times];jdg_t_c[times]++){
|
166
|
+
|
167
|
+
printf("&w");
|
168
|
+
|
169
|
+
switch(mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]){
|
170
|
+
|
171
|
+
case GUIDE:
|
172
|
+
|
173
|
+
printf("&w+");
|
174
|
+
|
175
|
+
gl_x=gl__x_c[times][k[times][jdg_count[times]]];
|
176
|
+
|
177
|
+
gl_y=gl__y_c[times][k[times][jdg_count[times]]];
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
othello_gl_del_count_c_r(gl_del_count_c, times);
|
182
|
+
|
183
|
+
othello_gl__xy_c_r(gl__x_c, gl__y_c, times);
|
184
|
+
|
185
|
+
del();
|
186
|
+
|
187
|
+
mas[gl__y_c[times][k[times][jdg_count[times]]]][gl__x_c[times][k[times][jdg_count[times]]]]=WHITE;
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
jdg_GUIDE_num[times][jdg_t_c[times]]=10000*jdg_t_c[times]+100*jdg_count[times]+put1(n+1);
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
if(times<2){
|
196
|
+
|
197
|
+
times++;
|
198
|
+
|
199
|
+
othello_AI(n+1);
|
200
|
+
|
201
|
+
times--;
|
202
|
+
|
203
|
+
}
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
othello_mas_c_r(c1_mas, c2_mas, times);
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
break;
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
k[times][jdg_count[times]]++;
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
}
|
222
|
+
|
223
|
+
else{...
|
224
|
+
|
35
225
|
```
|
36
226
|
|
37
227
|
|
1
タイトルの補足
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Bus errorの原因を知りたい
|
1
|
+
Bus error:10の原因を知りたい
|
test
CHANGED
File without changes
|