题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5172
题意:给出n个数,m个询问,问你[l,r]区间内是否为1到r-l+1的全排列。 大小很容易我们通过记录前缀和很容易求出来,但是关键是去重。 考虑线段树做法,我们记录每个点的靠左最近的相同元素的位置,然后求 整个区间的最大值(即最大的前驱)如果小于l,即满足条件,输出YES。
好吧,其实这个题...
                            
                            
                                分类:
其他好文   时间:
2015-08-04 21:11:56   
                                阅读次数:
113
                             
                    
                        
                            
                            
                                Problem Description
My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to ...
                            
                            
                                分类:
其他好文   时间:
2015-08-03 14:38:08   
                                阅读次数:
102
                             
                    
                        
                            
                            
                                You have two friends. You want to present each of them several positive integers. You want to presentcnt1numbers to the first friend andcnt2numbers to...
                            
                            
                                分类:
其他好文   时间:
2015-08-02 16:31:21   
                                阅读次数:
124
                             
                    
                        
                            
                            
                                题意:有n个人m对朋友,朋友有两种一种online的,一种face to face的。现在要让你对这些朋友性质进行安排,让每一个人的线上朋友和线下朋友人数是相同的,求满足的方案数。思路直接暴力染色。 
然后减减枝。 
一个就是对于每个人的度一定是偶数。 
另外一个就是染色中,对于一个节点染色的不能超过一半才能继续dfs。参考code:/*
 #pragma warning (disable: 478...
                            
                            
                                分类:
其他好文   时间:
2015-07-30 23:22:29   
                                阅读次数:
159
                             
                    
                        
                            
                            
                                CodeForces
 - 315A
Sereja and Bottles
Time Limit: 2000MS
 
Memory Limit: 262144KB
 
64bit IO Format: %I64d & %I64u
Submit Status
Description
Sereja and his friends we...
                            
                            
                                分类:
其他好文   时间:
2015-07-30 02:08:30   
                                阅读次数:
92
                             
                    
                        
                            
                            
                                Problem Description
Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the frien...
                            
                            
                                分类:
其他好文   时间:
2015-07-29 19:24:00   
                                阅读次数:
109
                             
                    
                        
                            
                            
                                Virtual FriendsTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6636Accepted Submission(s): 1888Pro...
                            
                            
                                分类:
其他好文   时间:
2015-07-29 13:38:23   
                                阅读次数:
114
                             
                    
                        
                            
                            
                                Problem Description:TT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing TT to play the following g...
                            
                            
                                分类:
其他好文   时间:
2015-07-28 18:21:09   
                                阅读次数:
111
                             
                    
                        
                            
                            
                                题意:t组数据,每组一个n和m表示点数和边数,接下来m条边,每条边两种状态,求每个点邻接边的两种状态数目相同的排列方式有几种
分析:从第一个顶点开始往下深搜每条边,每条边两种状态,注意回朔。
代码:
#include
#include
#include
#include
using namespace std;
const int maxn = 10;
int n,m,ans...
                            
                            
                                分类:
其他好文   时间:
2015-07-28 13:16:38   
                                阅读次数:
83
                             
                    
                        
                            
                            
                                F - Finding Seats Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1937Description A group of K friends ...
                            
                            
                                分类:
其他好文   时间:
2015-07-27 09:22:32   
                                阅读次数:
138