#include <stdio.h>
#include <stdlib.h>
// 必要があれば変数などを追加してもOKです
int main(){
int i, j, k;
int a, b;
int **mat;
// ここで2次元配列の動的確保をする
mat
= (int **)malloc(sizeof(int)*a
); for (i = 0;i<a;i++){
mat
[i
] = (int *)malloc(sizeof(int)*b
); }
// ここで2次元配列に数値を代入する
k=1;
for (i = 0; i < a; i++) {
for (j = 0; j < b; j++) {
mat[i][j] = k++;
}
}
// 以下の部分は表示の部分です
// いじらなくてOK
for (i = 0; i < a; i++) {
for (j = 0; j < b; j++) {
}
}
// さて,最後に忘れずにすることと言えば?
for (i = 0; i < a; i++) {
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCi8vIOW/heimgeOBjOOBguOCjOOBsOWkieaVsOOBquOBqeOCkui/veWKoOOBl+OBpuOCgk9L44Gn44GZCgppbnQgbWFpbigpewogICAgaW50IGksIGosIGs7CiAgICBpbnQgYSwgYjsKICAgIGludCAqKm1hdDsKICAgIHNjYW5mKCIlZCAlZCIsICZhLCAmYik7CgogICAgLy8g44GT44GT44GnMuasoeWFg+mFjeWIl+OBruWLleeahOeiuuS/neOCkuOBmeOCiwogICAgbWF0ID0gKGludCAqKiltYWxsb2Moc2l6ZW9mKGludCkqYSk7CiAgICBmb3IgKGkgPSAwO2k8YTtpKyspewogICAgICAgIG1hdFtpXSA9IChpbnQgKiltYWxsb2Moc2l6ZW9mKGludCkqYik7CiAgICB9CgogICAgLy8g44GT44GT44GnMuasoeWFg+mFjeWIl+OBq+aVsOWApOOCkuS7o+WFpeOBmeOCiwogICAgaz0xOwogICAgZm9yIChpID0gMDsgaSA8IGE7IGkrKykgewogICAgICAgIGZvciAoaiA9IDA7IGogPCBiOyBqKyspIHsKICAgICAgICAgICAgbWF0W2ldW2pdID0gaysrOwogICAgICAgIH0KICAgIH0KCiAgICAvLyDku6XkuIvjga7pg6jliIbjga/ooajnpLrjga7pg6jliIbjgafjgZkKICAgIC8vIOOBhOOBmOOCieOBquOBj+OBpk9LCiAgICBmb3IgKGkgPSAwOyBpIDwgYTsgaSsrKSB7CiAgICAgICAgZm9yIChqID0gMDsgaiA8IGI7IGorKykgewogICAgICAgICAgICBwcmludGYoIiVkICIsIG1hdFtpXVtqXSk7CiAgICAgICAgfQogICAgICAgIHByaW50ZigiXG4iKTsKICAgIH0KCiAgICAvLyDjgZXjgabvvIzmnIDlvozjgavlv5jjgozjgZrjgavjgZnjgovjgZPjgajjgajoqIDjgYjjgbDvvJ8KICAgIGZvciAoaSA9IDA7IGkgPCBhOyBpKyspIHsKICAgICAgICBmcmVlKG1hdFtpXSk7CiAgICB9CiAgICBmcmVlKG1hdCk7CgogICAgcmV0dXJuIDA7Cn0K