【Codeforces Round #501 (Div. 3)】】的更多相关文章

A:https://www.cnblogs.com/myx12345/p/9842904.html B:https://www.cnblogs.com/myx12345/p/9842964.html C:https://www.cnblogs.com/myx12345/p/9842977.html D:https://www.cnblogs.com/myx12345/p/9852909.html E:https://www.cnblogs.com/myx12345/p/9932309.html…
The Monster 签到题,算一下b+=a和d+=c,然后卡一下次数就可以了. Not Afraid 只要一组出现一对相反数就是安全的. Berzerk 题意:[1,n],两个人轮流走,谁能走到1谁就赢,求每个人先手在[2,n]时的胜负情况. 一直没怎么写过博弈论的题,但其实这种题也只是一个bfs. 必胜态:有一条边走到必败态 必败态:连出去的所有边都是必胜态. 方法:倒着bfs,把1作为必败态进队,如果当前是必败态,能到达都是必胜态,如果当前是必胜态,能到达的所有的点入度-1,如果入度减到…
这题看别人的.就是那么诚实.http://www.cnblogs.com/zhyfzy/p/4117481.html B. Queue During the lunch break all n Berland State University students lined up in the food court. However, it turned out that the food court, too, has a lunch break and it temporarily stopp…
Bear and Big Brother 签到题,直接模拟就可以了. Bear and Friendship Condition 满足只能是每个朋友圈中每个人和其他人都是朋友,这样的边数的确定的. 然后并查集求每个朋友圈大小再判断是否合法就可以啦. #include<cstring> #include<cstdio> #include<cmath> #include<algorithm> #define LL long long #define maxn 3…
A. Anton and Polyhedrons 直接统计+答案就可以了. #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #define maxn 1000 #define LL long long using namespace std; ]; int main() { int n; LL sum=; scanf("%d",&n);…
A:https://www.cnblogs.com/myx12345/p/9847588.html B:https://www.cnblogs.com/myx12345/p/9847590.html C:https://www.cnblogs.com/myx12345/p/9850705.html D:https://www.cnblogs.com/myx12345/p/9851785.html E: F:…
A:https://www.cnblogs.com/myx12345/p/9844334.html B:https://www.cnblogs.com/myx12345/p/9844368.html C: D: E: F:…
A:https://www.cnblogs.com/myx12345/p/9843198.html B:https://www.cnblogs.com/myx12345/p/9843245.html C:https://www.cnblogs.com/myx12345/p/9843293.html D:https://www.cnblogs.com/myx12345/p/10072307.html E:https://www.cnblogs.com/myx12345/p/10073117.htm…
传送门 分析 这道题做了好长时间,题意就很难理解. 我们注意到这句话Vertices which have the i-th (1 ≤ i ≤ m) type of ice cream form a connected subgraph 也就是说在最后的图中相同颜色的点构成一个连通图 也就是说如果1和2.3在不同的点共同出现,那么2和3一定不会在某个点共同出现.于是我们可以直接暴力dfs,在每个点对没有颜色的冰激凌贪心染最小的颜色. 需要注意有某种冰激凌没有出现的情况. trick 代码 #in…
题目链接 Codeforces Round #501 (Div. 3) F. Bracket Substring 题解 官方题解 http://codeforces.com/blog/entry/60949 ....看不懂 设dp[i][j][l]表示前i位,左括号-右括号=j,匹配到l了 状态转移,枚举下一个要填的括号,用next数组求状态的l,分别转移 代码 #include<bits/stdc++.h> using namespace std; const int maxn = 207;…