摘要:
/*Problem Description看病要排队这个是地球人都知道的常识。不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高,级别为1的优先权最低。医生在看病时,则会在他的队伍里面选择一个优先权最高的人进行诊... 阅读全文
posted @ 2015-01-29 11:33
sober_reflection
阅读(654)
评论(0)
推荐(0)
摘要:
/*=======================================================*\ | 递推求欧拉函数phi(i) 欧拉函数\varphi(n)是小于或等于n的正整数中与n互质的数的数目\*=======================================================*/ #define N 3000... 阅读全文
posted @ 2015-01-29 11:32
sober_reflection
阅读(403)
评论(0)
推荐(0)
摘要:
#include #define MAX 10000int c1[MAX], c2[MAX];// c1是保存各项质量砝码可以组合的数目// c2是中间量,保存每一次的情况// 每个n的种类无限// (1 + x^1 + x^2 + ...+ x^n)(1 + x^2 + x^4 +....+x^n)(1 + x^3 +...+ x^n)....(1 + x^n)int main(){ int n... 阅读全文
posted @ 2015-01-29 11:32
sober_reflection
阅读(104)
评论(0)
推荐(0)
摘要:
// 快速幂,powlong long int pow( int a, int b ) { long long int r = 1, base = a; while( b != 0 ) { if( b & 1 ) r *= base; base *= base; b >>= 1; } return r;} 来自为知笔记(Wiz)附件列表 阅读全文
posted @ 2015-01-29 11:32
sober_reflection
阅读(117)
评论(0)
推荐(0)
摘要:
int BitCount2(unsigned int n){ unsigned int c =0 ; for (c =0; n; ++c) { n &= (n -1) ; // 清除最低位的1 } return c ;} 来自为知笔记(Wiz)附件列表 阅读全文
posted @ 2015-01-29 11:31
sober_reflection
阅读(132)
评论(0)
推荐(0)
摘要:
#include#include#include //vector的头文件#include //next_permutation prev_permutation的头文件,排列无重复using namespace std; int main(){ string s; vector v; //容器内存有大小,以及容量 int x,y,z,q; int i=0; ... 阅读全文
posted @ 2015-01-29 11:31
sober_reflection
阅读(247)
评论(0)
推荐(0)
摘要:
/*=======================================================*\ | 递推求欧拉函数phi(i) 欧拉函数\varphi(n)是小于或等于n的正整数中与n互质的数的数目\*=======================================================*/ #define N 3000... 阅读全文
posted @ 2015-01-29 11:31
sober_reflection
阅读(238)
评论(0)
推荐(0)
摘要:
#include #include #include using namespace std;int lowbit(int x) //make sure the set of the array { return x&(-x);}int sum(int end ,int all[]) //solve sum{ int sum=0; while(end > 0) { sum+=all[... 阅读全文
posted @ 2015-01-29 11:30
sober_reflection
阅读(212)
评论(0)
推荐(0)
摘要:
#define TABLE_SIZE 200003struct Node { char key[12], value[12]; bool flag; Node () { flag = false; }} table[TABLE_SIZE];unsigned int BKDRHash(char *key) { unsigned int seed = 131; unsigned int has... 阅读全文
posted @ 2015-01-29 11:29
sober_reflection
阅读(130)
评论(0)
推荐(0)
摘要:
#include "iostream"#include "cmath"using namespace std;int sort(int a[],int n){ int temp,all=0; for(int i=0;ia[j]) {temp=a[i];a[i]=a[j];a[j]=temp;} } for(int i=0;i>M; while(M--) { int a[100000];... 阅读全文
posted @ 2015-01-29 11:29
sober_reflection
阅读(89)
评论(0)
推荐(0)