A. Hard to prepare After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nogaku show during the feast. To enjoy the show, every audience has to wear a Nogaku mask, and seat around as a circle. There are…
https://nanti.jisuanke.com/t/31453 题目 有n个格子拉成一个环,给你k,你能使用任意个数的0 ~ 2^k - 1,规定操作 i XNOR j 为~(i  ^  j),要求相邻的格子的元素的XNOR为正数,问你有几种排法,答案取模1e9 + 7.本题所使用的数字为无符号位数字. 分析 因为都是无符号了,那么题目就是要求相邻的数同或的结果不为0,即异或的结果不为2^k-1. 第1个数有种选择,第2个数到第n-1个数都有种选择,第n个数有种选择 所以答案就是 可是当第…
https://nanti.jisuanke.com/t/31453 题目大意: 有n个人坐成一圈,然后有\(2^k\)种颜色可以分发给每个人,每个人可以收到相同的颜色,但是相邻两个人的颜色标号同或不能等于0,问分配方案数 注:以下所有的相同是指两个数同或为0 思路 通过观察得出在0-\[2^k-1\]的范围内对于每个数,与之同或为零的数是唯一的 首先举例尝试观察性质,假设第一个位置随便填,即有\[2^k\]种不同的填法,然后考虑第二个位置和第一个位置不同的填法有\[2^k-1\]种,然后考虑第…
题目链接 题意:有n个格子拉成一个环,给你k,你能使用任意个数的0 ~ 2^k - 1,规定操作 i XNOR j 为~(i  ^  j),要求相邻的格子的元素的XNOR为正数,问你有几种排法,答案取模1e9 + 7.本题所使用的数字为无符号位数字. 思路:无符号位,所以异或取反后为正数,只可能是两个数相加不为2^k - 1.所以转化为相邻两个数之和不为2^k - 1的排法有几种(首尾也不能).这个问题很像扇形涂色问题.我们开dp[ n ][ 3 ]记录到第i长时的三种情况:头尾和不为2^k -…
任意门:https://nanti.jisuanke.com/t/31453 A.Hard to prepare After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nogaku show during the feast. To enjoy the show, every audience has to wear a Nogaku mask, a…
ACM-ICPC 2018 徐州赛区网络预赛 A.Hard to prepare 枚举第一个选的,接下来的那个不能取前一个的取反 \(DP[i][0]\)表示选和第一个相同的 \(DP[i][1]\)表示选和第一个取反的 \(DP[i][2]\)表示选其他的 状态转移方程直接看代码好了 //#pragma GCC optimize("O3") //#pragma comment(linker, "/STACK:1024000000,1024000000") #inc…
ACM-ICPC 2018 徐州赛区网络预赛 G. Trace (思维,贪心) Trace 问答问题反馈 只看题面 35.78% 1000ms 262144K There's a beach in the first quadrant. And from time to time, there are sea waves. A wave ( xx , yy ) means the wave is a rectangle whose vertexes are ( 00 , 00 ), ( xx ,…
ACM-ICPC 2018 徐州赛区网络预赛 J. Maze Designer J. Maze Designer After the long vacation, the maze designer master has to do his job. A tour company gives him a map which is a rectangle. The map consists of N \times MN×M little squares. That is to say, the h…
H.Ryuji doesn't want to study 27.34% 1000ms 262144K   Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, each book has its knowledge a[i]a[i]. Unfortunately, the longer he learns, the fewer he gets. That…
传送门 题面: In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl named "Sena" are playing a video game. The game system of this video game is quite unique: in the process of playing this game, you need to consta…