06 2013 档案
摘要:The SuspectsTime Limit:1000MSMemory Limit:20000KTotal Submissions:17876Accepted:8659DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to separa
阅读全文
摘要:Wireless NetworkTime Limit:10000MSMemory Limit:65536KTotal Submissions:13679Accepted:5796DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the n
阅读全文
摘要:Find them, Catch themTime Limit:1000MSMemory Limit:10000KTotal Submissions:24739Accepted:7435DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to identify whi
阅读全文
摘要:Parity gameTime Limit:1000MSMemory Limit:65536KTotal Submissions:5287Accepted:2074DescriptionNow and then you play the following game with your friend. Your friend writes down a sequence consisting of zeroes and ones. You choose a continuous subsequence (for example the subsequence from the third to
阅读全文
摘要:hdu 1598find the most comfortable road题目的意思是很多连接的点中,问x到y点的最小差值。差值的计算是,在这条路径中的最大的值-最小的值。感觉像流的问题。却十分巧妙的用并查集来做。问题的关键还是在处理 最小差值。1贪心+并查。将排序(从小到大)后的进行判断,是否f[x]==f[y]来结束。那谁是起点??这也是个难点,任一点都可能是起点,我们只能通过for(i=1;i=m+1)break; if(a[j].info-a[i].info<ans) ans=a[j].info-a[i].info; } if(ans==10000003) return -1;
阅读全文
摘要:SupermarketTime Limit:2000MSMemory Limit:65536KTotal Submissions:7671Accepted:3246DescriptionA supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the sale beg
阅读全文
摘要:二分图的最优匹配(KM算法)KM算法用来解决最大权匹配问题:在一个二分图内,左顶点为X,右顶点为Y,现对于每组左右连接XiYj有权wij,求一种匹配使得所有wij的和最大。基本原理该算法是通过给每个顶点一个标号(叫做顶标)来把求最大权匹配的问题转化为求完备匹配的问题的。设顶点Xi的顶标为A[i],顶点Yj的顶标为B[j],顶点Xi与Yj之间的边权为w[i,j]。在算法执行过程中的任一时刻,对于任一条边(i,j),A[i]+B[j]>=w[i,j]始终成立。KM算法的正确性基于以下定理:若由二分图中所有满足A[i]+B[j]=w[i,j]的边(i,j)构成的子图(称做相等子图)有完备匹配,
阅读全文
摘要:#include<stdio.h>#include<iostream>#include<cstdlib>#include<algorithm>using namespace std;struct st{ int a; int b;}f[1001];bool cmp(st p,st q){ if(p.a==q.a) { return p.b>q.b; // >升序 } else return p.a>q.a;}int main(){ int n,i; while(scanf("%d",&n)>0)
阅读全文
摘要:博弈论(一):Nim游戏重点结论:对于一个Nim游戏的局面(a1,a2,...,an),它是P-position当且仅当a1^a2^...^an=0,其中^表示位异或(xor)运算。Nim游戏是博弈论中最经典的模型(之一?),它又有着十分简单的规则和无比优美的结论,由这个游戏开始了解博弈论恐怕是最合适不过了。Nim游戏是组合游戏(CombinatorialGames)的一种,准确来说,属于“ImpartialCombinatorialGames”(以下简称ICG)。满足以下条件的游戏是ICG(可能不太严谨):1、有两名选手;2、两名选手交替对游戏进行移动(move),每次一步,选手可以在(一般
阅读全文
浙公网安备 33010602011771号