#include<bits/stdc++.h>
using namespace std;
int n, m;
int a[505][505], t[505][505];//定义
int main()
{
scanf("%d%d", &n, &m);
for (int i = 1, cnt = 0; i <= n; i++)
for (int j = 1; j <= n; j++)
a[i][j] = ++cnt;//初始化
while (m--)
{
int x, y, r, f;
scanf("%d%d%d%d", &x, &y, &r, &f);
if (f == 0)//顺时针
{
for (int i = x - r; i <= x + r; i++)
for (int j = y - r; j <= y + r; j++)
t[x - y + j][x + y - i] = a[i][j];
}
else//逆时针
{
for (int i = x - r; i <= x + r; i++)
for (int j = y - r; j <= y + r; j++)
t[x + y - j][x - y + i] = a[i][j];
}
for (int i = x - r; i <= x + r; i++)
for (int j = y - r; j <= y + r; j++)
a[i][j] = t[i][j];把操作后的数组赋值给原数组
}
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
printf("%d ", a[i][j]);输出
puts("");
}
return 0;
}
样例过了,x=y 的情况也试过了,都是对的
但是提交就 WA 了 9 个点 T_T