ehab专题

B. Ehab Is an Odd Person

B. Ehab Is an Odd Person You’re given an array a of length n. You can perform the following operation on it as many times as you want: Pick two integers i and j (1≤i,j≤n)(1≤i,j≤n) such that ai+aj is

C++ CF862B Mahmoud and Ehab and the bipartiteness

题意翻译 给出n个点,n-1条边,求再最多再添加多少边使得二分图的性质成立 By @partychicken (为了尽量更清晰的说明题意,以下为个人附加的内容) 就像这样(黑边为原本就有的边,红色边的数量为需要求出的解): 图片来自:https://www.luogu.org/blog/ACdreamer/solution-cf862b 输入输出样例 输入样例1: 3 1 2

CodeForces 959 E Mahmoud and Ehab and the xor-MST(异或 思维)

Description Ehab is interested in the bitwise-xor operation and the special graphs. Mahmoud gave him a problem that combines both. He has a complete graph consisting of n vertices numbered from 0 to

Ehab and Path-etic MEXs(思维题)

题意: 输入是一棵包含n个节点的树,包括n-1条边。编号为:0~n-2 问,如何给边编号,使得任意MEx(u,v)最小。 MEX(u,v)表示除了u - v路径上点的集合之外(0~n-2)的数中最小的数 这里有点绕,具体解释下。就是全部点的集合为:0~n-2 设为全集S 若设u~v途径的边的编号的集合为Q 则所求就是在全集S中求Q的补集中的最小值,使得这个数最小即可。 思路 1.所