![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
龍木
若人生为棋,我愿为卒,漫漫征途,谁曾见我后退半步
展开
-
C - Digital Path
https://nanti.jisuanke.com/t/42397Zhe the bully, is condemned by all kinds of evil, like bullying those who are weaker. His teammates have been mistreated for a long time. Finally, they decided not to put up with their buddy any more and flee to Digital V原创 2020-12-20 14:33:17 · 216 阅读 · 0 评论 -
M - Gitignore
https://codeforces.com/gym/102900/problem/MYour git project (you don’t need to be familiar with git to solve this problem) has some files that should be ignored from synchronizing. You need to calculate the minimum number of lines needed for gitignore.Fo原创 2020-12-19 20:30:08 · 427 阅读 · 1 评论 -
D - Meaningless Sequence
https://codeforces.com/gym/102832/problem/DOnce there was a mathematician, who was obsessed with meaningless number sequences. Here is one of them.an={1,c⋅max0≤i<nan&i,n=0otherwise,an={1,n=0c⋅max0≤i<nan&i,otherwise,where&&...原创 2020-12-15 18:56:32 · 305 阅读 · 0 评论 -
K - Ragdoll
https://codeforces.com/gym/102832/problem/KOnce there was a lovely ragdoll cat, named Little Zara, who liked trees and math. One day she met the doge Adam. Adam had just planted some trees each consisting of only one node. The nodes were numbered from11.原创 2020-12-15 18:50:37 · 334 阅读 · 0 评论 -
D. XOR-gun
https://codeforces.ml/contest/1457/problem/DArkady owns anon-decreasingarraya1,a2,…,ana1,a2,…,an. You are jealous of its beauty and want to destroy this property. You have a so-calledXOR-gunthat you can use one or more times.In one step you can se...原创 2020-11-29 18:36:22 · 394 阅读 · 1 评论 -
C. Bouncing Ball
https://codeforces.ml/contest/1457/problem/CYou're creating a game level for some mobile game. The level should contain some number of cells aligned in a row from left to right and numbered with consecutive integers starting from11, and in each cell you.原创 2020-11-29 17:21:20 · 290 阅读 · 0 评论 -
C. Sequence Transformation
https://codeforces.ml/contest/1454/problem/CYou are given a sequenceaa, initially consisting ofnnintegers.You want to transform this sequence so that all elements in itare equal(i.e. it contains several occurrences of the same element).To achie...原创 2020-11-25 15:12:51 · 482 阅读 · 0 评论 -
D. Number into Sequence
https://codeforces.ml/contest/1454/problem/DYou are given an integernn(n>1n>1).Your task is to find a sequence of integersa1,a2,…,aka1,a2,…,aksuch that:eachaiaiis strictly greater than11; a1⋅a2⋅…⋅ak=na1⋅a2⋅…⋅ak=n(i.e. the product of t...原创 2020-11-25 15:11:08 · 563 阅读 · 2 评论 -
C. ABBB
https://codeforces.ml/contest/1428/problem/CZookeeper is playing a game. In this game, Zookeeper must use bombs to bomb a string that consists of letters 'A' and 'B'. He can use bombs to bomb a substring which is either "AB" or "BB". When he bombs such a原创 2020-11-24 15:11:57 · 472 阅读 · 0 评论 -
B. Toy Blocks
https://codeforces.ml/contest/1452/problem/BYou are asked to watch your nephew who likes to play with toy blocks in a strange way.He hasnnboxes and theii-th box hasaiaiblocks. His game consists of two steps:he chooses an arbitrary boxii; he tr...原创 2020-11-23 17:04:48 · 286 阅读 · 1 评论 -
D. Radio Towers
https://codeforces.ml/contest/1452/problem/DThere aren+2n+2towns located on a coordinate line, numbered from00ton+1n+1. Theii-th town is located at the pointii.You build a radio tower in each of the towns1,2,…,n1,2,…,nwith probability1212(th...原创 2020-11-23 17:03:48 · 350 阅读 · 0 评论 -
C. String Equality
https://codeforces.com/contest/1451/problem/CAshish has two stringsaaandbb, each of lengthnn, and an integerkk. The strings only contain lowercase English letters.He wants to convert stringaainto stringbbby performing some (possibly zero) oper...原创 2020-11-22 14:37:39 · 329 阅读 · 1 评论 -
C. k-Amazing Numbers
https://codeforces.ml/contest/1417/problem/CYou are given an arrayaaconsisting ofnnintegers numbered from11tonn.Let's define thekk-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having lengt...原创 2020-11-19 14:29:07 · 270 阅读 · 0 评论 -
B. Sum of Medians
https://codeforces.ml/contest/1440/problem/BAmedianof an array of integers of lengthnnis the number standing on the⌈n2⌉⌈n2⌉(rounding up) position in the non-decreasing ordering of its elements. Positions are numbered starting with11. For example, ...原创 2020-11-18 14:12:58 · 335 阅读 · 0 评论 -
C2. Binary Table (Hard Version)
https://codeforces.ml/contest/1440/problem/C2This is the hard version of the problem. The difference between the versions is in the number of possible operations that can be made. You can make hacks if and only if you solved both versions of the problem.原创 2020-11-18 13:52:37 · 323 阅读 · 0 评论 -
D. Catching Cheaters
https://codeforces.ml/contest/1447/problem/DYou are given two stringsAAandBBrepresenting essays of two students who are suspected cheaters. For any two stringsCC,DDwe define their similarity scoreS(C,D)S(C,D)as4⋅LCS(C,D)−|C|−|D|4⋅LCS(C,D)−|C|−|...原创 2020-11-16 19:42:46 · 240 阅读 · 0 评论 -
C. Knapsack
https://codeforces.ml/contest/1447/problem/CYou have a knapsack with the capacity ofWW. There are alsonnitems, theii-th one has weightwiwi.You want to put some of these items into the knapsack in such a way that their total weightCCis at least h...原创 2020-11-16 18:35:16 · 268 阅读 · 0 评论 -
C. Engineer Artem
https://codeforces.ml/contest/1438/problem/CArtem is building a new robot. He has a matrixaaconsisting ofnnrows andmmcolumns. The cell located on theii-th row from the top and thejj-th column from the left has a valueai,jai,jwritten in it.If ...原创 2020-11-14 14:22:31 · 209 阅读 · 0 评论 -
D. Minimal Height Tree
https://codeforces.ml/contest/1437/problem/DMonocarp had a tree which consisted ofnnvertices and was rooted at vertex11. He decided to study BFS (Breadth-first search), so he ran BFS on his tree, starting from the root. BFS can be described by the fol...原创 2020-11-06 14:41:55 · 210 阅读 · 0 评论 -
C. Chef Monocarp
Chef Monocarp has just putnndishes into an oven. He knows that theii-th dish has its optimal cooking time equal totitiminutes.At anypositive integerminuteTTMonocarp can putno more than onedish out of the oven. If theii-th dish is put out at s...原创 2020-11-06 14:40:36 · 242 阅读 · 0 评论 -
C. Division
https://codeforces.ml/contest/1445/problem/COleg's favorite subjects are History and Math, and his favorite branch of mathematics is division.To improve his division skills, Oleg came up withttpairs of integerspipiandqiqiand for each pair decided...原创 2020-11-05 16:45:17 · 230 阅读 · 0 评论 -
D. Extreme Subtraction
链接:https://codeforces.ml/contest/1443/problem/DYou are given an arrayaaofnnpositive integers.You can use the following operation as many times as you like: select any integer1≤k≤n1≤k≤nand do one of two things:decrement by onekkof the first el...原创 2020-11-05 13:48:27 · 189 阅读 · 0 评论 -
C - Play a game
New Year is Coming!ailyanlu is very happy today! and he is playing a chessboard game with 8600.The size of the chessboard is n*n. A stone is placed in a corner square. They play alternatively with 8600 having the first move. Each time, player is allowed原创 2020-10-24 10:46:33 · 209 阅读 · 0 评论 -
G - 邂逅明下
当日遇到月,于是有了明。当我遇到了你,便成了侣。那天,日月相会,我见到了你。而且,大地失去了光辉,你我是否成侣?这注定是个凄美的故事。(以上是废话)小t和所有世俗的人们一样,期待那百年难遇的日食。驻足街头看天,看日月渐渐走近,小t的脖子那个酸呀(他坚持这个姿势已经有半个多小时啦)。他低下仰起的头,环顾四周。忽然发现身边竟站着位漂亮的mm。天渐渐暗下,这mm在这街头竟然如此耀眼,她是天使吗?站着小t身边的天使。小t对mm惊呼:“缘分呐~~”。mm却毫不含糊:“是啊,500年一遇哦!”(此后省略5000字原创 2020-10-24 10:22:06 · 109 阅读 · 0 评论 -
S - 取(2堆)石子游戏
有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。如果你胜,你第1次怎样取子?Input输入包含若干行,表示若干种石子的初始情况,其中每一行包含两个非负整数a和b,表示两堆石子的数目,a和b都不大于1,000,000,且a<=b。a=b=0退出。O原创 2020-10-23 14:31:53 · 204 阅读 · 0 评论 -
R - 取石子游戏
https://vjudge.net/contest/402733#problem/R有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。Input输入包含若干行,表示若干种石子的初始情况,其中每一行包含两个非负整数a和b,表示两堆石子的数目,a和b都不大原创 2020-10-23 14:21:11 · 147 阅读 · 0 评论 -
F - 取石子游戏
1堆石子有n个,两人轮流取.先取者第1次可以取任意多个,但不能全部取完.以后每次取的石子数不能超过上次取子数的2倍。取完者胜.先取者负输出"Second win".先取者胜输出"First win".Input输入有多组.每组第1行是2<=n<2^31. n=0退出.Output先取者负输出"Second win". 先取者胜输出"First win".参看Sample Output.Sample Input213100000Sample Output原创 2020-10-23 13:47:50 · 156 阅读 · 0 评论 -
J - Kingdom‘s Power
https://vjudge.net/contest/402960#problem/JAlex is a professional computer game player.These days, Alex is playing a war strategy game. The kingdoms in the world form a rooted tree. Alex's kingdom11is the root of the tree. With his great diplomacy an..原创 2020-10-22 19:46:45 · 333 阅读 · 0 评论 -
E - Island Transport
https://vjudge.net/contest/402729#problem/EIn the vast waters far far away, there are many islands. People are living on the islands, and all the transport among the islands relies on the ships. You have a transportation company there. Some routes are原创 2020-10-21 17:58:02 · 114 阅读 · 0 评论 -
G - Control
https://vjudge.net/contest/402729#problem/G You, the head of Department of Security, recently received a top-secret information that a group of terrorists is planning to transport some WMD1from one city (the source) to another one (the destination). Y..原创 2020-10-21 14:17:15 · 193 阅读 · 0 评论 -
F - Food
https://vjudge.net/contest/402729#problem/FYou, a part-time dining service worker in your college’s dining hall, are now confused with a new problem: serve as many people as possible. The issue comes up as people in your college are more and more diffi原创 2020-10-21 12:02:02 · 284 阅读 · 0 评论 -
B - Dining
https://vjudge.net/contest/402729#problem/BCows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume no others.Farmer John has cooked fabulous meals for his cows, but he forgot to check his menu against原创 2020-10-21 10:42:25 · 111 阅读 · 0 评论 -
M - 非常可乐
https://vjudge.net/contest/402204#problem/M大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,101>S>0,N>0,M>0)原创 2020-10-19 16:11:15 · 137 阅读 · 0 评论 -
F - Prime Path
https://vjudge.net/contest/402204#problem/FThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices.— It is a matter of security to ch原创 2020-10-19 15:16:15 · 145 阅读 · 0 评论 -
N - Find a way
https://vjudge.net/contest/402204#problem/NPass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki.Yifenfei’s home is at the countryside, b原创 2020-10-19 14:30:36 · 102 阅读 · 0 评论 -
E - Find The Multiple
https://vjudge.net/contest/402204#problem/EGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there is a corre原创 2020-10-19 12:53:18 · 100 阅读 · 0 评论 -
L - Oil Deposits
https://vjudge.net/contest/402204#problem/LThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into原创 2020-10-19 12:42:38 · 126 阅读 · 0 评论 -
I - A计划
https://vjudge.net/contest/402248#problem/I可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主的位置用P表示,时空传输机用#表示,墙用*表示,平地用.表示。骑士们一原创 2020-10-18 20:34:06 · 117 阅读 · 0 评论 -
C - 哈密顿绕行世界问题
https://vjudge.net/contest/402248#problem/C一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出.Output输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出,每行1条路线.每行首先输出是第几条路线.然后个一原创 2020-10-18 19:57:01 · 240 阅读 · 0 评论 -
K - 迷宫问题
https://vjudge.net/contest/402204#problem/K定义一个二维数组:int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × 5的二维数组,表示一个原创 2020-10-18 13:53:16 · 129 阅读 · 0 评论