4462专题

hdu 4462 Scaring the Birds(STL)

题目链接:hdu 4462 Scaring the Birds 题目大意:给定N,表示有一个N∗N的农田,现在有些位置的谷物已经被毁坏,农场主决定在这些位置中选择一些放 置稻草人,给定每个点放置稻草人可以覆盖的曼哈顿距离。求最少放多少个稻草人。 解题思路:题意需要注意,可以放稻草人的位置是没有谷物的。然后对于每个位置预处理出可以覆盖的位置,用bitset 优化即可。 #incl

HDU 4462 Scaring the Birds(dfs)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4462 题面: Scaring the Birds Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3094    Acce

HDU 4462 Scaring the Birds(状态压缩枚举)

思路:考虑K只有10,压缩一下然后暴力枚举即可,注意的是放稻草人的点是不需要被覆盖的 #include<bits/stdc++.h>using namespace std;const int maxn = 150;#define INF 1e9int r[maxn],c[maxn],vis[maxn][maxn],R[maxn];int a[maxn];int n,k;i

HDU 4462 Scaring the Birds

题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=4462 Scaring the Birds Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3516