- 博客(30)
- 收藏
- 关注
原创 Acwing 5133奶牛排队
观察可知,前方相邻奶牛为0号的是第一头奶牛的纸条,则该纸条上写下的后方相邻奶牛则排在第二,再找到另一张写有排在第二的奶牛的编号,就能找到排在第四的奶牛,以此类推,可以找到排在2,4,6......号的奶牛,再观察可得,只有排在二号位的奶牛的纸条上会写下排在第一位的奶牛序号,所以用两个数组A和B来记录在纸条上出现的奶牛的序号,A[i]==1&&B[i]==0的就是排在第一位的奶牛,编号为i,接下来就可以求出排在1,3,5......位的奶牛编号。奶牛排队,点击跳转。
2023-08-09 13:43:19 169
原创 5.24 江西icpc 第J题
假设需要查询x=a时的最小值,那么假设y=(x-a)^2+1,令这个函数中y的值为1e5,那么则有(x-a)^2+1=100000,此时得到|x-a|约为317,所以查询的最大范围为[x-317,x+317],遍历这个范围中的函数,查找最小值即可找到答案。1)添加一个二次函数,给出参数a和b,表示y=(x-a)^2+b,注意a和b的范围为(1<=a,b<=n),【因为题目最终是要找最小值,所以当a相同的情况下,需要比较这里的b和原来的b哪个大,要替换成更小的那个b。
2023-05-24 21:00:35 239 1
原创 5.23 江西省2023icpc第K题
题解:先求出每两个数之间的差,记录在数组b[N]中。若为第一种操作,发现仅仅是交换b[x]和b[x-1];若为第二种操作,发现只要在产生最大差值的中间进行分段,这个差值就会失效。所以假如要分成k段,那么只需要排序,去掉前k-1大的差值,剩下相加;这部分操作的时间复杂度为O(nlogn)题意:给出一个长度为n的不递增序列,两种操作,第一种是改变数据,第二种是将序列分为k段,每一段的有效值为该段中最大减去最小,求这k段的所有有效值的最小和。由于可能会进行m次查询,所以需要用前缀和进行预处理操作。
2023-05-24 00:03:28 355
原创 5.22江西ICPC2023年I题
一共有两种操作,一是将一棵树一条路径上的边权异或上一个数,二是询问一个点周围所有边权的异或和。对于操作一:除了路径两个端点的答案会改变,其余都不变,所以直接对两个端点异或上这个数即可。注意到数据范围很大,所以用scanf和printf输入和输出。对于操作二:输出答案。
2023-05-23 17:03:55 268
原创 02.18 Memory Manager
Memory Manager | JXNUOJ描述:There is little time left before the release of the first national operating system BerlOS. Some of its components are not finished yet — the memory manager is among them. According to the developers' plan, in the first releas
2022-02-18 20:35:10 263
原创 02.17 Kalevitch and Chess
Kalevitch and Chess | JXNUOJ描述:A famous Berland's painter Kalevitch likes to shock the public. One of his last obsessions is chess. For more than a thousand years people have been playing this old game on uninteresting, monotonous boards. Kalevitch dec
2022-02-17 21:24:45 238
原创 02.16 Exposition
Exposition | JXNUOJ描述:There are several days left before the fiftieth birthday of a famous Berland's writer Berlbury. In this connection the local library decided to make an exposition of the works of this famous science-fiction writer. It was decided
2022-02-16 20:55:29 203
原创 02.14 Lizards and Basements 2
Lizards and Basements 2 | JXNUOJ描述:This is simplified version of the problem used on the original contest. The original problem seems to have too difiicult solution. The constraints for input data have been reduced.这是在原始比赛中的问题的简化版本。开始的问题有太多不同的解决方法。减少
2022-02-14 20:58:22 125
原创 02.13 Alice, Bob and Chocolate
Alice, Bob and Chocolate | JXNUOJhttps://acs.jxnu.edu.cn/problem/CF6C描述:Alice and Bob like games. And now they are ready to start a new game. They have placednchocolate bars in a line. Alice starts to eat chocolate bars one by one from left to right,..
2022-02-13 14:55:10 389
原创 02.12 President‘s Office
President's Office | JXNUOJhttps://acs.jxnu.edu.cn/problem/CF6B描述:President of Berland has a very vast office-room, where, apart from him, work his subordinates. Each subordinate, as well as President himself, has his own desk of a unique colour. Each
2022-02-12 22:25:31 323
原创 02.11 Triangle
Triangle | JXNUOJhttps://acs.jxnu.edu.cn/problem/CF6A描述:Johnny has a younger sister Anne, who is very clever and smart. As she came home from the kindergarten, she told his brother about the task that her kindergartener asked her to solve. The task was
2022-02-11 22:24:18 347
原创 02.10 Bindian Signalizing Bindian标志
Bindian Signalizing | JXNUOJ描述:Everyone knows that long ago on the territory of present-day Berland there lived Bindian tribes. Their capital was surrounded bynhills, forming a circle. On each hill there was a watchman, who watched the neighbourhood ..
2022-02-10 19:43:09 253
原创 02.09 Follow Traffic Rules遵守交通法则
Follow Traffic Rules | JXNUOJ描述:Everybody knows that the capital of Berland is connected toBercouver (the Olympic capital) by a direct road. To improve the road's traffic capacity, there was placed just one traffic sign, limiting the maximum speed. Tra
2022-02-09 22:10:19 613
原创 02.08 Longest Regular Bracket Sequence
最长的常规支架序列|断续器 (jxnu.edu.cn)https://acs.jxnu.edu.cn/problem/CF5C描述:This is yet another problem dealing with regular bracket sequences.We should remind you that a bracket sequence is called regular, if by inserting «+» and «1» into it we can get a corr
2022-02-09 21:52:46 340
原创 02.07Center Alignment居中对齐
Center Alignment | JXNUOJ描述:Almost every text editor has a built-in function of center text alignment. The developers of the popular in Berland text editor «Textpad» decided to introduce this functionality into the fourth release of the product.You a
2022-02-07 20:45:49 682
原创 02.25 Chat Servers Outgoing Traffic聊天服务流量输出
聊天服务器传出流量|断续器 (jxnu.edu.cn)https://acs.jxnu.edu.cn/problem/CF5A描述:Polycarp is working on a new project called "Polychat". Following modern tendencies in IT, he decided, that this project should contain chat as well. To achieve this goal, Polycarp has
2022-02-06 20:46:00 413
原创 2022.02.05 Mysterious Present神秘的礼物
https://acs.jxnu.edu.cn/problem/CF4D描述:Peter decided to wish happy birthday to his friend from Australia and send him a card. To make his present more mysterious, he decided to make achain. Chain here is such a sequence of envelopesA = {a1, a2, .....
2022-02-05 22:40:25 427
原创 1.29 Registration System
https://acs.jxnu.edu.cn/problem/CF4C描述:A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested t
2022-01-29 18:17:00 1004
原创 1.28 Before an Exam
描述:Tomorrow Peter has a Biology exam. He does not like this subject much, butddays ago he learnt that he would have to take this exam. Peter's strict parents made him prepare for the exam immediately, for this purpose he has to study not less thanminT...
2022-01-28 20:10:31 315
原创 1.27 Watermelon
https://acs.jxnu.edu.cn/problem/CF4Ahttps://acs.jxnu.edu.cn/problem/CF4A描述:One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and
2022-01-27 14:44:27 309
原创 1.26Least Cost Bracket Sequence最低成本括号序列
https://acs.jxnu.edu.cn/problem/CF3Dhttps://acs.jxnu.edu.cn/problem/CF3DThis is yet another problem on regular bracket sequences.这是规则括号序列的另一个问题。A bracket sequence is called regular, if by inserting "+" and "1" into it we get a correct mathematical ex
2022-01-26 15:06:59 140
原创 1.25 Tic-tac-toe
描述:Certainly, everyone is familiar with tic-tac-toe game. The rules are very simple indeed. Two players take turns marking the cells in a3 × 3grid (one player always draws crosses, the other — noughts). The player who succeeds first in placing three of..
2022-01-25 10:37:12 1829
原创 1.24 Lorry
https://acs.jxnu.edu.cn/problem/CF3Bhttps://acs.jxnu.edu.cn/problem/CF3BA group of tourists is going to kayak and catamaran tour. A rented lorry has arrived to the boat depot to take kayaks and catamarans to the point of departure. It's known that all ..
2022-01-24 17:46:19 182
原创 1.23 Shortest path of the king
国王的最短路径描述:The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to squaret. As the king is not in habit of wasting his.
2022-01-23 11:39:27 371
原创 1.22 Commentator problem
https://acs.jxnu.edu.cn/problem/CF2Chttps://acs.jxnu.edu.cn/problem/CF2C评论员问题描述:The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenie
2022-01-22 17:59:12 271
原创 1.20 The least round way 最不圆的方式
https://acs.jxnu.edu.cn/problem/CF2Bhttps://acs.jxnu.edu.cn/problem/CF2B描述:There is a square matrixn × n, consisting of non-negative integer numbers. You should find such a way on it that有一个方形的矩阵n*n,由非负整数组成。你需要找到以下方式starts in the upper left cell o.
2022-01-21 18:39:47 335
原创 1.20 Winner
胜利者描述:The winner of the card game popular in Berland "Berlogging" is determined according to the following rules. If at the end of the game there is only one player with the maximum number of points, he is the winner. The situation becomes more difficu
2022-01-20 11:11:26 2214
原创 1.19 Ancient Berland Circus
古老的伯兰德马戏团Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different.如今,所有的伯兰德马戏团有直径为13米的圆形竞技场,但是在过去是不同的。In Ancient Berland arenas in circuses were shaped as a regular (equiangular) polygon, the
2022-01-19 17:15:49 271
原创 1.18 Spreadsheet
描述:In the popular spreadsheets systems (for example, in Excel) the following numeration of columns is used. The first column has number A, the second — number B, etc. till column 26 that is marked by Z. Then there are two-letter numbers: column 27 has nu
2022-01-18 19:36:44 216
原创 【标题】1.17 Theatre Square
描述:Theatre Square in the capital city of Berland has a rectangular shape with the sizen × mmeters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the sizea × a....
2022-01-17 11:59:15 243
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人