int *sirokuro = new int[wid*hei];

sirokuro[x+y*wid] = なんとか