#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
); }
if(mat==NULL){
return 0;
}
// ここで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++) {
}
}
// さて,最後に忘れずにすることと言えば?
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCi8vIOW/heimgeOBjOOBguOCjOOBsOWkieaVsOOBquOBqeOCkui/veWKoOOBl+OBpuOCgk9L44Gn44GZCgppbnQgbWFpbigpewogICAgaW50IGksIGosIGs7CiAgICBpbnQgYSwgYjsKICAgIGludCAqKm1hdDsKICAgIHNjYW5mKCIlZCAlZCIsICZhLCAmYik7CgogICAgLy8g44GT44GT44GnMuasoeWFg+mFjeWIl+OBruWLleeahOeiuuS/neOCkuOBmeOCiwogICAgbWF0ID0gKGludCAqKiltYWxsb2Moc2l6ZW9mKGludCkqYSk7CiAgICBmb3IgKGkgPSAwO2k8YTtpKyspewogICAgICAgIG1hdFtpXSA9IChpbnQgKiltYWxsb2Moc2l6ZW9mKGludCkqYik7CiAgICB9CiAgICBpZihtYXQ9PU5VTEwpewogICAgICAgIHByaW50ZigiRVJST1JcbiIpOwogICAgICAgIHJldHVybiAwOwogICAgfQoKICAgIC8vIOOBk+OBk+OBpzLmrKHlhYPphY3liJfjgavmlbDlgKTjgpLku6PlhaXjgZnjgosKICAgIGs9MTsKICAgIGZvciAoaSA9IDA7IGkgPCBhOyBpKyspIHsKICAgICAgICBmb3IgKGogPSAwOyBqIDwgYjsgaisrKSB7CiAgICAgICAgICAgIG1hdFtpXVtqXSA9IGsrKzsKICAgICAgICB9CiAgICB9CgogICAgLy8g5Lul5LiL44Gu6YOo5YiG44Gv6KGo56S644Gu6YOo5YiG44Gn44GZCiAgICAvLyDjgYTjgZjjgonjgarjgY/jgaZPSwogICAgZm9yIChpID0gMDsgaSA8IGE7IGkrKykgewogICAgICAgIGZvciAoaiA9IDA7IGogPCBiOyBqKyspIHsKICAgICAgICAgICAgcHJpbnRmKCIlZCAiLCBtYXRbaV1bal0pOwogICAgICAgIH0KICAgICAgICBwcmludGYoIlxuIik7CiAgICB9CgogICAgLy8g44GV44Gm77yM5pyA5b6M44Gr5b+Y44KM44Ga44Gr44GZ44KL44GT44Go44Go6KiA44GI44Gw77yfCiAKICAgIGZyZWUobWF0KTsKCiAgICByZXR1cm4gMDsKfQoK