POJ 2296 Map Labeler / ZOJ 2493 Map Labeler / HIT 2369 Map Labeler / UVAlive 2973 Map Labeler(2-sat 二分) Description Map generation is a difficult task in cartography. A vital part of such task is automatic labeling of the cities in a map; where for e…
POJ 2296 Map Labeler 题目链接 题意: 坐标轴上有N个点.要在每一个点上贴一个正方形,这个正方形的横竖边分别和x,y轴平行,而且要使得点要么在正方形的上面那条边的中点,或者在以下那条边的中点.而且随意两个点的正方形都不重叠(能够重边).问正方形最大边长能够多少? 思路:显然的2-sat问题,注意推断两个矩形相交的地方,细节 代码: #include <cstdio> #include <cstring> #include <cstdlib> #inc…
POJ 1459 Power Network / HIT 1228 Power Network / UVAlive 2760 Power Network / ZOJ 1734 Power Network / FZU 1161 (网络流,最大流) Description A power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A…
POJ 1502 MPI Maelstrom / UVA 432 MPI Maelstrom / SCU 1068 MPI Maelstrom / UVALive 5398 MPI Maelstrom /ZOJ 1291 MPI Maelstrom (最短路径) Description BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shar…
POJ 1860 Currency Exchange / ZOJ 1544 Currency Exchange (最短路径相关,spfa求环) Description Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations onl…
两题二分图匹配的题: 1.一个农民有n头牛和m个畜栏,对于每个畜栏,每头牛有不同喜好,有的想去,有的不想,对于给定的喜好表,你需要求出最大可以满足多少头牛的需求. 2.给你学生数和课程数,以及学生上的课,如果可以做到每个学生代表不同的课程并且所有的课程都被代表输出"YES"(学生能代表一门课当且仅当他上过). 1.POJ 1274 The Perfect Stall http://poj.org/problem?id=1274 和上一题过山车一样,也是二分图匹配的. 水题. #incl…
Map Labeler Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1267   Accepted: 409 Description Map generation is a difficult task in cartography. A vital part of such task is automatic labeling of the cities in a map; where for each city t…
Language: Default Map Labeler Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1815   Accepted: 599 Description Map generation is a difficult task in cartography. A vital part of such task is automatic labeling of the cities in a map; whe…
题意: 给出n个点  让求这n个点所能建成的正方形的最大边长,要求不覆盖,且这n个点在正方形上或下边的中点位置 解析: 当然是二分,但建图就有点还行..比较难想..行吧...我太垃圾... 2 - sat建图 一看逻辑关系,二看具体情况 这里既有平常常用的逻辑关系,也有一些具体的关系 #include <iostream> #include <cstdio> #include <sstream> #include <cstring> #include <…
二分答案 + 2-SAT验证,判断正方形是否相交写起来有点烦,思路还是挺简单的. #include<cstdio> #include<cstring> #include<cmath> #include<stack> #include<queue> #include<algorithm> using namespace std; ; struct Point { double x,y; }p[maxn]; int N; stack<…