Blue Bridge Cup Summary

       The Blue Bridge Cup competition was first heard in the teacher group when I was a sophomore. It seemed that I had a sense of deja vu from the previous noip, so I signed up decisively. Since it is the first year, I don't know much about the level of the Blue Bridge Cup, and I am not familiar with writing algorithms in the Java language, so I participated in the Java B group. After dawdling for a while, I only started to prepare for the Blue Bridge Cup during the winter vacation. Although I had been working on oi for a long time in middle school before, but I haven't worked on the algorithm for a few years, and I still forgot a lot. So I bought this "Challenge Programming Contest", combined with the "Classic Training Guide for Getting Started with Algorithm Contests", and started to pick up some algorithms. During the holidays, I used the Blue Bridge Cup practice system to swipe the previous exam questions of the Blue Bridge Cup. If I brushed almost the same, I went to the poj and did it according to the practice questions provided by the classification at the back of the book. Occasionally, when I encounter a new algorithm, I will also collect some learning web pages, and write a template in Java (after all, books are basically implemented in C++ language). Before the provincial competition, Ji Suanke, as well as the official of the Blue Bridge Cup, will also do some mock competitions to find some feeling. Before the provincial competition, go to the poj to find some feeling and confidence.

       In this way, on April 8, the long-awaited eighth provincial competition came. The provincial competition almost set the tone for this year's Blue Bridge Cup, that is, to be different. Compared with the previous questions in the past few years, the first few questions this year are quite annoying at first glance. So, I decided to skip to the next question, and then I slowly solved the previous questions one by one. It is relatively simple to fill in the blanks in the code (but I took it for granted that I still exploded), so I won't say more. The big question, the first date, is an ordinary simulation. The second or third course, a steamed bun, is similar to the number that cannot be bought in the previous exam questions of the Blue Bridge Cup. I used the solution provided in the video given by the official website. It seems that there is another one that uses extended Euclidean solution is better. The other way of cutting chocolate is a two-point answer. The last k-fold interval is actually the simplest. The general idea is to find how many intervals there are so that the sum of the numbers is a multiple of k. The first thing to think about is to use the prefix sum. After preprocessing, you can enumerate i, j to see if s[i]-s[j] modulo k is 0. The time complexity of this algorithm is still O(n^2). So, use a better method. Directly use the cnt array, cnt[num] records the number of prefix sums whose modulo k is num, update while looping, and num can also be updated continuously (note that for a certain i,j<i,s[i]-s[j] Modulo k is 0, then s[i], s[j] are congruent to k. Therefore, if s[i] modulo k is calculated as num, the number of j should be cnt[num], so ans can be added cnt[num]). Then there are the first few questions. The first is actually string processing, which is annoying and requires a little patience (some people seem to use excel to process them directly, and they have also made the correct answer). The second and fourth steps involve transformation, mirroring, and rotation. I use something like a transformation array to continuously map. Then look at the number of schemes, I just search out all the schemes, and then compare them with all the previous schemes. If they are different, ans+1, update, and add a new scheme. The third way is mainly to pay attention to the processing of subscripts, recurse to the past, and finally pay attention to the conversion of units.

      It didn't take long for the results to come out, and the province was the first to enter, which was quite a surprise. So I started to prepare for the national competition (but to be honest, I don’t seem to have as much preparation as before. The basic algorithm templates are almost there, and then some applications. Plus there is a trial competition in the Mathematical Modeling School, also be delayed for a while). There are waves, and the day of the Beijing National Games on the 27th is approaching. Ji Suanke played two games (one 205 and one 220, it seems that the top 200 in the preliminary round are shortlisted for the semi-finals, this thief is injured), and the last few days seem to have nothing to do. On the morning of the 26th, the high-speed train departed, and in the evening, he and his classmates "dwelled" "Hotel, game the next morning.

      It stands to reason that the national competition questions should be difficult. Last year's C++ group B, every big question in the back can be done, and even cheating points is not necessarily cheating. Even if it is a simple java b group, the fifth question took a while to write, but it is estimated that it will be too late to write the first four questions at the speed of writing. However, this year seems to be a lot better. Let’s talk about the first one, the largest ten-digit square number (the numbers are not repeated), and the direct dfs search will not be explained. The second cellular automaton or something, looks annoying and simulates directly (the method should be like this, mine seems to be wrong). Filling in the blanks in the third code is similar to last year's provincial competition routine (binary operators or something, pay attention to the understanding and full use of methods and functions in the program). The fourth addition, subtraction, multiplication, and division, modulo, and base conversion, do not seem to consider the priority (the result can be output at any time). Actions are given as strings, so it's up to you to judge what to enter. For the problem of base conversion, I directly used the java large number class (there are methods to solve the problem of operation of different base numbers). Output in the current base, a toString method seems to also contain a base parameter. In the fifth way, two people find a blank to fill in each time (fill in L or O) to see who fills the blank first and then the word LOL appears. It should be a game of Dao. Maybe it needs sg function or something. . (The main idea is that if a person has an operation that makes the other side in all the remaining situations negative, take that operation. Otherwise, look for an operation to see if the opponent can tie. situation, negative). The sixth path is estimated to be dichotomy and greed. It seems that someone in this group has given an example that I can't pass, but my program example can still pass. To the effect of the title, given some intervals, the total length exceeds 10000, ask how to shift so that these intervals can finally cover the interval [0, 10000], and the interval with the largest interval shift has the smallest displacement distance. (The one with the smallest maximum value has actually prompted the use of the binary method). My idea is to sort first, and the top of the range is ranked first. Then the answer num is divided into two, and the loop is processed. The first interval needs to be shifted so that the starting point is 0, and after the interval, if it is after the last shifted interval, it must be moved to the left to the end point of the previous interval. Otherwise, move to the right as far as possible (of course, to ensure that there is no interruption after the end of the last interval). It seems like an hour to do these questions, nibbling on bread and drinking milk. In fact, I knew that the second question should still be done again, which is a bit of a wave. But to be honest, this year's question is really water compared to previous years.

      成绩第二天就出来了。虽说做的快,都做了,但觉得可能大佬们也是都早早解决问题,所以对奖项还是心虚。倒着看获奖名单,最后竟然是一等奖,第五名,也着实惊喜啊。明年还有时间的话,就去a组比比看吧。

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326823753&siteId=291194637