摘要: 本来想用线段树做的,仔细看题发现题目数据太弱了,直接用一个数组标记平面上每一个单位方格即可,水题~/* * hdu1264/linux.cpp * Created on: 2011-9-1 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>using namespace std;const int MAX_COR = 105;bool map[MAX_COR][MAX_COR 阅读全文
posted @ 2011-09-01 14:50 moonbay 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 直接枚举Ai, Bj, Ck的复杂度为L×M×N,过不了。先把所有Ai, Bj的和存起来并排序,然后枚举Ck,二分查找Ai, Bj的和,复杂度为L×M×log(L×M)。/* * hdu2141/linux.cpp * Created on: 2011-9-1 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>using na 阅读全文
posted @ 2011-09-01 13:15 moonbay 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 题目没啥说的,赤裸裸的匈牙利算法,可恶的是题目输入描述不清,还以为每组输入后都有一个0呢,害得我RE了一次,鄙视一下出题者,哈哈!/* * hdu2063/linux.cpp * Created on: 2011-9-1 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>usingnamespace std;constint MAXN =555;int n, m, match 阅读全文
posted @ 2011-09-01 09:51 moonbay 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 欧拉函数的应用。/* * hdu1286/linux.cpp * Created on: 2011-9-1 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <algorithm>using namespace std;void work();int main() {#ifndef ONLINE_JUDGE freopen("data.in", "r", s 阅读全文
posted @ 2011-09-01 08:24 moonbay 阅读(139) 评论(0) 推荐(0) 编辑