2020 csp summary

2020 csp summary

Big preface

In the third year of junior high school, it was the last competition, and it was also the first and last exam of csp-J.

csp-j

fraction

Insert picture description here

first question

Only 2 0 2^0 were found to be inconsistent during the game20 this one, and output− 1 -1if it is odd1 , otherwise the prime factorization will be over.

After the game, it is said to judge 0 00 , and then I didn’t judge, I panicked a lot.

Later found that the data range from 1 to 11 start, then100 1001 0 0 .
Scared to death.

Second question

In the second question, the range of scores is only 600 6006 0 0 , it is natural to think of recording how many people each score has, and then find the score line for each time directly enumerating the score line.

It is the bucket row, the complexity is O (600 × n) O(600\times n)O ( 6 0 0×n)

Third question

See the title for the third question: Thank you for being scared.

Then began to analyze the question and found that the output answer was either 1 11 or0 00 .
In other words, it is either the same as the answer when it is not flipped, or it is different.

Then I thought of seeing that each value change does not play a decisive role in the answer.

Then I figured out that in an operation, how the two sides need to be flipped has a decisive effect on the answer.
Then I discovered that to make a function work in a formula is to include it in its calculations. The side on which it is located must be flipped to have a decisive effect on the answer.

Then the joy is simulated.

Fourth question

Seeing that it was dp, I added some oil to me, who had always been weak in dp, and started to look at the question.

First, I saw the title and found that you can get a n 3 n^3n3 dp, directlyf [i] [j] [k] f[i][j][k]f [ i ] [ j ] [ k ] , means go toiii column, and then go tojjon the previous linej , this time I reachedkkk . Then I typed it out.

Then, if you want to get rid of the middle dimension, you first go to the top of this column, then directly maintain the maximum value on the top, and use the heap to maintain the maximum value below, and then constantly move the point you want to go down.
(However, this algorithm seems to be problematic)

I originally wanted to use different algorithms for segmentation (because I can’t guarantee the correctness after reading my own algorithm)

As a result, because I was afraid of MLE, I only got the algorithm I thought of later, and then I was happy 30 3030

During the game


First look at the topic: Question 1: After
seeing the meaning of the question, I thought of decomposing prime factors and judging parity, and then I passed the second question: It was a bit confusing at first, but after looking at the data, I found that it was OK to row.
Question 3:? ? ? , What the hell, and then discovered that it may be to see whether the flip of a value will change the answer. But I won’t break down the formula (well, I think it’s troublesome, I don’t want to think about it), and then just go to the fourth question.
The fourth question: It feels like dp, I can use n 3 n^3n3 to do it.

Then first about 40 404 0 minutes to write a couple of questions ago, after a sample.

Then I went to simulate the third question and did 20 202 0 Fenzhong successfully separated the formula, then you can look like a formula for how the last step of the operation on both sides, if the operation of what will be a flip side to produce changes in the value of the whole equation. (Used another20 202 0 minutes)
then do not know how to do, put each formula are judged again.
Then I feel that a value flip will have an impact on the value of the formula, that is, in every formula that contains this value, after flipping the side of the value, it will have an impact on the answer.
Then I went to realize it, probably typed out and adjusted the error, it took half an hour.

Then go to the fourth question, first put that n 3 n^3n3 dp came out, and then I began to think about optimization. (This is about half an hour)
My dp is to enumerate columns, and then enumerate from which row to which row. Then I wondered if I could not enumerate which row came from, and get the best row from maintenance directly.
Then I started to maintain the maximum value directly above and use the heap to maintain it later. (Here about30 303 0 minutes)
and then sample all over, but I feel the operation is very strange, engage on the beat.
As a result, I was not familiar with the shooting. I forgot to run the program that generates random numbers. I didn't know it, so I kept running the same set of data.

Then I took a couple of shots, and there was no problem all the time (how could there be a problem with the same set of data all the time),
and then I thought about playing a few more shots to see if I could find the error faster.
Then when I drove the sixth one, the computer crashed. (No do no die)
Then I restarted, and found that I had to enter the account password, and then I planned to call the teacher.
As a result, the teacher was blocked by the computer. I thought he was not there and waited for half an hour.
Then, until the teacher's head gradually emerged from the computer screen, I realized that the teacher was always there.
(I may be NT)

Then find the teacher to enter the account password and boot up, the program is all there, but the fourth question n 3 n^3nThe 3 dp is gone.
Then because I was afraid of MLE at the time and I didn't have a problem with the shots for so long, I didn't care.

