状态压缩dp#include#include#include#include#include#define maxn 16using namespace std;long long dp[1<<maxn];long long weapon[1<<maxn];int robot[maxn];char ...
分类:
其他好文 时间:
2014-07-16 18:35:59
阅读次数:
228
我们知道1——k有K!种排列,现在给定k和n,要你按字典序输出 第n种排列的数列而且题目给的 n是 n=S1(k-1)!+S2(k-2)!+...+Sk-1*1!+Sk*0!(0=#include #include #include #define N 50000+10using namespace...
分类:
其他好文 时间:
2014-07-16 18:11:03
阅读次数:
167
稍微有点新意的二分#include#include#include#include#include#include#include#define eps 0.000001#define maxn 5005using namespace std;int n;double w;struct node{ ...
分类:
其他好文 时间:
2014-07-16 17:47:10
阅读次数:
206
题目如下:
Stamps
The government of Nova Mareterrania requires that various legaldocuments have stamps attached to them so that the government canderive revenue from them. In ter...
分类:
其他好文 时间:
2014-07-16 17:23:55
阅读次数:
199
题目如下:
How Big Is It?
Ian's going to California, and he has to pack his things, including hiscollection of circles. Given a set of circles, your program mustfind the smallest r...
分类:
其他好文 时间:
2014-07-16 17:17:02
阅读次数:
259
题目如下:
Problem I
23 Out of 5
Input: standard input
Output: standardoutput
Time Limit: 1 second
Memory Limit: 32 MB
Your task is to writea program that can decide whether you can find an arithm...
分类:
其他好文 时间:
2014-07-16 17:16:32
阅读次数:
203
题目如下:
Mapping the Swaps
Sorting an array can be done by swapping certain pairs of adjacent entriesin the array. This is the fundamental technique used in the well-knownbubbl...
分类:
移动开发 时间:
2014-07-16 17:08:59
阅读次数:
252
题意:给出一列数(n个),m次查询区间[l,r]的最大连续区间[x,y](l
思路:动态查询区间最大连续区间;
如果是求最大连续区间和:
用线段树维护最大连续和sum_sub、最大前缀和sum_prefix、最大后缀和sum_suffix。
root.sum_sub = max{l.sum_sub, r.sum_sub, (l.sum_suffix + r.sum_prefix)...
分类:
其他好文 时间:
2014-07-16 11:42:15
阅读次数:
222
题目如下:
Don't Get Rooked
In chess, the rook is a piece that can move any number of squaresvertically or horizontally. In this problem we will consider smallchess boards (at most ...
分类:
其他好文 时间:
2014-07-16 10:16:07
阅读次数:
254
Description
Problem C
SAM I AM
Input: Standard Input
Output: Standard Output
The world is in great danger!! Mental's forces have returned to Earth to eradicate humankind. Our last hope to ...
分类:
其他好文 时间:
2014-07-16 10:15:05
阅读次数:
217