摘要: 手贱,一个地方敲错,浪费时间了。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: sprime 5 */ 6 #include <cstdio> 7 #include <cstring> 8 #include <cmath> 9 #include <algorithm>10 using namespace std;11 #define N 100000112 long long p[300001];13 int o[N],prim[100001],num,len,n;14 int judge(int x)15 {16 阅读全文
posted @ 2012-11-02 17:34 Naix_x 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 本来想筛选素数的。。。交了之后发现复杂度也太高了。。。可耻的看了一下hint,然后就各种for枚举了每一位了。.。 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: pprime 5 */ 6 #include <cstdio> 7 #include <cstring> 8 #include <cmath> 9 #include <algorithm> 10 using namespace std; 11 #define N 1000001 12 bool p[N]; 13 int prim[100000],num; 1 阅读全文
posted @ 2012-11-02 16:53 Naix_x 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 经典的数字三角形 1 /* 2 ID: cuizhe 3 LANG: C++ 4 TASK: numtri 5 */ 6 #include <cstdio> 7 #include <cstring> 8 #include <cmath> 9 #include <algorithm>10 using namespace std;11 #define LL long long12 int dp[1001][1001];13 int main()14 {15 int i,j,n;16 freopen("numtri.in",&quo 阅读全文
posted @ 2012-11-02 09:53 Naix_x 阅读(139) 评论(0) 推荐(0) 编辑