摘要: 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 阅读全文
posted @ 2013-06-27 14:45 芷水 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 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; 阅读全文
posted @ 2013-06-27 14:42 芷水 阅读(190) 评论(0) 推荐(0) 编辑