D. Marcin and Training Camp 题目链接:http://codeforces.com/contest/1230/problem/D time limit per test: 3 seconds memory limit per test: 256 megabytes input: standard input output: standard output 题目大意: 要组建一个小组,要求小组中每个人都不比所有人强,当一个人懂得一个算法但是另一个不懂那么前者认为他比后…
D. Marcin and Training Camp 参考:D. Marcin and Training Camp 思路:首先先确定最大成员的\(a_i\),因为不能够某个成员i认为自己比其他所有成员都厉害,所以必须要有一个人j来压制他.压制有两种方法:①\(a_j\)跟他一样大 ②\({a_i}\&{a_j}=a_i\),即\(a_j\)可以将\(a_i\)包括.但是此时\(a_i\)为最大值,所以只能是情况① 然后再确定比\(a_i\)小的值,也是利用上面提到的两种方法. 但是当用到方法②…
链接: https://codeforces.com/contest/1230/problem/D 题意: Marcin is a coach in his university. There are n students who want to attend a training camp. Marcin is a smart coach, so he wants to send only the students that can work calmly with each other. L…
Petrozavodsk Summer Training Camp 2017 Day 9 Problem A. Building 题目描述:给出一棵树,在树上取出一条简单路径,使得该路径的最长上升子序列最长,问最长的长度. solution 最常见的想法就是树状dp,但空间不太够,所以选择直接计数. 每个点记住两个\(vector(f, g)\),\(f_i\)表示从叶子到\(i\)的最长的递增序列,\(g_i\)表示从叶子到\(i\)的最长的递减序列. 当算以\(i\)为根的子树的答案时,假设…
2016 Al-Baath University Training Camp Contest-1 A题:http://codeforces.com/gym/101028/problem/A 题意:比赛初始值是1500,变化了几次,得到的正确结果和bug后的是否相等.(Tourist大佬好 Y(^o^)Y) #include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { in…
2015 UESTC Winter Training #7 2010-2011 Petrozavodsk Winter Training Camp, Saratov State U Contest 据说这套题写出3题就是金牌水平了... Problem D. Group Stage 足球比赛,现在有n(2<= n <=100)支球队.要从中选拔m(1<= m <=n-1)支球队,每支球队互相比赛一场,即比赛n*(n-1)/2场,胜者得3分,平局各得1分.最后从大到小列出排名,如果有…
Petrozavodsk Summer Training Camp 2017 Problem A. Connectivity 题目描述:有\(n\)个点,现不断地加边.每条边有一种颜色,如果一个点对\((a, b)\),满足\(a=b\)或对于每一种颜色的子图(图中只有该种颜色的边),\(a, b\)总是连通,则该点对称为好连通.求出每加一条边,好连通的点对数. solution 每个子图用并查集维护连通块,并且用\(vector\)记录每个连通块的点,便于之后进行答案的统计,合并时启发式合并即…