Problem Description Given an undirected graph G=(V,E). All vertices are numbered from 1 to N. And every vertex u has a value of Au. Let Su={Av│(u,v)∈E}. Also, F(u) equals MEX(minimum excludant) value
Problem Description Little Q’s factory recently purchased m pieces of new equipment, labeled by 1,2,…,m. There are n workers in the factory, labeled by 1,2,…,n. Each worker can be assigned to no more
题意: 一个小球在一个等边三角形内碰撞,碰撞速度不比,方向沿边镜像翻折。求发送 k k k次碰撞需要多少时间 思路: 一开始想着是模拟,然后估摸着最后会形成循环,经过起始点。但是太难模拟了。。 看了题解发现,真的特别巧妙。反射意味着穿过!那么就成了全是等边三角形铺成的平面,已知起点和速度。求经过 k k k条边的最短时间。 这个时间可以二分。 仅考虑平行x轴的边,那就直接用 a b s ⌊
Problem Description It is preferrable to read the pdf statment. Two strings are called cyclical isomorphic if one can rotate one string to get another one. ‘Rotate’ here means ‘‘to take some consecut
Problem Description For a given permutation a1,a2,⋯,an of length n, we defined the neighbor sequence b of a, the length of which is n−1, as following: bi={01ai<ai+1ai>ai+1 . For example, the neighbo
1002 Blow up the city (支配树) http://acm.hdu.edu.cn/showproblem.php?pid=6604 题意 给你个DAG图 然后若干次询问 每次询问给你两个点 问你去掉某个点使这量两个点不能到达最终点 进阶版 https://blog.csdn.net/sdut_jk17_zhangming/article/details/98069924
A A Static Query on Tree 题意:给定一个 1 1 1 为根的内向树, q q q 次询问,每次给出三个点集合 A , B , C A,B,C A,B,C,问有几个点能从 A A A 集合和 B B B 集合中至少一个点到达,并且到达 C C C 中的一个点。 保证 ∑ ∣ A ∣ + ∑ ∣ B ∣ + ∑ ∣ C ∣ ≤ 2 × 1 0 5 \sum |A|
2022杭电多校第五场 Slipper(最短路) 题意 有一个以 1 1 1为根的有根树,每条边有一个边权 w w w,经过一条边消耗边权大小的能量。如果树上两点 u u u, v v v之间深度之差恰好为 k k k,则两点之间可以相互到达,从 u u u到 v v v或从 v v v到 u u u消耗能量 p p p,问从 s s s到 t t t消耗的最少能量。 分析 建图跑最短路