hdu 2818 Building Block】的更多相关文章

Building Block Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3250    Accepted Submission(s): 973 Problem Description John are playing with blocks. There are N blocks (1 <= N <= 30000) numbere…
Building Block Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5811    Accepted Submission(s): 1790 Problem Description John are playing with blocks. There are N blocks (1 <= N <= 30000) number…
Problem Description John are playing with blocks. There are N blocks ( <= N <= ) numbered ...N.Initially, there are N piles, and each pile contains one block. Then John <= P <= ). There are two kinds of operation: M X Y : Put the whole pile co…
题意: 一共有30000个箱子,刚开始时都是分开放置的.接下来会有两种操作: 1. M x y,表示把x箱子所在的一摞放到y箱子那一摞上. 2. C y,表示询问y下方有多少个箱子. 输入: 首行输入一个整数m,表示一共有m次操作. 接下来每次操作都是上面所说的两种中的一种. 输出: 每次C y,输出一个结果,每次输出占1行. 就是不知道究竟是只有一组测试样例还是有多组测试样例,不过我还是按照多组的方式写了. 题解: 这道题我自己思考了好久都没有思路,最后中忍不住去看了题解,然后被题解震惊了.…
在进行并的时候不能瞎jb并,比如(x, y)就必须把x并给y ,即fa[x] = y #include <iostream> #include <string> #include <cstring> #include <algorithm> using namespace std; + ; int a[maxn]; int fa[maxn]; int Rank[maxn]; int cnt[maxn]; //种类 int Find(int x){ if (x…
http://acm.hdu.edu.cn/showproblem.php?pid=2818 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5935    Accepted Submission(s): 1838 Problem Description John are playing with blocks. There are N…
Problem Description After enjoying the movie,LeLe went home alone. LeLe decided to build blocks. LeLe has already built  piles. He wants to move some blocks to make  consecutive piles with exactly the same height . LeLe already put all of his blocks…
HDU 5033 Building(单调栈) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5033 Description Once upon a time Matt went to a small town. The town was so small and narrow that he can regard the town as a pivot. There were some skyscrapers in the town, each l…
Building Block Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 156 Accepted Submission(s): 70   Problem Description John are playing with blocks. There are N blocks (1 <= N <= 30000) numbered 1..…
Building Block Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3563    Accepted Submission(s): 1072 Problem Description John are playing with blocks. There are N blocks (1 <= N <= 30000) number…