社区讨论
样例过了,只有10ac其他全wa
P4924[1007] 魔法少女小Scarlet参与者 1已保存回复 0
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 0 条
- 当前快照
- 1 份
- 快照标识符
- @lo7ncsoc
- 此快照首次捕获于
- 2023/10/27 04:38 2 年前
- 此快照最后确认于
- 2023/10/27 04:38 2 年前
CPP
#include<bits/stdc++.h>
using namespace std;
int a[1000][1000], b[1000][1000];
int main() {
int n, m,g=0;
int c, d, e, f;
cin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
a[i][j] = ++g;
}
}for (int y = 0; y < m; y++) {
cin >> c >> d >> e >> f;
if (f == 0) {
for (int x = c - e; x <= c + e; x++)
for (int y = c - e; y <= c + e; y++)
b[c - d + y][c + d - x] = a[x][y];
for (int x = c - e; x <= c + e; x++)
for (int y = c - e; y <= c + e; y++)
a[x][y] = b[x][y];
}else if (f == 1) {
for (int x = c - e; x <= c + e; x++)
for (int y = c - e; y <= c + e; y++)
b[c + d - y][c - d + x] = a[x][y];
for (int x = c - e; x <= c + e; x++)
for (int y = c - e; y <= c + e; y++)
a[x][y] = b[x][y];
}
}for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
cout << a[i][j] << " ";
}cout << endl;
}
return 0;
}
回复
共 0 条回复,欢迎继续交流。
正在加载回复...