
acm模板
竟然有人也叫Webwei
这个作者很懒,什么都没留下…
展开
-
高效素数打表模板
#include#include#include#include#includeusing namespace std;#define N 100000int h=0;bool p[N];int prime[N];void db(){ memset(p,true,sizeof(p)); for(int i=2;i<N;i++) { if(p[i]==true)原创 2016-12-12 10:52:58 · 1453 阅读 · 0 评论 -
fread 读入挂模板
templateinline bool scan_d(T &ret){ char c; int sgn; if(c=getchar(),c==EOF) return 0; while (c != '-' && (c '9') ) c = getchar(); sgn = (c == '-') ? -1 : 1; ret = (c == '-') ? 0原创 2016-12-05 15:12:38 · 879 阅读 · 0 评论 -
矩阵快速幂模板
// poj3070#include#include#includeusing namespace std;struct jz{ int a[2][2]; void init(){ a[0][0]=a[0][1]=a[1][0]=1; a[1][1]=0; }};jz multi(jz a,jz b){ jz c; for(int i=0;i<2;i++) {原创 2016-12-09 23:36:51 · 327 阅读 · 0 评论 -
最小生成树模板(Kruskal和prim)
http://acm.hdu.edu.cn/showproblem.php?pid=1863// >File Name: 最小生成树Kruskal.cpp// > Author: Webwei#include#include#define MAX 113using namespace std;struct edge{ int from,to; long原创 2017-03-21 18:30:22 · 383 阅读 · 0 评论 -
(N!)大数阶乘 模板
//hdu 1042#include#include#define MAX 100000using namespace std;int main(){ int a[MAX] = { 0 }; int n; int i, j, k, count, temp; while (cin >> n) { a[0] = 1;原创 2017-04-12 17:43:51 · 655 阅读 · 0 评论