D1. Magic Powder - 1 题目连接: http://www.codeforces.com/contest/670/problem/D1 Description This problem is given in two versions that differ only by constraints. If you can solve this problem in large constraints, then you can just write a single soluti…
任意门:http://codeforces.com/contest/1118/problem/D1 D1. Coffee and Coursework (Easy version) time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The only difference between easy and hard versions…
传送门:http://codeforces.com/contest/1092/problem/D1 D1. Great Vova Wall (Version 1) time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vova's family is building the Great Vova Wall (named by Vo…
D1. Magic Powder - 1 time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output This problem is given in two versions that differ only by constraints. If you can solve this problem in large constraint…
D1. RGB Substring (easy version) time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The only difference between easy and hard versions is the size of the input. You are given a string s consistin…
传送门 C. Ivan the Fool and the Probability Theory 题意: 给出一个\(n*m\)的方格,现在要给方格中的元素黑白染色,要求任一颜色最多有一个颜色相同的格子和它相邻.问多少种方案. 思路: 观察到若第一行含有两个相同的颜色相邻,那么之后所有格子的状态都可以确定: 若第一行不含有两个相同的颜色相邻,那么下一行至多有两种状态. 根据这两个观察,可以发现状态数其实不多,我们再推导一下: 对于第一种情况,假设第一个格子为白色,第二个格子有黑白两种选择:若选择白…
D. Catowice City In the Catowice city next weekend the cat contest will be held. However, the jury members and the contestants haven't been selected yet. There are…
B. Grow The Tree Gardener Alexey teaches competitive programming to high school students. To congratulate Alexey on the Teacher's Day, the students have gifted him a collection of wooden sticks, where every stick has an integer length. Now Alexey wan…
A. Ivan the Fool and the Probability Theory Recently Ivan the Fool decided to become smarter and study the probability theory. He thinks that he understands the subject fairly well, and so he began to behave like he already got PhD in that area. To p…
Preface 这场CF真是细节多的爆炸,B,C,F都是大细节题,每道题都写了好久的说 CSP前的打的最后一场比赛了吧,瞬间凉意满满 希望CSP可以狗住冬令营啊(再狗不住真没了) A. Ivan the Fool and the Probability Theory 原谅我脑子不如陈指导好想不出来正解,然后打了个暴力3min找到规律做掉了... 然后讲一下正确的做法(陈指导教我的): 考虑我们用DP做出\(1\times m\)的矩阵的答案记为\(f_m\),考虑用它填了第一行 然后我们考虑第一…
Gardener Alexey teaches competitive programming to high school students. To congratulate Alexey on the Teacher’s Day, the students have gifted him a collection of wooden sticks, where every stick has an integer length. Now Alexey wants to grow a tree…
A. Integer PointsDescription DLS and JLS are bored with a Math lesson. In order to entertain themselves, DLS took a sheet of paper and drew n distinct lines, given by equations y=x+pi for some distinct p1,p2,…,pn. Then JLS drew on the same paper shee…
D. Wizards and Roads 题目连接: http://www.codeforces.com/contest/167/problem/D Description In some country live wizards. They love to build cities and roads. The country used to have k cities, the j-th city (1 ≤ j ≤ k) was located at a point (xj, yj). It…
//在我对着D题发呆的时候,柴神秒掉了D题并说:这个D感觉比C题简单呀!,,我:[哭.jpg](逃 Codeforces Round #435 (Div. 2) codeforces 862 A. Mahmoud and Ehab and the MEX[水] 题意:定义一个集合的MEX为其中的最小的不在集合里的非负整数,现在给一个大小为N的集合和X,每次操作可以向其中加入一个非负整数或删除一个数,问最小的操作次数,使得这个集合的MEX为X. #include<cstdio> #include…