uva10790:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1731题意:两条水平线,分别有n,m个点,点之间两两连线,求有多少个交点。题解:手动模拟一...
分类:
其他好文 时间:
2014-07-16 18:46:50
阅读次数:
182
状态压缩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
题目如下:
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
/*
E - E
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu
Submit
Status
Practice
UVA 10474
Description
Where is the Marble?
Raju and Meena love to play with Marbles. T...
分类:
其他好文 时间:
2014-07-14 17:26:26
阅读次数:
269
题目:已知S = Σ(i^i)其中(1
分析:数论,找规律。设 i = 10*a+b 则 i^i = (10*a+b)^(10*a+b),有:
记f(i)=(i^i)% 10 = (10*a+b)^(10*a+b)% 10 = b ^(10*a+b) { 二项式定理 }
利用f(i)找规律:
f(10*k+0)...
分类:
其他好文 时间:
2014-07-14 17:00:43
阅读次数:
557