小C现在想建设一个国家。这个国家中有一个首都,然后有若干个中间站,还有若干个城市。现在小C想把国家建造成这样的形状:选若干(可以是0个)的中间站把他们连成一条直线,然后把首都连在这一条直线的左端。然后每个点可以连一个城市,特别的是最右端的点可以连接两个城市。现在有n个城市的规划供小C选择。但是,他们... Read More
Problem Description Today is the 1st anniversary of BestCoder. Soda, the contest manager, gets a stringsof lengthn. He wants to find three nonoverlap... Read More
为率封臣们南下打击兰尼斯特家族的嚣张气焰,罗柏·史塔克决定举行一场宴会来提升封臣们的士气。史塔克家族的分封关系可以抽象成一颗树,共n个封臣。根节点为史塔克家。除史塔克家外的所有封臣均有且仅有一个直属的上级。由于经费有限,罗柏·史塔克只能邀请一部分封臣来参加宴会。经费上限用w来描述。另外,对于... Read More
#include #include #include #include using namespace std; vectors[2160001]; int main() { int t; for(int i=0;i2160000)temp=4320000-temp; s[temp].push_back(i); s[temp].push... Read More
Max SumTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 142281Accepted Submission(s): 33104 Proble... Read More