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…
2014-2015 Petrozavodsk Winter Training Camp, Contest.58 (Makoto rng_58 Soejima contest) Problem A. Manhattan solved by RDC 32 min 1Y 题意 给一网格图,找出欧几里得距离为 d 的两点,最大化最短路. 第一回合 三分搜索,第一个点的坐标 \((x,0)(0\leq x<1)\),确定第一个点后,对第二个点的横坐标或者纵坐标进行枚举计算答案. 第二回合 设最优解两点之间…
Description ACM-SCPC-2017 is approaching every university is trying to do its best in order to be the Champion, there are n universities, the ith of them has exactly ai contestants. No one knows what is the official number of contestants in each team…
Description A group of junior programmers are attending an advanced programming camp, where they learn very difficult algorithms and programming techniques! Near the center in which the camp is held, is a professional bakery which makes tasty pastrie…
Description Tourist likes competitive programming and he has his own Codeforces account. He participated in lots of Codeforces Rounds, solved so many problems and became "Legendary Grand Master" (the highest rank on Codeforces). One day, he logg…
Description X is fighting beasts in the forest, in order to have a better chance to survive he's gonna buy upgrades for his weapon. Weapon upgrade shops are available along the forest, there are n shops, where the ith of them provides an upgrade with…
Description It is raining again! Youssef really forgot that there is a chance of rain in March, so he didn't fix the roof of his house. Youssef's roof is 1-D, and it contains n holes that make the water flow into the house, the position of hole i is…
 Description You've possibly heard about 'The Endless River'. However, if not, we are introducing it to you. The Endless River is a river in Cambridge on which David and Roger used to sail. This river has the shape of a circular ring, so if you kept…
