codeforces
yjjr
蒟蒻qwq
yangjijingru.com
展开
-
Codeforces1061D TV Shows
标签:线段求交,STL,二分题目[题目传送门](http://codeforces.com/contest/1061/problem/D)题意给出要看的nnn个电视节目,和每个节目开始结束时间分别为lil_ili和rir_iri,每次申请一个新的电视的花费为X+(ri−li)×YX+(r_i-l_i)\times YX+(ri−li)×Y,如果两个节目有交集,就必须用两个电视看,现...原创 2018-12-01 23:33:37 · 377 阅读 · 0 评论 -
Codeforces894A QAQ
标签:模拟题目题目传送门“QAQ” is a word to denote an expression of crying. Imagine “Q” as eyes with tears and “A” as a mouth.Now Diamond has given Bort a string consisting of only uppercase English letters of leng原创 2017-12-07 11:02:00 · 453 阅读 · 0 评论 -
Codeforces896A Nephren gives a riddle
标签:dfs题目题面传送门What are you doing at the end of the world? Are you busy? Will you save us?Nephren is playing a game with little leprechauns.She gives them an infinite array of strings, f0… ∞.f0 is “What原创 2017-12-07 10:48:04 · 539 阅读 · 0 评论 -
Codeforces897A Scarborough Fair
标签:模拟题目题面传送门Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in原创 2017-12-07 10:50:55 · 464 阅读 · 0 评论 -
Codeforces897B Chtholly's request
标签:模拟,数学题目题面传送门— Thanks a lot for today.— I experienced so many great things.— You gave me memories like dreams… But I have to leave now…— One last request, can you…— Help me solve a Codeforces problem原创 2017-12-07 10:53:20 · 527 阅读 · 0 评论 -
Codeforces#449 div 2 题解
A题面传送门题意给定长度为N的字符串,进行m次操作,每次将l−>rl->r范围内为C1C_1的字符改成C2C_2,输出操作完的字符串数据范围1≤n,m≤1001\le n,m\le 100分析注意使用string,模拟水题吧code#include<iostream>#include<cstdio>#include<cstdlib>#include<cstring>#include<cmat原创 2017-12-03 19:36:34 · 311 阅读 · 0 评论 -
Codeforces868D Huge Strings
标签:记忆化搜索,模拟,位运算You are given n stringss1, s2, ..., sn consisting of characters 0 and 1.m operations areperformed, on each of them you concatenate two existing strings into a new one.On thei-th原创 2017-10-06 15:34:58 · 891 阅读 · 8 评论 -
Codeforces841B Godsend
标签:博弈论Leha somehow found an array consisting of n integers. Looking at it, he came up with a task. Twoplayers play the game on the array. Players move one by one. The first playercan choose for hi原创 2017-10-10 09:33:20 · 431 阅读 · 0 评论 -
Codeforces869A The Artful Expedient
标签:模拟Rock... Paper!After Karen have found the deterministicwinning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comesup with a new game as a substitute. The game works as follo原创 2017-10-07 13:51:42 · 327 阅读 · 0 评论 -
Codeforces869B The Eternal Immortality
标签:模拟,数学Even if the world is full of counterfeits,I still regard it as wonderful.Pile up herbs and incense, and arise againfrom the flames and ashes of its predecessor — as is known to many, theph原创 2017-10-07 13:25:17 · 480 阅读 · 0 评论 -
Codeforces894B Ralph And His Magic Field
标签:数学,快速幂题目题目传送门Ralph has a magic field which is divided into n × m blocks. That is to say, there are n rows and m columns on the field. Ralph can put an integer in each block. However, the magic field原创 2017-12-07 11:07:46 · 295 阅读 · 0 评论 -
Codeforces894C Marco and GCD Sequence
标签:模拟,数学题目题目传送门In a dream Marco met an elderly man with a pair of black glasses. The man told him the key to immortality and then disappeared with the wind of time.When he woke up, he only remembered t原创 2017-12-07 11:13:23 · 327 阅读 · 0 评论 -
Codeforces894D Ralph And His Tour in Binary Country
标签:二分,树题目题目传送门Ralph is in the Binary Country. The Binary Country consists of n cities and (n - 1) bidirectional roads connecting the cities. The roads are numbered from 1 to (n - 1), the i-th road conn原创 2017-12-07 11:22:28 · 408 阅读 · 0 评论 -
Codeforces1061C Multiplicity
标签:DP题目题目传送门题意给出序列aia_iai,询问有多少个a的子序列b满足,对于任意bib_ibi,b[i]mod&ThinSpace;&ThinSpace;i=0b[i]\mod i=0b[i]modi=0分析简单DPf[i][j]=f[i−1][j−1]+f[i−1][j](a[i]mod&ThinSpace;&ThinSpace;j=0...原创 2018-12-01 23:11:51 · 335 阅读 · 0 评论 -
Codeforces1040B Shashlik Cooking
标签:模拟题意给了n个初始状态为正面的煎饼(雾??反正可以这样理解),每次可以选择区间[i−k,i+k][i−k,i+k][i-k,i+k]内的煎饼翻一面,问最少可以花费多少次把所有煎饼都翻成反面题解分类讨论当k=0k=0k=0时,需要翻n次当n≤2×k+1n≤2×k+1n\leq2\times k+1时,只需要中间的翻一次当n>2×k+1n>2×k+1n...原创 2018-09-16 17:53:02 · 243 阅读 · 0 评论 -
Codeforces1040A Palindrome Dance
CSDN失踪人口回归了,毕竟还是要准备SOI的,从今天开始重新写题解了A. Palindrome Dance题意给出一串由0,1,2表示的数字,0和1分别表示不同的颜色,2表示无色,和两种变色的花费,现在使这串数字变为回文串,使得总花费最小题解从左到右,分几种情况讨论下就好了,分类讨论code#include&amp;amp;lt;iostream&amp;amp;gt;#inc...原创 2018-09-16 17:50:22 · 174 阅读 · 0 评论 -
Codeforces Round #469 (Div. 2) 解题报告
A. Left-handers, Right-handers and Ambidexters题意:l个人会用左手打球,r个人会用右手打球,a个人两只手都能打球,需要组建一个球队,保证球队中一半人会用左手打球,另一半会右手打球,最大化球队总人数模拟就行吧#include<iostream>#include<cstdio>#include<cstdli...原创 2018-03-10 13:19:27 · 267 阅读 · 0 评论 -
Codeforces Round #467 (Div. 2) 解题报告
话说好久没打CF div 2了自从上次lxl毒瘤round惨掉rating之后,三个月没打CF这场质量一般吧,水题偏多A. Olympiad题意:找出除了0有多少个不同的数?(应该是这样的题面吧,雾)#include<iostream>#include<cstdio>#include<cstdlib>#include<cmat...原创 2018-03-09 10:48:41 · 229 阅读 · 0 评论 -
杭二集训 diyiti (CF GYM 101597A)
标签:数论,分治题目题目传送门1.1 backgrounds 小O是一个很萌很萌的女孩子 1.2 content 作为一个很萌很萌的女孩子,小O有很多很多美丽的宝石。 有一天,小O将她的宝石排成了一排一共n堆,第一堆有1个宝石,之后 每一堆的宝石数目是前一堆的两倍。 但是小O发现她的宝石不够用了,于是小O决定将每堆的宝石数量对一 个正整数M取模。 趁小O出去玩的时候,小Y偷偷地把原创 2018-01-09 19:58:58 · 756 阅读 · 0 评论 -
Codeforces899E Segments Removal
标签:STL,数据结构题目题目传送门Vasya has an array of integers of length n.Vasya performs the following operations on the array: on each step he finds the longest segment of consecutive equal integers (the leftmost,原创 2017-12-18 10:52:22 · 831 阅读 · 0 评论 -
Codeforces899D Shovel Sale
标签:数学,找规律题目题目传送门There are n shovels in Polycarp’s shop. The i-th shovel costs i burles, that is, the first shovel costs 1 burle, the second shovel costs 2 burles, the third shovel costs 3 burles, and s原创 2017-12-18 08:44:45 · 616 阅读 · 0 评论 -
Codeforces869C The Intriguing Obsession
标签:数学— This is not playing but duty as allies ofjustice, Nii-chan!— Not allies but justice itself, Onii-chan!With hands joined, go everywhere at a speedfaster than our thoughts! This time, the F原创 2017-10-07 12:41:22 · 801 阅读 · 0 评论 -
Codeforces869E The Untended Antiquity
标签:模拟,标记法Koyomi is helping Oshino, an acquaintanceof his, to take care of an open space around the abandoned Eikou Cram Schoolbuilding, Oshino's makeshift residence.The space is represented by a r原创 2017-10-07 12:09:55 · 838 阅读 · 0 评论 -
Codeforces847E Packmen
标签:二分A gamefield is a strip of 1 × n squarecells. In some cells there are Packmen, in some cells — asterisks, othercells are empty.Packmancan move to neighboring cell in 1 time unit.If there is an原创 2017-09-20 07:51:17 · 848 阅读 · 0 评论 -
Codeforces847G UniversityClasses
标签:模拟 There are n student groups at the university.During the study day, each group can take no more than 7 classes. Seven time slots numberedfrom 1 to 7 are allocated for the classes.Theschedul原创 2017-09-20 07:55:22 · 602 阅读 · 0 评论 -
Codeforces847H Load Testing
标签:DPPolycarpplans to conduct a load testing of its new project Fakebook. He already agreedwith his friends that at certain points in time they will send requests toFakebook. The load testing will原创 2017-09-20 08:06:52 · 838 阅读 · 0 评论 -
Codeforces847I NoiseLevel
标签:bfs,队列TheBerland's capital has the form of a rectangle with sizes n × m quarters. Allquarters are divided into three types:· regular (labeled with the character '.') — such quarters do not pro原创 2017-09-20 08:12:00 · 754 阅读 · 0 评论 -
Codeforces847K Travel Cards
标签:贪心,hashIn theevening Polycarp decided to analyze his today's travel expenses on publictransport.The bussystem in the capital of Berland is arranged in such a way that each bus runsalong the rou原创 2017-09-20 08:18:19 · 1588 阅读 · 0 评论 -
Codeforces847M Weather Tomorrow
标签:模拟,计算几何Vasya cameup with his own weather forecasting method. He knows the information about theaverage air temperature for each of the last n days. Assume that the average air temperaturefor ea原创 2017-09-20 08:21:40 · 712 阅读 · 0 评论 -
Codeforces868F Yet Another MinimizationProblem
标签:二分,DPYou are given an array ofn integersa1... an. The cost of a subsegment is thenumber of unordered pairs of distinct indices within the subsegment thatcontain equal elements. Split the given原创 2017-10-06 15:25:11 · 1253 阅读 · 0 评论 -
Codeforces868C Qualification Rounds
标签:位运算Snark and Philip are preparing theproblemset for the upcoming pre-qualification round for semi-quarter-finals.They have a bank ofn problems, and they want to select any non-emptysubset of原创 2017-10-06 16:16:47 · 398 阅读 · 0 评论 -
Codeforces868B Race Against Time
标签:模拟,平面几何Have you ever tried to explain to thecoordinator, why it is eight hours to the contest and not a single problem hasbeen prepared yet? Misha had. And this time he has a really strong excuse原创 2017-10-06 16:21:56 · 290 阅读 · 0 评论 -
Codeforces847D Dog Show
标签:贪心,模拟A new dogshow on TV is starting next week. On the show dogs are required to demonstratebottomless stomach, strategic thinking and self-preservation instinct. You andyour dog are invited to原创 2017-09-20 07:46:27 · 803 阅读 · 0 评论 -
Codeforces847C Sum of Nestings
标签:dfsRecallthat the bracket sequence is considered regular if it is possible to insertsymbols '+' and '1' into it so that the result is a correctarithmetic expression. For example, a sequence "((原创 2017-09-20 07:40:30 · 874 阅读 · 0 评论 -
Codeforces847B Preparing forMerge Sort
标签:递推,DPIvan hasan array consisting of n differentintegers. He decided to reorder all elements in increasing order. Ivan lovesmerge sort so he decided to represent his array with one or several in原创 2017-09-20 07:35:39 · 851 阅读 · 0 评论 -
Codeforces849A Odds and Ends
标签:模拟Where do odds begin, and where do they end?Where does hope emerge, and will they ever break?Given an integer sequencea1, a2, ..., an of lengthn. Decide whether it is possible to divide it原创 2017-09-03 21:38:48 · 273 阅读 · 0 评论 -
Codeforces849B Tell Your World
标签:模拟,计算几何Connect the countless points with lines,till we reach the faraway yonder.There are n points on a coordinateplane, thei-th of which being (i, yi).Determine whether it's possible to dr原创 2017-09-03 21:47:36 · 393 阅读 · 0 评论 -
Codeforces849C From Y to Y
标签:模拟From beginning till end, this message hasbeen waiting to be conveyed.For a given unordered multiset ofnlowercase English letters ("multi" means that a letter may appearmore than once), we t原创 2017-09-03 21:58:09 · 335 阅读 · 0 评论 -
Codeforces849D Rooter's Song
标签:模拟Wherever the destination is, whoever wemeet, let's render this song together.On a Cartesian coordinate plane lies arectangular stage of sizew × h, represented by a rectangle withcorners (0,原创 2017-09-03 22:07:09 · 403 阅读 · 0 评论 -
Codeforces858A k-rouding
标签:模拟For a given positive integer n denote its k-rounding as the minimum positiveinteger x, such that x ends with k or more zeros in base 10and is divisible by n.For example, 4-rounding of 3原创 2017-09-18 09:35:04 · 708 阅读 · 0 评论