上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: hint1就是解决问题的关键:Generate the palindromes and see if they are prime.有目的的生成要比无目的逐一验证更有效率,当然前提是得存在有效的生成方法。/* ID:chenjiong PROG:pprime LANG:C++*/#include <stdio.h>#include <string.h>#include <math.h>const int MAXN = 20000;int palin[MAXN];int cnt;int a,b;void p1(){ palin[cnt++] = 5; pali 阅读全文
posted @ 2012-10-26 23:03 Sinker 阅读(243) 评论(0) 推荐(0) 编辑
摘要: /* ID:chenjiong PROG:numtri LANG:C++*/#include <stdio.h>#include <string.h>const int MAXN = 1005;int N;int mat[MAXN][MAXN];int dp[MAXN][MAXN];int ans;int max(int x,int y){ return x > y ? x : y;}void solve(){ dp[0][0] = mat[0][0]; int i,j; for ( i = 1; i < N; i++) { dp[... 阅读全文
posted @ 2012-10-25 21:14 Sinker 阅读(121) 评论(0) 推荐(0) 编辑
摘要: /* ID:chenjiong PROG:numtri LANG:C++*/#include <stdio.h>#include <string.h>const int MAXN = 1005;int N;int mat[MAXN][MAXN];int cnt;int sum;int max = 0;void dfs(int x,int y){ if ( x == N ) { if ( sum > max ) max = sum; return; } sum += mat[x + 1][y]; d... 阅读全文
posted @ 2012-10-25 20:31 Sinker 阅读(114) 评论(0) 推荐(0) 编辑
摘要: /* ID:chenjiong PROG:ariprog LANG:C++*/#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;const int MAXN = 250;typedef struct { int a; int d;}ARIPROG;bool is_bisquare[2 * MAXN * MAXN + 1];int bisquare[( MAXN + 1 ) * ( MAXN + 1 )];int cnt = 0;int N,M;int u_ 阅读全文
posted @ 2012-10-25 19:51 Sinker 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 以前做过,不过是是看着别人代码做的。今天手痒重新做一遍,两处剪枝还是没想到。还有,我真是快爱死了深搜+回溯。#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;const int MAXN = 64;int N;int s[MAXN];bool vis[MAXN];int len;int used;int rest;bool dfs(int num){ if ( used == N && rest == 0 ) return true; fo 阅读全文
posted @ 2012-10-20 01:20 Sinker 阅读(150) 评论(0) 推荐(0) 编辑
摘要: CREATE DATABASE BANK_SYSTEMON ( NAME = bank_dat, FILENAME = 'F:\bank_dat.mdf', SIZE = 10MB, MAXSIZE = 50MB, FILEGROWTH = 5MB)LOG ON( NAME = bank_log, FILENAME = 'F:\bank_log.ldf', SIZE = 5MB, MAXSIZE = 25MB, FILEGROWTH = 5MB );GOUSE BANK_SYSTEMGOCREATE TABLE customer ... 阅读全文
posted @ 2012-10-18 22:45 Sinker 阅读(236) 评论(0) 推荐(0) 编辑
摘要: /* ID:chenjiong PROG:clocks LANG:C++*/#include <cstdio>#include <string>#include <queue>#include <iostream>#include <string.h>using namespace std;typedef struct { int clock[9]; string opt;}S;S f;queue<S> q;bool vis[4][4][4][4][4][4][4][4][4];void move(S& cur,i 阅读全文
posted @ 2012-10-18 22:43 Sinker 阅读(180) 评论(0) 推荐(0) 编辑
摘要: /* ID:chenjiong PROG:barn1 LANG:C++*/#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;const int MAXN = 205;int M,S,C;int p[MAXN];int l[MAXN];bool cmp(const int& x,const int& y){ return x > y;}int main(){ freopen("barn1.in","r&qu 阅读全文
posted @ 2012-10-18 22:42 Sinker 阅读(142) 评论(0) 推荐(0) 编辑
摘要: /* ID:chenjiong PROG:calfflac LANG:C++*/#include <stdio.h>#include <string.h>#include <iostream>using namespace std;char txt[20005];int len;typedef struct { int l; int r; int mid; int length;}NODE;NODE final;NODE tmp;bool is_same(char a,char b){ if ( a == b || a - b == 'A' 阅读全文
posted @ 2012-10-18 22:41 Sinker 阅读(134) 评论(0) 推荐(0) 编辑
摘要: /* ID:chenjiong PROG:milk3 LANG:C++*/#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;int bucket[3];int amount[3];int ans[20];int num;bool vis_2[21];bool vis[21][21][21];int order[6][2] = {{2,1},{2,0},{1,0},{1,2},{0,1},{0,2}};bool is_empty(int No){ if ( 阅读全文
posted @ 2012-10-18 22:40 Sinker 阅读(142) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页