随笔分类 -  USACO

摘要:就是线性筛嘛。。线性筛到处都有,本蒟蒻就不没事介绍了。Code:#include <iostream>#include <cstdio>#include <cmath>#include <algorithm>#include <cstdlib>using namespace std;int getlog(int a,int b){ return log(b)/log(a);}int f[10000001],p[1000001];int main(){ int n,tot=0; cin >>n; for (int i=2;i 阅读全文
posted @ 2012-06-02 21:49 JS_Shining 阅读(185) 评论(0) 推荐(0)
摘要:就一个最小生成树。本蒟蒻还交了三次,最后才发现是数组开小了。。不能再刷水题了。。。Code:#include <iostream>#include <cstdio>using namespace std;const long maxn=999999999;long pre[301];long g[301][301];int v[301];int main(){ long n; cin >>n; pre[0]=0; for (int i=1;i<=n;i++){ cin >>g[0][i]; pre[i]=g[0][i]; v[i]=1; } 阅读全文
posted @ 2012-05-14 22:22 JS_Shining 阅读(461) 评论(0) 推荐(0)