首页 > TAG信息列表 > Christmas

CF1498F Christmas Game

从简单往复杂推。 菊花图并且 \(k=1\) 时,这是个 \(Nim\) 游戏。 继续 \(k=1\),奇偶分类后发现一样是奇数深度意义下的 \(Nim\) 游戏。 \(k > 1\) 时,深度除以 \(k\) 后还是个 \(Nim\) 游戏。 换根 \(dp\) 求解一下即可。 #include<cstdio> const int H=4000040; char G[H],*_=G; in

SCTF2021 pwn Christmas Bash 出题思路+预期解

SCTF2021 pwn Christmas Bash 出题思路+预期解 sctf2021 pwn出题思路 赛题文件+exp: github 文章目录 SCTF2021 pwn Christmas Bash 出题思路+预期解题目描述Slang-christmas设计思路 2opcode生成scom文件结构dis模块逻辑 漏洞审计类型混淆栈溢出sleep 题目环境利用栈溢出

Codeforces 1617E. Christmas Chocolates (~2400)

题目描述 给定一个长度为 \(n\) 的序列 \(a\)。挑出两个数 \(a_x,a_y(x\neq y)\) 使得让 \(a_x=a_y\) 的最小操作数最大。 一次操作是选择一个非负整数 \(k\),使得 \(2^k\geq a_i\),然后令 \(a_i\leftarrow 2^k-a_i\)。 \(2\le n\le 2\cdot 10^5,0\le a_i\le 10^9\)。 有史以来最

【题解】CF1283D Christmas Trees

Sol 首先,显然要先放距离为 \(1\) 的位置,再放 \(2\) 的,以此类推。 因为是最短距离,考虑 bfs。 一开始把圣诞树全部丢到队列里,然后用这些圣诞树来扩展距离为 \(1\) 的,再用距离为 \(1\) 的去扩展距离为 \(2\) 的。 然后开个 map 防止一个位置被多次扩展。 当扩展到的点的个数为 \(m\)

[CF1498F]Christmas Game

题目 传送门 to CF 题目描述 两人轮流执行操作:选一个树上节点,其到根节点的距离至少为 k k k 。选节点上的若干物品,将它移动到 k

[atARC088F]Christmas Tree

合并具有交换律,因此即将一个连通块(初始为空)与一条链合并(其中各选1点,初始直接替换) 把插入改为染色,等价于对树上的一条链(包括点和边)染色,其中恰好有1个已经被染色的点(初始任意) 对于”恰有1个已被染色的点“这个条件,其实是可以忽略的,证明如下: 由于染色的点必然是一个完整的连通块,即如

codeforces 1283D. Christmas Trees(bfs)

链接: https://codeforces.com/contest/1283/problem/D 题意:给定n个不同的整数点,让你找m个不同的整数点,使得这m个点到到这n个点最小距离之和最小。 思路:贪心一下,首先每个点的x+1和x-1两个坐标到这个点的距离是最短的,之后是x+2,x-2,再之后是x+3,x-3,那么可以想到bfs,首先把n个点存入队

LED Holiday Light -Picking LED Christmas Lights, 4 Things

LED Christmas lights are not very cheap, but you should know that LED lights can be used for more than 10 years. In this case, this may be a good buying option, especially for those who are not used to moving houses every few years. First, calculate the c

Christmas Spruce

  Consider a rooted tree. A rooted tree has one special vertex called the root. All edges are directed from the root. Vertex u is called a child of vertex v and vertex v is called a parent of vertex u if there exists a directed edge from v to 

poj3710 Christmas Game

题目描述 题解: 树上删边。 对于奇数长度的环,可以看做一条边。 对于偶数长度的环,可以看做什么都没有。 没有特别好的解释…… 代码: #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N = 150; template<typename T> inline void read(T&x)