//#define LOCAL#include#includeusing namespace
std;int const MAX_N=100001;int const INF=10000000;int N,M,x[MAX_N];void init(){
for(int i=0;i1) {...
分类:
其他好文 时间:
2014-05-19 17:20:45
阅读次数:
204
#includeusing namespace std;//大根堆,从小到达排序int
a[101];void swap(int &a,int &b){ a=a^b; b=a^b; a=a^b; }void adjust(int
*a,int root,int len){ int max=root;...
分类:
其他好文 时间:
2014-05-19 15:13:43
阅读次数:
219
无符号数相加不会发生溢出。因为会直接截断。但是有符号数相加,会发生溢出。溢出表示大于最大表示了那么如何判断有符号数发生溢出呢?下面两个非负数相加if(a + b
INT_MAX - b)可行,不计算a+b或者(unsigned)a + (unsigned)b > INT_MAX 换成无符号,a+b....
分类:
其他好文 时间:
2014-05-19 12:45:15
阅读次数:
206
题目链接:POJ 2828 Buy Tickets【题意】给了你 n(1 7 #include
8 #include 9 using namespace std;10 const int MAX = 200005;11 12 int pos[MAX],
val[MAX], ans[MAX];13.....
分类:
其他好文 时间:
2014-05-19 10:10:34
阅读次数:
282
题目链接:HDU 2795 Billboard【题意】给你一张h*w(1 7 #include
8 #include 9 using namespace std;10 const int MAX = 200005;11 12 int tree[MAX=
val)26 {27 ...
分类:
其他好文 时间:
2014-05-19 10:09:17
阅读次数:
419
//#define LOCAL#include#includeusing namespace
std;int const MAX_N=10005;int const MAX_M=100;int const INF=100000000;int
N,M,x[MAX_N],lb,ub;//判断是否满足条件...
分类:
其他好文 时间:
2014-05-18 19:38:50
阅读次数:
378
题目一:求1!+2!+…..+n! 的和的后6位,(注意n的范围)
#include
using namespace std;
const int MAX = 1000000;
int getResu(int n)
{
int sum=0;
int temp= 1;
for(int i=1; i <= n; i++)
{
temp *= i;
temp %= MAX;
...
分类:
其他好文 时间:
2014-05-18 03:36:19
阅读次数:
223
hash做法:#include#includeconst int Max =
100010;int home[Max],away[Max],hash[Max];int main(){ int n,sum,total; int i,j;
while(scanf("%d",&n)!=E...
分类:
其他好文 时间:
2014-05-17 21:44:37
阅读次数:
504
package edu.sjtu.erplab.io;import
java.util.Random;public class RandomTest { public static void main(String[]
args) { int max=20; int...
分类:
编程语言 时间:
2014-05-17 18:04:42
阅读次数:
239
POJ2533#include #include #define max(a, b)
(((a) > (b)) ? (a) : (b))void GetMaxIncLen(int *data, int *maxLen, int
size){ int i, j; for(i = 2; i max) ....
分类:
其他好文 时间:
2014-05-15 13:52:57
阅读次数:
259