题目描述 Afandi is herding N sheep across the expanses of grassland  when he finds himself blocked by a river. A single raft is available for transportation.Afandi knows that he must ride on the raft for all crossings, but adding sheep to the raft makes…
题1:1160十进制-十六进制 注意他给的数据范围 2^31,int是 2^31-1 #include<iostream> using namespace std; int main() { unsigned int n; while(scanf("%u",&n)!=EOF) printf("0x%08X\n",n); ; } 题2:1161Sums这题虽然是大数相加,但是有别于以前的大数相加,给你n(位),然后输入a,b,表示两个数的一位的数,…
Problem E Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 635    Accepted Submission(s): 111 Problem Description 在数据维护的过程中,保持高效的数据访问和修改是非常重要的工作,这个题目就需要你用高效的手段来维护一段数据并执行不同的操作. 我们首先用如下公式生成一个矩阵A:…
比赛链接: http://202.197.224.59/OnlineJudge2/index.php/Contest/problems/contest_id/36 题目来源: 2014嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛 ×  Problem A A simple problem   (求N % 1 + N % 2 + ....+ N % N, 待补) ?  Problem B Path √  Problem C Range   (单调栈) √  Problem…
nyoj-1365-山区修路 内存限制:128MB 时间限制:3000ms 特判: No通过数:4 提交数:4 难度:3 题目描述: SNJ位于HB省西部一片群峰耸立的高大山地,横亘于A江.B水之间,方圆数千平方公里,相传上古的神医在此搭架上山采药而得名.景区山峰均在海拔3000米以上,堪称"华中屋脊".SNJ是以秀绿的亚高山自然风光,多样的动植物种,人与自然和谐共存为主题的森林生态区.SNJ处于中国地势第二阶梯的东部边缘,由大巴山脉东延的余脉组成中高山地貌,区内山体高大,高低不平.…
C:  最舒适的路线 (并查集) #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; #define INF 20000000 struct point { int x, y, v; }; point node[]; ]; bool cmp(point a, point b) { return a.v < b.v;/…
Biggest Number http://acm.hust.edu.cn/vjudge/contest/view.action?cid=30851#problem/F 解题思路:DFS(检索)+BFS(探路)=强剪枝 一看就知道是搜索题,只是,要是DFS裸搜,真的会超时.时间,非常紧! 做该题的时候,要无时无刻不忘剪枝,抓住一切剪枝的机会,剪吧! (1)用flag记录当前检索的值与当前已经检索到的最大值的关系,一但有机会,就要剪掉那些检索到的值会比当前最大值要小的“残枝败叶”. (2)每次DF…
Problem Description The famous "Alice and Bob" are playing a game again. So now comes the new problem which need a person smart as you to decide the winner. The problem is as follows: They are playing on a rectangle paper, Alice and Bob take tur…
描述 GFW had intercepted billions of illegal links successfully. It has much more effect. Today, GFW intercepted a message of a mysterious organization. This mysterious organization package the message in legitimate URL. To find the Black Hand behind t…
描述 A heap is a full binary tree; for each node, its key is greater than its two sub-node’s key. Two heaps are different if there are two nodes which have different keys at the same location. Now we have a problem for you: tell me how many different N…