- 博客(3)
- 收藏
- 关注
原创 并查集模板题 The Suspects
#include #include #include using namespace std; const int MAX_SIZE = 1e7+5; int a[MAX_SIZE]; int per[MAX_SIZE]; int ans; int find(int x){ if(per[x]!=x){ return per[x] = find(per[x]);
2017-04-23 17:14:08 428
原创 bfs模板
最小步数模板题:Background Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him? The Problem
2017-04-15 12:10:14 360
原创 快速求素数模板
void prime(int *a){ a[1]=1; for(int i=2;i<=maxn;i++){ if(a[i]==0){ for(int j=2;j*i<=maxn;j++){ a[i*j]=1; } } } }
2017-04-01 09:27:26 511
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人