Then you can frantically check the file name and freopenthese things in the rest of the time .

then? Then after checking it may be a hundred times, the game is over.

to sum up

Blood loss.

First of all, the fourth question did not come up with a correct solution, dp is still too weak.

Second, NT’s I actually feel that I will be able to MLE, which is outrageous, and then perfectly from the expected 370 3703 7 0 fell to330 3303 3 0 , and then I was lowered by a second-year god. (Sto CXY orz)

Third, the fourth question was originally matched, but this paragraph
sytem("sjs.exe");was not matched: (that is, the program that generates random numbers was not run)
and then the same set of data was always being photographed.

But at least there is a first class, barely make it through.
harm
Insert picture description here

csp-s

fraction

Insert picture description here

first question

It was this question, and it cracked without taking a point.

I saw the title, and I thought to myself that I would use all formulas directly, directly O (1) O(1)O ( 1 ) calculation.

Then I played for more than two hours and still couldn't come out.

Then he backhanded a battered egg and made a fortune in silence.

Second question

After reading the meaning of the title, I probably think it is something like binary.
Then it depends on whether to buy each kind of food, and then subtract the original zoo from the total number of animals that can be matched. That is the answer.

Then there is no unsigned long long, and there is no special judgment over unsigned long long.
Then 75 757 5 points.
(But it seems that I have some small problems with the bit operation of judging whether a certain digit is one)

Third question

After doing the first question for too long, I didn't think much about it, and left me violently.

Fourth question

It’s been too long to do the first question again. After thinking about it for a while at the beginning, I found that if the largest snake hits the smallest snake and it’s not the countdown, it will play again.

However, the code hits and hits and finds that sometimes the largest snake will hit it even if it hits the smallest one and becomes the smallest, because the second time it dare not hit it for the same reason.

Then I decided to adjust my first question.

During the game

Look at the topic
first: Question 1: Formula? ? O (1) O (1)O ( 1 ) ? ? But I found it troublesome, and then I didn't think much about it, and movedto the next questionwithgratitudeto theperson who wrote the firstquestion.
The second question: I found out what kind of feed I can directly find, and then I found out that some digits of the animal number can only be filled with0 00 , then you can fill in0 00 or1 11 , and then naturally think of binary. Then I missed the range and only opened int behind.
The third question: very awkward, I thought about the most violent way for a while, and then I thought it could be optimized with a line segment tree.
Question 4: At first I thought that as long as the biggest hits the smallest, it won't be the smallest, otherwise it won't hit.
*You are full of determination

Then I fought hand-to-hand with the first question for two hours, and the determination gradually disappeared.
Then I went to the second question, and it was done after half an hour, full of determination again.
Then I went to the fourth question and found that it was not as simple as I thought. It also depends on whether the new biggest will hit him if the biggest hits the smallest and becomes the smallest. Then he was stunned.
*Your resolution broke the ground
and then you lied to the first 20 20 of the fourth question2 0 points, to continue to engage the first question.
In the last half an hour, I found that the violence in the third question had not been hit, let alone the line tree, and then hit the violence quickly. After considering it, I decided to continue with the first question (because I don't think I can play a line segment tree in the last ten minutes)
and then continue to do it for a long time, the adjustment is messy, and then the game is over.

to sum up

Improve cracking.

The main problem is that the first question is a bit big.

First, I always thought about using the formula directly, but never thought about enumerating the number of years.
Thinking of the idea of ​​time complexity but it is very complicated (especially when pushing formulas), you must think about whether there is a longer time.

Moreover, even if the algorithm used to push the formula in the examination room is typed, it must be divided into sections, and the violence that can be violent is divided.
(Just because I'm a math rookie)

Insert picture description here
The second question is so-so. Although it is said that A is not available because of the details, at least there is a point.
But in the future, you have to be more sensitive to the size of the data, otherwise you will lose points like this.

The third and fourth questions are a little bit tricky, but I feel that if you have time, you can use recursion to fool the fourth question. 40 404 0 points, see if you can water a little more.

General summary

This time, it was so-so. I didn't take the exam very well, but it was barely reasonable.
The only popular exam, at least 300 3003 0 0 .
Although the improvement can't get 1=, but at least it also has a lot of cheating points and game experience.

In general, keep working hard and come on next year!

Guess you like

Origin blog.csdn.net/weixin_43346722/article/details/109827470