今天比赛的时候做的一个坑题.深坑啊. 题目意思是给你一个有n个数的数字序列.要你判断对于这个序列是都满足任意一个子序列都至少含有一个只出现一次的数字. 看完题目后没什么思路,一直以为要用线段树,每次删除一个点,然后更新,后来发现wa了,算法有问题. 后来殷犇讲了一种水过去的方法,听完后瞬间就水过了. 其实我们可以这样去做,对于数组中的每个数,我们建立一个指针指向这个数字下一次在数组中出现的位置. 然后核心的水的地方来了,如果我们已知一个区间中存在某一个数字只出现一次,假设区间为[l,r],这个只…
6343.Problem L. Graph Theory Homework 官方题解: 一篇写的很好的博客: HDU 6343 - Problem L. Graph Theory Homework - [(伪装成图论题的)简单数学题] 代码: //1012-6343-数学 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<bitset&g…
Boring Class Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 900    Accepted Submission(s): 247 Problem Description Mr. Zstu and Mr. Hdu are taking a boring class , Mr. Zstu comes up with a prob…
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=6336 Problem E. Matrix from Arrays Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1711    Accepted Submission(s): 794 Problem Description Kazari…
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=6341 Problem J. Let Sudoku Rotate Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1363    Accepted Submission(s): 717 Problem Description Sudoku i…
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=6342 Problem K. Expression in Memories Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2150    Accepted Submission(s): 772Special Judge Problem De…
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6343 Problem L. Graph Theory Homework Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1536    Accepted Submission(s): 830 Problem Description Ther…
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=6333 Problem B. Harvest of Apples Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 4043    Accepted Submission(s): 1560 Problem Description There a…
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6324 Problem F. Grab The Tree Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1234    Accepted Submission(s): 779 Problem Description Little Q and…
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=6319 Problem A. Ascending Rating Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 5943    Accepted Submission(s): 2004 Problem Description Before…