#include <stdio.h>
int main(){
int r, c, m, now = 0;
scanf("%d %d %d", &r, &c, &m);
int b0[r][c], b1[c][r], s[m];
for(int i = 0; i < r; i++) for(int j = 0; j < c; j++) scanf("%d", &b0[i][j]);
for(int i = 0; i < m; i++) scanf("%d", &s[i]);
for(int k = m-1; k >= 0; k--)
if(s[k] == 0){
if(now == 0){
for(int i = 0; i < c; i++) for(int j = 0; j < r; j++) b1[i][j] = b0[j][c-1-i];
now = 1;
}else if(now == 1){
for(int i = 0; i < r; i++) for(int j = 0; j < c; j++) b0[i][j] = b1[j][r-1-i];
now = 0;
}
}else if(s[k] == 1){
if(now == 0)
for(int i = 0; i < r/2; i++)
for(int j = 0; j < c; j++){
int tmp = b0[i][j];
b0[i][j] = b0[r-1-i][j];
b0[r-1-i][j] = tmp;
}
else if(now == 1)
for(int i = 0; i < c/2; i++)
for(int j = 0; j < r; j++){
int tmp = b0[i][j];
b1[i][j] = b1[c-1-i][j];
b1[c-1-i][j] = tmp;
}
}
if(now == 0){
printf("%d %d", r, c);
for(int i = 0; i < r; i++){
printf("\n");
for(int j = 0; j < c-1; j++) printf("%d ", b0[i][j]);
printf("%d", b0[i][c-1]);
}
}else if(now == 1){
printf("%d %d", c, r);
for(int i = 0; i < c; i++){
printf("\n");
for(int j = 0; j < r-1; j++) printf("%d ", b1[i][j]);
printf("%d", b1[i][r-1]);
}
}
}
評分結果:NA (score:40%)
#3: 10% WA (line:2)
您的答案為: 3 9 3
正確答案為: 8 9 3
#4: 10% WA (line:2)
您的答案為: 8 3 2 8 8
正確答案為: 1 9 2 8 8
#6: 10% WA (line:2)
您的答案為: 0 5 2 1 0 8 3 0
正確答案為: 0 9 0 9 8 3 6 3
#7: 10% WA (line:2)
您的答案為: 2 4 2 5 5 8
正確答案為: 5 1 1 9 2 8
#8: 10% WA (line:6)
您的答案為: 5 2 5 2 3 5 9 1 8
正確答案為: 6 9 3 4 9 7 3 3 6
#9: 10% WA (line:2)
您的答案為: 8 3 9
正確答案為: 4 3 9