Description Panagola, The Lord of city F likes to parade very much. He always inspects his city in his car and enjoys the welcome of his citizens. City F has a regular road system. It looks like a matrix with n+1 west-east roads and m+1 north-south r…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3401 Trade Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) 问题描述 Recently, lxhgww is addicted to stock, he finds some regular patterns after a few days' study. He forecast…
链接:HDU - 3415 题意:给出一个包含 n 个数的环,求满足长度大于 0 小于等于 k 的最大区间和. 题解:将数组加倍,形成环.求一个前缀和sum.枚举每一个sum[i],以 i 结尾的最大值就是 sum[i] - min(sum[i - k],……,sum[i - 1]),这个最小值用单调队列维护. #include <bits/stdc++.h> using namespace std; ; const int INF = 0x3f3f3f3f; ; ; int n, k, l,…
题面: Fxx and game Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 2264 Accepted Submission(s): 600 Problem Description Young theoretical computer scientist Fxx designed a game for his students. In…
http://acm.hust.edu.cn/vjudge/problem/25790 这题基本同poj 3162 要注意mx,mx2,vx,vx2每次都要初始化 #include <iostream> #include <string> #include <cstring> #include <cstdlib> #include <cstdio> #include <cmath> #include <algorithm>…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4749 题目大意:给一个原序列N,再给出一个序列M,问从N中一共可以找出多少个长度为m的序列,序列中的数的相对大小关系与序列M中相对大小关系相同.(序列之间不能重叠) 解题思路:从头开始以i为起点暴搜,不断找长度为m的序列,判断是否满足条件.若满足,跳到i+m之后继续搜,若不满足,向后移一位继续搜. 判断方法压缩数据比较相对大小. #include<cstdio> #include<cstri…
Description Too worrying about the house price bubble, poor Mike sold his house and rent an apartment in a 50-floor building several months ago. This building has only one elevator because it is a so called “rotten tail building”. There are always a…
Description N(3<=N<=20000) ping pong players live along a west-east street(consider the street as a line segment). Each player has a unique skill rank. To improve their skill rank, they often compete with each other. If two players want to compete,…
Description John is the only priest in his town. October 26th is the John's busiest day in a year because there is an old legend in the town that the couple who get married on that day will be forever blessed by the God of Love. This year N couples p…
Description For a tree, which nodes and edges are all weighted, the ratio of it is calculated according to the following equation. Given a complete graph of n nodes with all nodes and edges weighted, your task is to find a tree, which is a sub-graph…