![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
codeforces 刷题
winer_bamboo
这个作者很懒,什么都没留下…
展开
-
CF 1136B Nastya Is Playing Computer Games
题目链接:codeforces.com/problemset/problem/1136/B题目分析 首先,读完题目,看了是个B题,嗯嗯...... 果断找规律,然后交了一波,居然过了!!!代码区#include<iostream>#include<cstdio>#include<algorithm>#include&l...原创 2019-03-29 21:42:50 · 247 阅读 · 0 评论 -
codeforces 1131B Draw!
题目链接:http://codeforces.com/contest/1131/problem/B解题思路 由于我们要求的是平局的最大局数,我们知道n个时刻的比分,那么,两个队伍的分数变化区间[s1,score1[i] ] [s2,score2[i] ] 的交集[ max(s1,s2), min(score1[i] , score2[i]) ]就是出现的平局分数的集合,那...原创 2019-05-05 20:19:01 · 109 阅读 · 0 评论 -
codeforces 1130B. Two Cakes
题目链接:http://codeforces.com/contest/1130/problem/B题目分析 感觉之前在哪里写过这个题,有点像洛谷的 P1007 独木桥 (链接:https://www.luogu.org/problemnew/show/P1007) 由于两个人都需要实现同样的目的,而且情况一致,那么我们将这两个人当作一个整体,先让这个整...原创 2019-05-05 21:45:30 · 227 阅读 · 0 评论 -
codeforces 1162B Double Matrix
题目链接:http://codeforces.com/contest/1162/problem/B题目分析:题意:有两个矩阵,矩阵同一个位置的两个数可以交换数值,经过任意次交换(也可以不交换),使得两个矩阵都满足 t [ i-1 ] [ j ] < t [ i ][ j ] && t[ i ][ j - 1] < t[ i ] [ j ] 也...原创 2019-05-16 09:35:18 · 286 阅读 · 0 评论 -
codeforces 1157A Reachable Numbers
题目链接:http://codeforces.com/contest/1157/problem/A题目分析:题意:给一个数n,对n加一,如果(n+1) % 10 == 0 那么 (n+1) / 10 ,如果 (n+1)/10 % 10 == 0 那么( n+1 )/10/10 ,直到这个数无法被10整除,这样我们得到了经过上面操作后的一个数 x, x满足题目的要求,然后继续对x加一,...原创 2019-05-16 14:38:18 · 236 阅读 · 0 评论 -
Codeforces Round #564 (A-C)
A题题目链接:http://codeforces.com/contest/1173/problem/A题目分析这个题目很简单的,看懂题目就A了的那种。有三种投票,分别记为 x ,y, z , 其中 x 表示正票,y表示负票,z表示不确定的票(可能全是正票,也可能全是负票),那么输出为 "+" 的情况就是 x > y + z ,同样输出为 "-"的情况就是 y >...原创 2019-06-08 11:06:04 · 120 阅读 · 0 评论 -
CF 343A Rational Resistance
A. Rational ResistanceDescriptionMad scientist Mike is building a time machine in his spare time. To finish the w...原创 2019-07-10 08:55:59 · 147 阅读 · 0 评论 -
codeforces 787D Legacy (线段树)
题目链接:http://codeforces.com/problemset/problem/787/DDescriptionRick and his co-workers have made a new radioactive formula and a lot of bad guys are after them. So Rick wants to give his legacy t...原创 2019-07-19 11:24:33 · 472 阅读 · 2 评论 -
codeforces 687C (动态规划)The Values You Can Make
The Values You Can MakeDescription(点击查看原题)Pari wants to buy an expensive chocolate from Arya. She hasncoins, the value of thei-th coin isci. The price of the chocolate isk, so P...原创 2019-07-21 15:22:57 · 505 阅读 · 0 评论 -
codeforces 713A Sonya and Queries (状态压缩)
点击查看原题:http://codeforces.com/problemset/problem/713/A题目分析题意:我们有三种操作:1)+ a,向集合中添加一个数a2)- a ,减去集合中的一个数,保证a一定存在于集合中3)? s , s仅有‘0’和‘1’组成,‘0’所在位置表示这个位置的数需要为偶数,‘1’所在位置表示这个位置的数需要为奇数,用s去和集合中所有的数...原创 2019-08-04 11:06:30 · 139 阅读 · 0 评论 -
Codeforces 1131A Sea Battle
题目链接:http://codeforces.com/problemset/problem/1131/A思路画图找规律代码区#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;typedef...原创 2019-05-05 18:25:37 · 112 阅读 · 0 评论 -
CF 1136C Nastya Is Transposing Matrices
题目链接:http://codeforces.com/problemset/problem/1136/C题目分析 看了题目之后,第一想法:任意位置都可以倒置,要是枚举,铁定的超时。所以需要探索规律...... 结果发现,任意的两个数,如果可以交换,其横纵坐标之和一定相同,所以我们只需要用一个数组存储横纵坐标相同的所以点的值,然后判断在的横纵坐标之和相同的情况下,这个数...原创 2019-03-29 13:36:53 · 168 阅读 · 0 评论 -
CF 1133B Preparation for International Women's Day
题目链接:http://codeforces.com/problemset/problem/1133/B题目分析 读完题目,凡是先暴力.....(不用想,第四组数据就TLE了,QAQ) 当两个数的和为k的倍数的时候就凑成一组,那么一定有 (a+b) % k == (a%k + b %k) % k , 而其中对于 a+b 为k的倍数的情况,有(a+b)%k ==...原创 2019-03-30 20:57:00 · 210 阅读 · 0 评论 -
CF 1133C Balanced Team
题目链接:http://codeforces.com/problemset/problem/1133/C题目分析 (个人感受:我看错了题目,硬是写了近一个小时!) 这个题目要求一个最长的序列,使得这个序列的每一个数之间的差值的绝对值都小于或等于5。 想到求序列中的数的差值的问题,我在想,如果这个序列是单调递增的,那岂不是直接用序列尾部取和头部比较...原创 2019-03-30 23:33:02 · 152 阅读 · 0 评论 -
2016-2017 ACM-ICPC, Asia Tsukuba Regional Contest C题 - Distribution Center
题目链接:https://codeforces.com/gym/101158/attachments这个题目请下载pdf进行查看 。题目分析 这个题目是在和别的学校的友谊赛中看见的。看完题目后,首先发现的了一个规律,那就是每一条经过一个升降机,升降机两边的这两条路中所含商品就可以共享,所以我原准备用一个数组来记录每一个道路中的所含有的商品数,而后在通过升降机的时候就将二...原创 2019-03-31 19:38:00 · 412 阅读 · 0 评论 -
Codeforces 1132A Regular Bracket Sequence
题目链接:https://codeforces.com/contest/1132/problem/A题目分析: 找规律..... 我们注意到,"()"无论有多少个都没问题,而且如果有相同数量的"((" 和 "))" (数量不为0)那么无论")("有多少组也可以满足条件,而如果“(("和"))"数量不同的时候,无论怎么样也无法满足条件,同时一对"(("和"))...原创 2019-04-10 15:26:26 · 121 阅读 · 0 评论 -
CF 1139C Edgy Trees
这个题目太长了,我就放个连接算了:http://codeforces.com/problemset/problem/1139/C题目分析 这个题把题意读懂了就好弄了,本以为是最短路的,但应该是求连通块的。 要在一个有n个结点的树上找一个长度为k,且由结点组成的序列[a1,a2....ak],代表行路的路线a1- a2 - .... - ak , 任意两个结点...原创 2019-03-28 13:56:26 · 327 阅读 · 0 评论 -
CF 1141C Polycarp Restores Permutation
DescriptionAn array of integers p1,p2,…,pnp1,p2,…,pn is called a permutation if it contains each number from 11 to nn exactly once. For example, the following arrays are permutations: [3,1,2][3,1,2...原创 2019-03-26 13:20:36 · 437 阅读 · 0 评论 -
CF 1140A Detective Book
DescriptionIvan recently bought a detective book. The book is so interesting that each page of this book introduces some sort of a mystery, which will be explained later. The ii-th page contains som...原创 2019-03-26 14:28:08 · 333 阅读 · 0 评论 -
CF 1138B Circus
DescriptionPolycarp is a head of a circus troupe. There are nn — an even number— artists in the troupe. It is known whether the ii -th artist can perform as a clown (if yes, then ci=1ci=1 , otherw...原创 2019-03-27 15:38:59 · 193 阅读 · 0 评论 -
CF 1140B Good String
DescriptionYou have a string ss of length nn consisting of only characters > and <. You may do some operations with this string, for each operation you have to choose some character that still...原创 2019-03-26 15:58:30 · 330 阅读 · 0 评论 -
CodeForces 712C Memory and De-Evolution (思维+贪心)
点击查看原题:http://codeforces.com/problemset/problem/712/C题目分析题意:给你两个等边三角形,边长为x,y (x>y),问最少多少次操作后,可以将边长为x的等边三角形变为边长为y的等边三角形,每次操作我们可以将三角形任意一条边改为任意数值,不过执行操作后三边仍然组成三角形,比如现在的三角形三边长为: 4 ,6 , 5 ,此时我们就不...原创 2019-08-04 11:41:45 · 141 阅读 · 0 评论