codeforce
SpongeBob_Y
这个作者很懒,什么都没留下…
展开
-
Educational Codeforces Round 72 D. Coloring Edges(拓扑判环)
题目链接题意:现在有n个点,m条有向边,现在要对这m条有向边染色,染色的要求是在一个环里面的边的颜色不能相同,现在让你求出最少要几种颜色,才能满足条件的染色。题解:首先很显然要是这个图里面连环都没有,肯定每条边都染1就行了。现在就是处理这个图里面有环的情况,要是图里面有环(题中说明没有自环),每条有向边的两个端点肯定是一个大一个小,所以要是有环的话,肯定满足有一些有向边是编号小的指向编号大...原创 2019-09-07 22:33:25 · 212 阅读 · 0 评论 -
最小公倍数与最大公约数问题
Codeforces Round #489 (Div. 2) B. Nastya Studies Informatics 题意:给出一个范围 l,r,两个数x,y。要求在【l,r】,找出一对a,b。使得gcd(a,b)=x,lcm(a,b)=y。问能找到多少对这样的数。题解:如果用a*b=x*y,肯定会超时。我们设a=n*x,b=x*m;就有,y=n*m*x,a*b=n*m*m*x;这样得...原创 2018-09-18 10:42:35 · 299 阅读 · 0 评论 -
Codeforces Round #562 (Div. 2)(A,B,C题解)
题目链接A Circle Metro题意:现在有1-n个车站,有两个平行的轨道,一个轨道的列车是按车站的升序跑(1->n),另一个轨道是按降序跑(n->1)。现在有两个人,现在两个人分别乘两个轨道的列车,给出两个人的乘车起点和终点,问两个人中途是否能在同一个车站相遇,若列车跑到1或n还没有到两个人的终点,则又从1或n开始跑,直到到两个人的终点。题解:首先判断两个人的起点和终...原创 2019-05-28 12:54:54 · 213 阅读 · 0 评论 -
CodeForces - 633C Spy Syndrome 2—好题(hash或字典树)
题目链接After observing the results of Spy Syndrome, Yash realised the errors of his ways. He now believes that a super spy such as Siddhant can't use a cipher as basic and ancient as Caesar cipher. Aft...原创 2019-03-07 21:13:18 · 340 阅读 · 1 评论 -
codeforces #271D Good Substrings(hash)
题目链接You've got strings, consisting of small English letters. Some of the English letters aregood, the rest arebad.A substrings[l...r](1 ≤ l ≤ r ≤ |s|) of strings = s1s2...s|s|(where|s|i...原创 2019-03-10 11:26:30 · 529 阅读 · 0 评论 -
Codeforces 253D-Table with Letters - 2(有技巧的遍历)
题目链接Vasya has recently started to learn English. Now he needs to remember how to write English letters. He isn't sure about some of them, so he decided to train a little.He found a sheet of square...原创 2019-02-28 20:49:18 · 352 阅读 · 0 评论 -
Codeforces Round #536 (Div. 2)(A,B,C,D)题解
比赛链接A. Lunar New Year and Cross CountingLunar New Year is approaching, and you bought a matrix with lots of "crosses".This matrix MM of size n×nn×n contains only 'X' and '.' (without quotes). Th...原创 2019-02-10 10:52:24 · 477 阅读 · 0 评论 -
Codeforces Round #532 C. NN and the Optical Illusion(数学)
题目链接NN is an experienced internet user and that means he spends a lot of time on the social media. Once he found the following image on the Net, which asked him to compare the sizes of inner circles...原创 2019-01-23 11:13:24 · 940 阅读 · 0 评论 -
Codeforces Round #533 (Div. 2)(C,D)题解
比赛链接Ayoub had an array aa of integers of size nn and this array had two interesting properties:All the integers in the array were between ll and rr (inclusive). The sum of all the elements was di...原创 2019-01-21 19:55:23 · 249 阅读 · 0 评论 -
Codeforces Round #535 (Div. 3) (B,C,D,E1)题解
比赛地址B. Divisors of Two IntegersRecently you have received two positive integer numbers xx and yy. You forgot them, but you remembered a shuffled list containing all divisors of xx (including 11 an...原创 2019-01-24 19:55:29 · 1350 阅读 · 0 评论 -
Codeforces Round #478 (Div. 2)B. Mancala(模拟)
Mancala is a game famous in the Middle East. It is played on a board that consists of 14 holes.Initially, each hole has aiai stones. When a player makes a move, he chooses a hole which contains a ...原创 2018-07-26 16:41:37 · 219 阅读 · 0 评论 -
2018 CCPC-Final 2018 I. Cockroaches(技巧题)
题目链接题意:现在有n只虫,每只虫的位置都用一个横竖坐标表示,现在有一种杀虫剂,这种杀虫剂投放到某一点,能将所在行和列的所有虫杀死,现在让求出只投放一次杀虫剂,最多能杀多少只虫和在满足杀最多只虫的情况下,有多少种方式能杀这么多只虫。题解:因为没有给定这个坐标系到底有多大,所以肯定不能暴力枚举,首先我们考虑虫都在一行或一列的情况,肯定只有一种情况,杀n只虫,还有就是每行每列都只有一只(例如对...原创 2019-09-24 14:59:18 · 1076 阅读 · 1 评论