回答編集履歴
1
ヒントが逆順に表示されていたのを修正
test
CHANGED
@@ -12,8 +12,6 @@
|
|
12
12
|
|
13
13
|
#define CELL_END 8
|
14
14
|
|
15
|
-
|
16
|
-
|
17
15
|
int main(void)
|
18
16
|
|
19
17
|
{
|
@@ -72,7 +70,7 @@
|
|
72
70
|
|
73
71
|
} else if (cnt > 0) {
|
74
72
|
|
75
|
-
for (int x2 = CELL_START
|
73
|
+
for (int x2 = 0; x2 < CELL_START; x2++) {
|
76
74
|
|
77
75
|
if (a[y][x2] == 0) {
|
78
76
|
|
@@ -92,7 +90,7 @@
|
|
92
90
|
|
93
91
|
if (cnt > 0) {
|
94
92
|
|
95
|
-
for (int x2 = CELL_START
|
93
|
+
for (int x2 = 0; x2 < CELL_START; x2++) {
|
96
94
|
|
97
95
|
if (a[y][x2] == 0) {
|
98
96
|
|
@@ -124,7 +122,7 @@
|
|
124
122
|
|
125
123
|
} else if (cnt > 0) {
|
126
124
|
|
127
|
-
for (int y2 = CELL_START
|
125
|
+
for (int y2 = 0; y2 < CELL_START; y2++) {
|
128
126
|
|
129
127
|
if (a[y2][x] == 0) {
|
130
128
|
|
@@ -144,7 +142,7 @@
|
|
144
142
|
|
145
143
|
if (cnt > 0) {
|
146
144
|
|
147
|
-
for (int y2 = CELL_START
|
145
|
+
for (int y2 = 0; y2 < CELL_START; y2++) {
|
148
146
|
|
149
147
|
if (a[y2][x] == 0) {
|
150
148
|
|
@@ -164,6 +162,42 @@
|
|
164
162
|
|
165
163
|
|
166
164
|
|
165
|
+
for (int y = CELL_START; y < CELL_END; y++) {
|
166
|
+
|
167
|
+
while (a[y][CELL_START - 1] == 0) {
|
168
|
+
|
169
|
+
for (int x = CELL_START - 2; x >= 0; x--) {
|
170
|
+
|
171
|
+
a[y][x + 1] = a[y][x];
|
172
|
+
|
173
|
+
}
|
174
|
+
|
175
|
+
a[y][0] = 0;
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
for (int x = CELL_START; x < CELL_END; x++) {
|
184
|
+
|
185
|
+
while (a[CELL_START - 1][x] == 0) {
|
186
|
+
|
187
|
+
for (int y = CELL_START - 2; y >= 0; y--) {
|
188
|
+
|
189
|
+
a[y + 1][x] = a[y][x];
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
a[0][x] = 0;
|
194
|
+
|
195
|
+
}
|
196
|
+
|
197
|
+
}
|
198
|
+
|
199
|
+
|
200
|
+
|
167
201
|
for (int y = 0; y < CELL_END; y++) {
|
168
202
|
|
169
203
|
for (int x = 0; x < CELL_END; x++) {
|
@@ -218,10 +252,10 @@
|
|
218
252
|
|
219
253
|
1 1
|
220
254
|
|
255
|
+
1 1 1 1 1
|
256
|
+
|
221
257
|
1 2 1 1 1
|
222
258
|
|
223
|
-
1 1 1 1 1
|
224
|
-
|
225
259
|
3 O O O
|
226
260
|
|
227
261
|
1 1 O O
|