#include <stdio.h>
#include <stdlib.h>
int main(){
int i,j,k=1;
int a,b;
int **mat;
int *p;
//ここで2次元配列の動的確保をする
mat
= (int *)malloc(sizeof(int)*a
); p
= (int *)malloc(sizeof(int)*a
*b
);
for(i=0; i<a; i++){
mat[i] = p+i*b;
}
//ここで2次元配列に数値を代入する
if(mat==NULL || p==NULL){
return 0;
}
for(i=0; i<a; i++){
for(j=0; j<b; j++){
mat[i][j] = k;
k++;
}
}
//以下の部分は表示の部分です
//いじらなくてOK
for(i=0;i<a;i++){
for(j=0;j<b;j++){
}
}
//さて,最後に忘れずにすることと言えば?
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCgoKaW50IG1haW4oKXsKICAgIGludCBpLGosaz0xOwogICAgaW50IGEsYjsKICAgIGludCAqKm1hdDsKICAgIGludCAqcDsKICAgIHNjYW5mKCIlZCAlZCIsJmEsJmIpOwoKCS8v44GT44GT44GnMuasoeWFg+mFjeWIl+OBruWLleeahOeiuuS/neOCkuOBmeOCiwogICAgbWF0ID0gKGludCAqKW1hbGxvYyhzaXplb2YoaW50KSphKTsKICAgIHAgPSAoaW50ICopbWFsbG9jKHNpemVvZihpbnQpKmEqYik7CiAgICAKICAgIGZvcihpPTA7IGk8YTsgaSsrKXsKICAgIAltYXRbaV0gPSBwK2kqYjsKICAgIH0KICAgIAoJLy/jgZPjgZPjgacy5qyh5YWD6YWN5YiX44Gr5pWw5YCk44KS5Luj5YWl44GZ44KLCglpZihtYXQ9PU5VTEwgfHwgcD09TlVMTCl7CgkJcHJpbnRmKCJFUlJPUlxuIik7CgkJcmV0dXJuIDA7Cgl9CgkKCWZvcihpPTA7IGk8YTsgaSsrKXsKCQlmb3Ioaj0wOyBqPGI7IGorKyl7CgkJCW1hdFtpXVtqXSA9IGs7CgkJCWsrKzsKCQl9Cgl9CiAgICAvL+S7peS4i+OBrumDqOWIhuOBr+ihqOekuuOBrumDqOWIhuOBp+OBmQogICAgLy/jgYTjgZjjgonjgarjgY/jgaZPSwogICAgZm9yKGk9MDtpPGE7aSsrKXsKICAgICAgICBmb3Ioaj0wO2o8YjtqKyspewogICAgICAgICAgICBwcmludGYoIiVkICIsbWF0W2ldW2pdKTsKICAgICAgICB9CiAgICAgICAgcHJpbnRmKCJcbiIpOwogICAgfQogICAgCiAgICAvL+OBleOBpu+8jOacgOW+jOOBq+W/mOOCjOOBmuOBq+OBmeOCi+OBk+OBqOOBqOiogOOBiOOBsO+8nwoJZnJlZShtYXQpOwoKICAgIHJldHVybiAwOwp9Cg==