mahmoud专题

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

CodeForces 766A Mahmoud and Longest Uncommon Subsequence

题目链接:http://codeforces.com/contest/766/problem/A 题意:让你求a,b字符串的最长不同子串的长度,如果不存在就输出-1 解析:如果a==b,输出-1,否则输出最长的字符串的长度 #include <bits/stdc++.h>using namespace std;const int maxn = 1e5+100;const int inf