这题搞了我一天啊...拍不出错原来是因为极限数据就RE了啊,竟然返回WA啊.我的线段树要开8倍才能过啊... 首先可以发现除了那个加边操作,其他的操作有点像线段树啊.如果我们把每次询问的联通块都放在一个区间的话,那么就可以用线段树维护了啊. 于是我们只需要用带权并查集把联通块串成一条链的形式.就可以用区间表示出来了啊.. # include <cstdio> # include <cstring> # include <cstdlib> # include <io…
F. Palindrome Problem Description A string is palindrome if it can be read the same way in either direction, for example "maram" is palindrome, while "ammar" is not. You are given a string of n characters, where each character is eithe…
传送门 The Experience of Love Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 221 Accepted Submission(s): 91 Problem Description A girl named Gorwin and a boy named Vivin is a couple. They arriv…
Zjnu Stadium 题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=3047 Problem Description In 12th Zhejiang College Students Games 2007, there was a new stadium built in Zhejiang Normal University. It was a modern stadium which could hold thousands of peop…