文章
99
粉丝
120
获赞
8
访问
97.5k
#include<bits/stdc++.h>
#define N 20100
#define K 600
using namespace std;
bool attack[N], havequeen[N];
int n, m, k, sum;//sum为被攻击的位置个数,答案为n*m-sum
struct queen {
int x, y;
}a[K];
int main() {
freopen("queen.in", "r", stdin);
freopen("queen.out", "w", stdout);
scanf("%d%d%d", &n, &m, &k);
for (int i = 1; i <= k; i++) {
scanf("%d%d", &a[i].x, &a[i].y);
havequeen[a[i].x] = true;
}
for (int i = 1; i <= n; i++) {
if (havequeen[i]) {
sum += m;
}
else {
...
登录后发布评论
暂无评论,来抢沙发