Y sequence Problem's Link: http://acm.hdu.edu.cn/showproblem.php?pid=5297 Mean: 有连续数列A={1,2,3,4,5,6,7,8 .....},将可以表示成a^b次方的数删除,a={1,2,3,4,5...},而2<=b<=r,删除后形成一个新的数列,求这个数列的第n项. analyse: 很有趣的一道数论题. 对于给定的一个n,如果我们知道1~n中被删除的数字为k个,那么答案一定大于等于n+k,所以向后至少移动k个…
OO’s Sequence Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 312    Accepted Submission(s): 107 Problem Description OO has got a array A of size n ,defined a function f(l,r) represent the num…
Divide the Sequence 题意: 给你一个序列A,问你最多能够分成多少个连续子序列,使得每个子序列的所有前缀和均不小于0 题解: 这题是比赛时候的水题,但我比的时候也就做出这一题, = = 首先我想的是把他们前缀和求出来,之后试了下样例,一点鸟用都没有,那正着不行就倒着试下呗,之后发现这样有用,我先想到的思路是求后缀和,只要>=0就ans++,但那时队友举出了反例,比如2 1 -3 3的时候应该是2,我的算法就是4,那接着马上就能想到如果后缀和大于0,那么就要把他赋为0,之后举了几…
题意:对N个由(,)组成的字符串,求拼接后得到的最大的balance序列的长度.balance序列:空串/ A+B(A,B都是b序列)/ (+A+),A为b序列.此三种情况. 分析:在读入N每个字符串时,先将单独一个字符串中的b序列长度提取出来,记录其没有被使用的左弧L和右弧R的数目.因为要使其最后拼接后得到的子序列长度尽可能地大,那么按照贪心的思想,肯定希望左弧多的字符串在前,右弧多的字符串在后,所以要对其排序.但是排序时关键字的比较并不只是简单地比较二者的L与R,而且要先比较自身L与R的大小…
Y sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 667    Accepted Submission(s): 147 Problem Description Yellowstar likes integers so much that he listed all positive integers in ascend…
tree Time Limit: 8000ms Memory Limit: 262144KB This problem will be judged on HDU. Original ID: 539064-bit integer IO format: %I64d      Java class name: Main   Given a rooted tree(node 1 is the root) with n nodes. The ithnode has a positive value vi…
Root Time Limit: 30000/15000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 34    Accepted Submission(s): 6 Problem Description Given a number sum(1≤sum≤100000000),we have m queries which contains a pair (xi,yi) a…
CRB and Tree                                                             Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)                                                                                            To…
CRB and Queries Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 533    Accepted Submission(s): 125 Problem DescriptionThere are N boys in CodeLand.Boy i has his coding skill Ai.CRB wants to k…
Leader in Tree Land Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 447    Accepted Submission(s): 185 Problem DescriptionTree land has n cities, connected by n−1 roads. You can go to any city f…
The sum of gcd Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 641    Accepted Submission(s): 277 Problem Description  You have an array A with the length of $n$ \[Let\quad f(l,r) = \sum_{i = l}…
Yu-Gi-Oh! Time Limit: 2000ms Memory Limit: 65536KB This problem will be judged on HDU. Original ID: 538364-bit integer IO format: %I64d      Java class name: Main   "Yu-Gi-Oh!", also known as "Dueling Monsters", is a popular trading ca…
The path Time Limit: 2000ms Memory Limit: 65536KB This problem will be judged on HDU. Original ID: 538564-bit integer IO format: %I64d      Java class name: Main Special Judge   You have a connected directed graph.Let d(x) be the length of the shorte…
Zero Escape Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 407    Accepted Submission(s): 190 Problem Description Zero Escape, is a visual novel adventure video game directed by Kotaro Uchiko…
Annoying problem Time Limit: 16000/8000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1006    Accepted Submission(s): 330 Problem Description Coco has a tree, whose nodes are conveniently labeled by 1,2,…,n, which…
In Touch Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 578    Accepted Submission(s): 160 Problem Description There are n soda living in a straight line. soda are numbered by 1,2,…,n from le…
MZL's City Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 743    Accepted Submission(s): 260 Problem Description MZL is an active girl who has her own country. Her big country has N cities numb…
Hiking Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 226    Accepted Submission(s): 126Special Judge Problem Description There are n soda conveniently labeled by 1,2,…,n. beta, their best fr…
MZL's endless loop Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1853    Accepted Submission(s): 400Special Judge Problem Description As we all kown, MZL hates the endless loop deeply, and h…
Buildings Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 185    Accepted Submission(s): 25 Problem Description Your current task is to make a ground plan for a residential building located i…
XYZ and Drops Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 505    Accepted Submission(s): 122 Problem Description XYZ is playing an interesting game called "drops". It is played on a r∗c…
Walk Out Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 639    Accepted Submission(s): 114 Problem Description In an n∗m maze, the right-bottom corner is the exit (position (n,m) is the exit).…
Solve this interesting problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1479    Accepted Submission(s): 423 Problem Description Have you learned something about segment tree? If not, don’…
Work Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 306    Accepted Submission(s): 217 Problem Description It’s an interesting experience to move from ICPC to work, end my college life and star…
Magician Time Limit: 18000/9000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 543    Accepted Submission(s): 151 Problem Description Fantasy magicians usually gain their ability through one of three usual methods:…
Bombing plan Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 416    Accepted Submission(s): 96 Problem Description Kingdom Y is in the war with kingdom X. Kingdom X consists of N cities,there…
Gorgeous Sequence Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 349    Accepted Submission(s): 57 Problem Description There is a sequence a of length n. We use ai to denote the i-th element…
Buildings Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 804    Accepted Submission(s): 222 Problem Description Your current task is to make a ground plan for a residential building located i…
2015 Multi-University Training Contest 1 A.OO's Sequence 计算每个数的贡献 找出第\(i\)个数左边最靠右的因子位置\(lp\)和右边最靠左的因子位置\(rp\) 对答案的贡献就是\((rp-i)*(i-lp)\) 最后答案就是\(\sum_{i=1}^{n}(rp_i-i)*(i-lp_i)\) 预处理出来所有的因子,复杂度\(O(n\sqrt{10000})\) //#pragma GCC optimize("O3") //#…
2015 UESTC Winter Training #8 The 2011 Rocky Mountain Regional Contest Regionals 2011 >> North America - Rocky Mountain 开始时貌似是UVAlive挂了,无论交什么都WA,后来转战HDU 这次水题比较多,其中B题据说有更加高级的方法. G题WA了两发,才发现竟然没有输出Case!!! 未完成:D F H I J A - Iterated Difference 水题,模拟迭代即可…