
STL
冰可乐小朋友
把事情想简单些,或许就会开心些
展开
-
acwing164. 可达性统计(拓扑排序+bitset)
给定一张N个点M条边的有向无环图,分别统计从每个点出发能够到达的点的数量。输入格式第一行两个整数N,M,接下来M行每行两个整数x,y,表示从x到y的一条有向边。输出格式输出共N行,表示每个点能够到达的点的数量。数据范围1≤N,M≤30000思路:先排好序,我们知道排完序越靠后的数是由前面的数转移过来的,这里用到bitset,可以计算1的个数。注意++tot#include<...原创 2019-10-21 18:07:52 · 278 阅读 · 0 评论 -
ICPC Asia Xuzhou 2019 B-so easy
There are nn points in an array with index from 11 to nn, and there are two operations to those points.1: x marking the point xx is not available2: x query for the index of the first available poin...原创 2019-09-07 20:33:39 · 182 阅读 · 0 评论 -
The 2019 Asia Nanchang First Round Online Programming ContestH The Nth Item(矩阵快速幂+unorderedmap)
#include<iostream>#include<cstdio>#include<cstring>#include<unordered_map>using namespace std;const int MOD=998244353;typedef long long ll;const int maxn =1e7+10;unorde...原创 2019-09-09 21:26:08 · 137 阅读 · 0 评论