随笔分类 - 网络赛~CF
Codeforces Round #365 (Div. 2) Chris and Road
摘要:Chris and Road 题意: 给一个n个顶点的多边形的车,有速度v,人从0走到对面的w,人速度u,问人最快到w的时间是多少,车如果挡到人,人就不能走。 题解: 这题当时以为计算几何,所以就没做,其实真的应该认真想想的,一般cf前3题仔细想想是可以出的,其实思路很简单,如下: 题解:一共有三种
阅读全文
Codeforces Round #365 (Div. 2) Mishka and trip
摘要:Mishka and trip 题意: 有n个城市,第i个城市与第i+1个城市相连,他们边的权值等于i的美丽度\ i+1的美丽度,有k个首都城市,一个首都城市与每个城市都相连,求所有边的权值。 题解: 先把n个城市存下来,之后开一个标记数组,来标记k个首都(这题这块很巧妙,正因为开了标记首都的数组,
阅读全文
Codeforces Round #363 (Div. 2) One Bomb
摘要:One Bomb 题意: 只有一个炸弹,并且一个只能炸一行和一列的‘\ ’,问最后能否炸完所以‘\ ’,如果可以输出炸弹坐标 题解: 这题做的时候真的没什么好想法,明知道b题应该不难,但只会瞎写,最后越写越乱,我就放弃了。看了题解,果然还是我不行。。。 首先枚举一遍,记录总‘\ '数,和每行,每列的
阅读全文
Educational Codeforces Round 15 Road to Post Office
摘要:Road to Post Office 题意: 一个人要从0走到d,可以坐车走k米,之后车就会坏,你可以修或不修,修要花t时间,坐车单位距离花费a时间,走路单位距离花费b时间,问到d的最短时间。 题解: 首先要分成k段,k段的总长是ovmod,每一段可以选择修车坐车或选择走路,(只有第一段的时候不用
阅读全文
Educational Codeforces Round 15 Cellular Network
摘要:Cellular Network 题意: 给n个城市,m个加油站,要让m个加油站都覆盖n个城市,求最小的加油范围r是多少。 题解: 枚举每个城市,二分查找最近的加油站,每次更新答案即可,注意二分的时候不要越界oil数组,上下界都不要越。还有,int坑死人,以后绝对全用long long!!! 代码:
阅读全文
Educational Codeforces Round 15 Powers of Two
摘要:Powers of Two 题意: 让求ai+aj=2的x次幂的数有几对,且i using namespace std; typedef long long ll; const int INF=0x3f3f3f3f; const ll LINF=0x3f3f3f3f3f3f3f3f; define
阅读全文
Codeforces Round #364 (Div. 2) Cells Not Under Attack
摘要:Cells Not Under Attack 题意: 给出n n的地图,有给你m个坐标,是棋子,一个棋子可以把一行一列都攻击到,在根据下面的图,就可以看出让你求阴影(即没有被攻击)的方块个数 题解: 我先是认真的看了前面之后,发现看不懂,最后一看图,就明白了,这就似乎证明了图片已经超越了语言,MD
阅读全文
Codeforces Round #364 (Div. 2) Cards
摘要:Cards 题意: 给你n个牌,n是偶数,要你把这些牌分给n/2个人,并且让每个人的牌加起来相等。 题解: 这题我做的时候,最先想到的是模拟,之后码了一会,发现有些麻烦,就想别的方法。之后发现只要把它给的数排序就好了,排完序后输出原来的位置就好,因为每2个都能配对所以最小肯定配最大,第二小配第二大…
阅读全文
Codeforces Round #359 (Div. 2)C - Robbers' watch
摘要:C. Robbers' watch time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Robbers' watch time
阅读全文
Codeforces Round #358 (Div. 2)B. Alyona and Mex
摘要:B. Alyona and Mex time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. Alyona and Mex time
阅读全文
Codeforces Round #356 (Div. 2) C. Bear and Prime 100(转)
摘要:C. Bear and Prime 100 time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output C. Bear and Prime 1
阅读全文
Codeforces Round #356 (Div. 2)B. Bear and Finding Criminals(水题)
摘要:B. Bear and Finding Criminals time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output B. Bear an
阅读全文
Codeforces Round #356 (Div. 2)A. Bear and Five Cards(简单模拟)
摘要:A. Bear and Five Cards time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Bear and Five
阅读全文
浙公网安备 33010602011771号