2019icpc西安邀请赛】的更多相关文章

Tree Ming and Hong are playing a simple game called nim game. They have nn piles of stones numbered 11 to nn ,the ii-th pile of stones has a_iai​ stones. There are n - 1n−1 bidirectional roads in total. For any two piles, there is a unique path from…
打印的时候麻烦把:https://blog.csdn.net/skywalkert/article/details/50500009这个打印下来. 求\(\prod\limits_{i=1}^{n} \prod\limits_{j=1}^{n} \prod\limits_{k=1}^{n} m^{gcd(i,j)[k|gcd(i,j)]} mod p\) 欧拉定理: \(m^{ \sum\limits_{i=1}^{n} \sum\limits_{j=1}^{n} \sum\limits_{k=…
开始时因为吃饭晚了一刻钟,然后打开比赛.看了眼榜单A题已经过了二十来个队伍了,宝儿就去做A. 传师说最后一题看题目像最短路,于是我就去看M了,宝儿做完之后也来陪我看.M一开始看到时以为是像   POJ的Frogger   一样,求S 到T 的路径中的最小距离最大值.后来发现对路径中走过的边数也有限制.于是又去想,然后想到把原本记录到此点最短距离的Dis[] 变成 记录到达此点所需要飞行器最低等级的Dis_Level[],这样剩下的就是普通的Dijkstra了.做完M之后比赛进行了大概一个半小时.…
Travel There are nn planets in the MOT galaxy, and each planet has a unique number from 1 \sim n1∼n. Each planet is connected to other planets through some transmission channels. There are mm transmission channels in the galaxy. Each transmission cha…
Swap There is a sequence of numbers of length nn, and each number in the sequence is different. There are two operations: Swap the first half and the last half of the sequence (if nn is odd, the middle number does not change) Swap all the numbers in…
Angel's Journey “Miyane!” This day Hana asks Miyako for help again. Hana plays the part of angel on the stage show of the cultural festival, and she is going to look for her human friend, Hinata. So she must find the shortest path to Hinata’s house.…
Tasks It's too late now, but you still have too much work to do. There are nn tasks on your list. The ii-th task costs you t_iti​seconds. You want to go to bed TT seconds later. During the TT seconds, you can choose some tasks to do in order to finis…
题目链接:https://nanti.jisuanke.com/t/39277 题意:给出一棵有边权的树,求所有简单路径包含异或和为0的简单路径的总数和. 思路: 首先,对于异或为0这一限制,我们通过dfs得到根节点到所有点的路径上的异或和val[i],如果两个结点的val值相等,说明他们之间的路径满足异或和为0.sz [i]为以i为根的子树 的大小. 其次,对于满足异或和为0的两个点u.v,分两种情况考虑: 1. u.v在不同链上,这一条路径的贡献值为sz[u]*sz[v],通过map记录每一…
题意:给定一棵n个点带边权的树,定义每条路径的值为路径上边权的异或和 如果一条路径的值为0,其对答案的贡献为所有包含这条路径的路径条数 求答案膜1e9+7 n<=1e5,0<=边权<=1e18 思路: 做法一:点分治 参考https://dudulu.net/blog/?p=1654 考场上还剩2小时的时候开的这题,乍一看觉得很可做就是个裸的点分,结果发现自己不会算贡献,场上连样例都没调出来 现在也是写了两天发现不会算贡献,参考了dalao的博客才会 每条路径的权值可以用两个端点分别能扩…
来源:https://www.jisuanke.com/contest/2625?view=challenges 更新中 A.Tasks 直接贪心 代码:听说当时很多队伍提前拆题甚至上机了,所以很多0min #include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> #include<string> #include…