- 博客(7)
- 收藏
- 关注
原创 at-070D
并查集模板 并查集是将有关系的一系列元素组合成为一个集合并且区分出没有关联的集合元素,#include<iostream> using namespace std; const int N = 1e5+5; int fa[N],Rank[N],n; void init() { for(int i=1;i<=n;i++) { fa[i]=i;//自己为自己的父节
2017-08-18 20:22:23
311
原创 codeforces 804B
B. Minimum number of steps time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output We have a string of letters 'a' and 'b'. We want to p
2017-08-18 16:28:14
349
原创 图的储存
对于图的储存是做图论题的基础,图的储存主要有两种方式,一个是邻接表,一个是邻接矩阵。两种储存方式有时候可以通用,但有一些图论题却不能混用。 邻接矩阵实现方式很简单,直接就是创建一个二维数组G[N][N],对于点x,y,G[x][y]的值就是x->y这一条边的权值。 #include #define INF 0x3f3f3f3f using namespace std; int G[N][N
2017-08-18 14:59:35
390
原创 codeforces 808C
C. Tea Party time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp invited all his friends to the tea party to celebrate the
2017-08-17 19:33:14
338
原创 codeforces 810B
B. Summer sell-off time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Summer holidays! Someone is going on trips, someone is visiti
2017-08-17 16:27:16
358
原创 atcoder-abc-070D
Time limit : 2sec / Memory limit : 256MB Score : 400 points Problem Statement You are given a tree with N vertices. Here, a tree is a kind of graph, and more specifically, a connected undirect
2017-08-15 17:58:54
479
原创 codeforces 837 C
C. Two Seals time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One very important person has a piece of paper in the for
2017-08-15 17:33:31
829
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人