上一页 1 ··· 5 6 7 8 9 10 11 下一页
摘要: #include #include #include #include #include #include #include #include #include using namespace std;#define MAXN 200020#define MAX(a,b) (a>b?a:b)#define Lowbit(x) (x & (-x))int num[MAXN]={0,3,1,2,4,5... 阅读全文
posted @ 2015-01-29 11:27 sober_reflection 阅读(83) 评论(0) 推荐(0)
摘要: #include #include #define MAX 110#define OIL true#define BLANK falseusing namespace std;bool oil_map[MAX][MAX];int dir_map[8][2]={ {1,0},{-1,0},{0,1},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1} };void set_oil_... 阅读全文
posted @ 2015-01-29 11:27 sober_reflection 阅读(130) 评论(0) 推荐(0)
摘要: #define SIZE 1000#include bool p[SIZE];void prime(){ //我推荐这个算法! 易于理解。 只算奇数部分,时空效率都还不错! int half=SIZE/2; int sn = (int) sqrt(double(SIZE)); for (int i = 0; i < half; i++) p[i] = true;// 初始化全部奇数为素数。... 阅读全文
posted @ 2015-01-29 11:26 sober_reflection 阅读(147) 评论(0) 推荐(0)
摘要: #include#include#include "fstream"using namespace std;ifstream fin("read.txt");ofstream fout("result1.txt"); void zero(char *ch, int len) { int i; for(i=0; i>T; getchar(); while( T-- ) { //scanf("%s",... 阅读全文
posted @ 2015-01-29 11:26 sober_reflection 阅读(197) 评论(0) 推荐(0)
摘要: #include #include #include #include #include #include #include #include #include #define MAXN 100005#define LC(x) ((x) > 1)#define Min(a,b) ((a) (b) ? (a) : (b))long long int sum[MAXN=rht[rt]){ ... 阅读全文
posted @ 2015-01-29 11:25 sober_reflection 阅读(111) 评论(0) 推荐(0)
摘要: #include int f[1010]= {0, 1, 1};int main(){ int a, b; long long int n; while( ~scanf("%d%d%lld", &a, &b, &n) && a+b+n) { for(int i=3; i<=n; i++) //两个循环先建立小的查找数组 { ... 阅读全文
posted @ 2015-01-29 11:24 sober_reflection 阅读(83) 评论(0) 推荐(0)
摘要: #include #include #include #include #include using namespace std;#define INF 10000000int start;int over;bool sign[9];int NUM;int path[9][9];int road[9];void input() { path[0][0] = INF; path[0][1] ... 阅读全文
posted @ 2015-01-29 11:24 sober_reflection 阅读(125) 评论(0) 推荐(0)
摘要: /**/////////////////#include #include #include #include /*int cchkdig(char *r) { int i=0; while(r[i]!='\0') { if(isdigit(r[i++])==0) return (0); } return (... 阅读全文
posted @ 2015-01-29 11:23 sober_reflection 阅读(475) 评论(0) 推荐(0)
摘要: /*DescriptionBusinesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the University ... 阅读全文
posted @ 2015-01-29 11:22 sober_reflection 阅读(1170) 评论(0) 推荐(0)
摘要: #include #include #include #include #include #include using namespace std;int main(){ char c; map word; while((c=getchar() )!='#') { string temp=""; while(c!='\n'&&c!=' '&&c!='#') { temp+=c; c=... 阅读全文
posted @ 2015-01-29 11:22 sober_reflection 阅读(155) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 下一页