Description The forces of evil are about to disappear since our hero is now on top on the tower of evil, and all what is left is the most evil, most dangerous monster! The tower has h floors (numbered from 1 to h, bottom to top), each floor has w roo…
Description Zaid has two words, a of length between 4 and 1000 and b of length 4 exactly. The word a is 'good' if it has a substring which is equal tob. However, a is 'almost good' if by inserting a single letter inside of it, it would become 'good'.…
Description X is well known artist, no one knows the secrete behind the beautiful paintings of X except his friend Y, well the reason that Y knows X's secrete is that he is that secret. Y is a programmer and he helps X with drawing paintings using co…
Description Rami went back from school and he had an easy homework about bitwise operations (and,or,..) The homework was like this : You have an equation : " A | B = C " ( this bar '|' means OR ) you are given the value of A and B , you need to…
比赛链接:http://codeforces.com/gym/101028/ 由于实习,几乎没有时间刷题了.今天下午得空,断断续续做了这一套题,挺简单的. A.读完题就能出结果. /* ━━━━━┒ギリギリ♂ eye! ┓┏┓┏┓┃キリキリ♂ mind! ┛┗┛┗┛┃\○/ ┓┏┓┏┓┃ / ┛┗┛┗┛┃ノ) ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┃┃┃┃┃┃ ┻┻┻┻┻┻ */ #include <algorithm> #inclu…
题目链接:http://codeforces.com/problemset/gymProblem/101028/I I. March Rain time limit per test 2 seconds memory limit per test 64 megabytes input standard input output standard output It is raining again! Youssef really forgot that there is a chance of…
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分.最后从大到小列出排名,如果有…
2015-2016 Petrozavodsk Winter Training Camp, Nizhny Novgorod SU Contest B. Forcefield 题意 给你一维平面上n个镜子,镜子的朝向有正面和背面,如果光束从正面穿过,会摧毁镜子,并且光束会反向:如果从背面穿过的话,什么都不会发生. 光束一开始从X位置,射向0点,然后你人在0点,会反射光束. 问你要破坏所有镜子,人需要反弹光束多少次. 数据范围100000 题解 其实模拟就好了,击破镜子的顺序就那么一种. 代码 #in…
Warsaw U Contest Petrozavo dsk Summer 2011 Training Camp, Monday, September 5, 2011 Problem A.ChocolateProblem B.Programming ContestProblem C.DrawingProblem D.EvacuationProblem E.Insp ectionProblem F.MeteorsProblem G.PartyProblem H.Perio dicityProble…
链接: 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…
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   题目大意: 要组建一个小组,要求小组中每个人都不比所有人强,当一个人懂得一个算法但是另一个不懂那么前者认为他比后…
Petrozavodsk Summer Training Camp 2017 Day 9 Problem A. Building 题目描述:给出一棵树,在树上取出一条简单路径,使得该路径的最长上升子序列最长,问最长的长度. solution 最常见的想法就是树状dp,但空间不太够,所以选择直接计数. 每个点记住两个\(vector(f, g)\),\(f_i\)表示从叶子到\(i\)的最长的递增序列,\(g_i\)表示从叶子到\(i\)的最长的递减序列. 当算以\(i\)为根的子树的答案时,假设…
Petrozavodsk Summer Training Camp 2017 Problem A. Connectivity 题目描述:有\(n\)个点,现不断地加边.每条边有一种颜色,如果一个点对\((a, b)\),满足\(a=b\)或对于每一种颜色的子图(图中只有该种颜色的边),\(a, b\)总是连通,则该点对称为好连通.求出每加一条边,好连通的点对数. solution 每个子图用并查集维护连通块,并且用\(vector\)记录每个连通块的点,便于之后进行答案的统计,合并时启发式合并即…
Petrozavodsk Winter Training Camp 2018 Problem A. Mines 题目描述:有\(n\)个炸弹放在\(x\)轴上,第\(i\)个位置为\(p_i\),爆炸半径为\(r_i\),引爆第\(i\)个炸弹的花费为\(c_i\).但一个炸弹\(i\)爆炸时,在爆炸半径内的其它炸弹都会爆炸,而且不用花费.有\(Q\)个操作,每次改变一个炸弹的花费,然后输出引爆所有炸弹的最小费用. solution 不会. Problem B. Balls 题目描述:有\(n\…
2017 湖南省赛 K Football Training Camp 题意: 在一次足球联合训练中一共有\(n\)支队伍相互进行了若干场比赛. 对于每场比赛,赢了的队伍得3分,输了的队伍不得分,如果为平局则两支队伍各得1分. 现在给出每只队伍的得分\(s_i\),问最少和最多进行了多少场比赛,不超过1000组数据 \(1<=n<=20\) \(0<=s_i<=200\) 思路: 比赛的时候脑子不清醒,被这个配对难住了,暴力往搜索方面想了想,肯定会TLE啦,就放弃了 现在清醒一点,胜…
Football Training Camp 在一次足球联合训练中一共有n支队伍相互进行了若干场比赛. 对于每场比赛,赢了的队伍得3分,输了的队伍不得分,如果为平局则两支队伍各得1分. Input 输入包含不超过1000组数据. 每组数据的第一行为一个整数n(2 ≤ n ≤ 20),第二行为n个整数s1, s2, -, sn(0 ≤ si ≤ 200, 1 ≤ i ≤ n),即各个队伍目前的得分. Output 对于每组数据,用一行输出最少以及最多进行了多少场比赛,中间用一个空格隔开. 数据保证…
G. Training Camp[ Color: Yellow ]Montaser is planning to train very hard for ACM JCPC 2015; he has prepared a list with n topicsto study in the next n days, one topic every day.Montaser knows that some topics depend on other topics, so he asked coach…
G. Training Camp Time Limit: 1000ms Memory Limit: 262144KB This problem will be judged on CodeForcesGym. Original ID: 100676G64-bit integer IO format: %I64d      Java class name: (Any)   Montaser is planning to train very hard for ACM JCPC 2015; he h…
2007: Football Training Camp[原创-转载请说明] Submit Page   Summary   Time Limit: 1 Sec     Memory Limit: 128 Mb     Submitted: 228     Solved: 30 Description 在一次足球联合训练中一共有n支队伍相互进行了若干场比赛. 对于每场比赛,赢了的队伍得3分,输了的队伍不得分,如果为平局则两支队伍各得1分. Input 输入包含不超过1000组数据. 每组数据的第…
2017 Chinese Multi-University Training, BeihangU Contest Add More Zero 思路:log10(2^m) = m*log10(2) 代码: #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize(4) #include<bits/stdc++.h> using namespace std; #define y1 y11 #define fi firs…
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\)小的值,也是利用上面提到的两种方法. 但是当用到方法②…
有一些草,一开始高度都是0,它们的生长速率不同. 给你一些单增的日期,在这些日期要将>b的草的部分都割掉,问你每次割掉的部分有多少. 将草的生长速率从大到小排序,这样每次割掉的是一个后缀,而且不会影响它们生长速率的递增性. 就是三种操作,一种对一个后缀赋值,一种对整个数组作 + 另一个数组(d(i)-d(i-1))*a,一种求区间和. 可以通过打标记的线段树实现,标记下放通过预处理生长速率数组的前缀和可以实现. 队友的代码: #include <iostream> #include &l…