北大OJ2536
来源:互联网 发布:roseonly野兽派知乎 编辑:程序博客网 时间:2024/05/16 05:19
#include<iostream> using namespace std; const int MAX = 300; struct coordinate { double x,y; }; coordinate gopher[MAX]; coordinate holes[MAX]; bool arcs[MAX][MAX]; bool isvisit[MAX]; int match[MAX]; int n, m, s, v; bool find(int u) { for (int i = 1; i <= m; i++) if (arcs[u][i] && !isvisit[i]) { isvisit[i] = true; if (!match[i] || find(match[i])) { match[i] = u; return true; } } return false; } int main() { while (cin >> n >> m >> s >> v) { double d = s*v*s*v; for (int i = 0; i < n; i++) cin >> gopher[i].x >> gopher[i].y; for (int i = 0; i < m; i++) cin >> holes[i].x >> holes[i].y; memset(arcs, false, sizeof(arcs)); memset(match, 0, sizeof(match)); for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) if ((holes[j].x - gopher[i].x)*(holes[j].x - gopher[i].x) + (holes[j].y - gopher[i].y)*(holes[j].y - gopher[i].y) <= d) arcs[i+1][j+1] = true; int ans = 0;for (int i = 1; i <= n; i++) { memset(isvisit, false, sizeof(isvisit)); if (find(i)) ans++; } cout << n - ans << endl; } return 0; }
0 0
- 北大OJ2536
- 北大OJ2536
- OJ2536长方体继承自矩形
- 北大简介
- 北大青鸟
- 北大青鸟
- 北大青鸟
- 北大acm1005
- 北大acm1008
- 北大1547
- 北大1120
- 北大1019
- 北大1006
- 北大1590
- 北大1491
- 北大1591
- 北大1595
- 北大2894
- Reverse Integer leetcode python
- 将博客搬至CSDN
- Delphi iOS Gesture 事件触发的探索
- sublime text 全局搜索
- nyoj 366 D的小L 【全排列&&必须记住】
- 北大OJ2536
- 找出一组数中个数超过一半的数
- 安卓框架
- leetcode -- Length of Last Word -- 太简单
- 传感器实验报告(第五次)
- R读取大数据--仅读取指定列
- Android的shape的使用
- 北大OJ1664
- 运维小知识--- -bash: /usr/local/maven/apache-maven-3.2.3/bin/mvn: Permission denied