摘要: 题面链接:https://gmoj.net/senior/#main/show/6835 Description Input Output Solution 这道题主要是找结论,找到结论就好做了 对于一个三角形,它的中点三角形的外接圆的圆心就是答案 如上图的三角形中,显然$\triangle ABC 阅读全文
posted @ 2020-10-31 21:24 Sport_River 阅读(81) 评论(0) 推荐(0) 编辑
摘要: Description Input Output 一行一个整数,表示满足条件的子序列的个数除以 998 244 353 的余数。 Sample Input Sample Input1 3 0 0 1 2 Sample Input2 3 2 0 1 2 Sample Input3 3 3 0 1 2 阅读全文
posted @ 2020-10-28 21:04 Sport_River 阅读(72) 评论(0) 推荐(0) 编辑
摘要: Description Input Output Solution 这道题显然最大的k是S到T的距离 然后就是染色 跑遍最短路,对于距离小于等于k的点的连边直接染色 但对于那些距离大于k的点,防止错误,直接染成1就好了 (最好不要染0,很容易错) Code #include <cstdio> #in 阅读全文
posted @ 2020-10-27 22:25 Sport_River 阅读(91) 评论(0) 推荐(0) 编辑
摘要: Description 世界可以抽象成一个长度为偶数n 且元素互不相同的数列a。每当发生了一些意外,他都会相应的产生一些变化,并成为一个新的数列a′,并且它们满足以下关系: 如果这个数列正好经过n 次变换后首次回到最初始的数列a ,这个世界便是幸运的。此时的幸运值是n;如果没有回到最初始的序列,幸运 阅读全文
posted @ 2020-10-24 19:53 Sport_River 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Description You are given a rooted tree with n nodes, labeled from $1$ to \(n\). The tree is rooted at node $1$. The parent of the i-th node is \(p_i\ 阅读全文
posted @ 2020-10-23 20:30 Sport_River 阅读(66) 评论(0) 推荐(0) 编辑
摘要: Description You are given a permutation p of n integers 1, 2, ..., n (a permutation is an array where each element from 1 to n occurs exactly once). L 阅读全文
posted @ 2020-10-22 21:43 Sport_River 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Description Input Output Solution 分成几种情况来讨论依次一下: 1.当找不到$kk$的矩阵时,显然是后手赢了 2.当找到有且仅有一个$kk$的矩阵(及不存在其他矩阵或其他矩阵都与该矩阵相交)时,先手胜 3.当找到2个或2个以上的互不相交的$kk$的矩阵时: 因为一旦 阅读全文
posted @ 2020-10-20 21:27 Sport_River 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Description Input 共一行,包含一个正整数 x。含义详见题面。 Output 输出一行一个实数,表示答案。 Solution 设ans为期望多少刀暴击一刀,则$\frac{1}$就是答案 设exp[i]表示期望i刀暴击1刀 则$ans=\sum_^{\frac{100}}exp[i] 阅读全文
posted @ 2020-10-20 21:12 Sport_River 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Description Input Output Solution 就是你有10个棋子,有一条边数为t的链和一个边数为c的环(t和c未知)组成的有向图,每次操作可以让一些棋子移动一步,让你在不超过$3 \times (t+c)$次操作下让所有点移动到链和环连接的点处 首先我们考虑两个点动,剩下的点走 阅读全文
posted @ 2020-10-15 21:40 Sport_River 阅读(68) 评论(0) 推荐(0) 编辑
摘要: Description Input Output Solution 这是一道交互题 就是有一颗n个点的树,让你在11111次询问内求出这棵树的结构 因为$n \leqslant 500$,所哟一我们可以乱搞 我们先钦定1为根,则可以用n-1次算出以i为根的子树的节点数 然后我们将节点数排序 因为每个 阅读全文
posted @ 2020-10-15 21:26 Sport_River 阅读(76) 评论(0) 推荐(0) 编辑