Connections in Galaxy War Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3261 Appoint description: Description In order to strengthen the defense ability, many stars in galaxy allied together an…
链接:Destroying Array C. Destroying Array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given an array consisting of n non-negative integers a1, a2, ..., an. You are going to destro…
题解 给定一张图,支持删点和询问连通块个数 按操作顺序处理的话要在删除点的同时维护图的形态(即图具体的连边情况),这是几乎不可做的 我们发现,这道题可以先读入操作,把没删的点的边先连上,然后再倒序处理操作 这样的话从删点变成了加点,而且只要维护连通块的数量,用并查集可以快速的解决这个问题 代码 #include <bits/stdc++.h> using namespace std; const int maxn = 4 * 200000; int n, m, q[maxn]; vector&…
http://acm.hdu.edu.cn/showproblem.php?pid=3938 Portal Problem Description ZLGG found a magic theory that the bigger banana the bigger banana peel .This important theory can help him make a portal in our universal. Unfortunately, making a pair of po…
统计块个数写错了调了好久啊,BZOJ1696的弱化版本. #include <iostream> #include <cstring> #include <algorithm> #include <cstdio> #include <map> #define fi first #define se second #define mp make_pair #define pa pair<int,int> using namespace…