51Nod Algorithm Marathon 15 Remember a tragic and happy cheat sub-competition

Source: Internet
Author: User
Tags gcd

The origin of the OwO story is probably ZCG the day before the discovery of 51Nod night a marathon, and then he was very happy to hit the past

The Magical story begins:

I seemed to be writing a line tree at night? And then saw ZCG a face excited to tell me the first question has nine points direct output B can be a.

Then ZCG found in strange dichotomy how a dropped the tenth point of the first question (I remember what seemed to be the No. 5000 number equals 511?).

OwO so there is no thought content of the whole by cheating black technology off the first problem OwO

Then ZCG opened the second question, found that the second problem is a bit of a problem, and then sent a post, directly to see the third question

I went to take a look and found this is not a gcd array of naked questions? Then ZCG to stick to the topic, and then changed to pay the

As a result of the tragic T, we are surprised to find it seems gcd array originally O (N*sqrt (n) *log (n)) approach

Go out to run back ZCG began to push the formula, pushed less than 20s he threw the pen to say that this is not a question, and then began to write

I took a look and found that gcd (I,J) =1 was the complexity of O (N*SQRT (n)).

Maybe a dropped off when I was going back to the dorm.

The next day up found the second problem face changed (in fact, I was a long time later only to know this thing, think of the original question to think for a long while.

I took the exam in the morning, I was often rolling rough, not to take the 51Nod

In the afternoon found a large number of people have gone through a lot of problems, ZCG found that E is a data structure, and then went to the e-

I have been in the afternoon to change the test, seemingly zcg and the river has been a model for a long time, and then Brother Creek came to me and said a I look with the question of e completely does not matter

I was very confused by the brain, watching the topic yy a bit, found it difficult to maintain, and then started to go offline

It's still so hard to maintain after I go offline, and then I start to Bulabula to maintain a tree-like array.

Seemingly complete with very bizarre O (n*sqrt (n) *log (n)) time complexity solves this problem

Then it seems that ZCG and Brother Creek discussed some strange questions about strings, and finally seemed to get strange but very good practices?

I've been talking about it. N<=50000,o (N*SQRT (n) *log (n)) to cheer for ZCG.

ZCG Spit Trough a very difficult to write after the code code, let me recall their approach:

It seems to be to build trie, build a generalized suffix automaton, get out the parent tree, and then pull out a tree, then make a strange sub-block, and also take all the inquiries offline.

(This model of the 6 of the not AH

But ZCG code force Superior, so the practice of the pit father, he quickly the code is over, in WA a few hair after the change of the look of a two mistake on a dropped the problem

Finally listen to ZCG said wrote 8K.

In the afternoon Lyc found the second problem face changed, think about, found a very useful nature

And then wrote the one-digit DP success A dropped the B question

Then ZCG also dropped a b question.

Find ranking seemingly not low, then a dropped a question there is a bonus, a burst of excitement

And then I went back to the dorm to break.

On the third day, today, ZCG found a big wave of people lined up.

The F-question seems to have no one but DLs, and we decided to do the D-question.

I have a headache in the morning, write a CF C has been completely unable to support their own will

I can't think of a problem at all, I have a headache

And then just concentrate on the D-Question, and get ready for some weird stuff.

N<=35? Seems to be meet-in-the-middle?

Think about it, it seems like information merge can't be done

Suddenly thought of doing a digital DP band on the LIS Thing State compression Practice

Then I looked at the problem and recalled the way

Does the brain make up a little bit of useful state? And then I started to encourage ZCG to write.

Zcg wrote a find random data run fast, and then handed up only T dropped 8 points Owo

0 points, however, gave a completely ascending arrangement, and then T dropped 7 points.

However, 0 points, it seems that as long as the a two points can have 5 points

I'm going to get ready for a little bit of optimization, I have a headache and I don't want to go ahead and see if Meet-in-the-middle can do it.

The morning did not have any results, just a few more people a dropped a D problem, flustered ing

Noon back to break sleep, think Bo's Nest think out of the correct practice, run over with ZCG said, results just say a few words found there is a problem

Afternoon came to the computer room found a few more people a dropped D problem, more flustered

At this time LGL proposed that we can use black technology, although I'm not very fond of this approach

But for the bonus Owo, and then a couple of us started doing data in strange ways.

Master's data really conscience, as long as you know it seems like the first three numbers will find that the sequence is regular?

Then the wit of less than half an hour to get all the data, began to answer, found that the memory is not open enough, the number of States too many (well, it seems that the number of States is very small?)

ZCG urged me to write violence, I said the force of the Lis O (nlogn) to write the constant is very small, I am so empty ah

However, in the end I was forced to write violence, after writing the program sent to the computer room, and then the computer room all work together to start the answer

From the seemingly almost three O ' Day to start running, to the fast five point when all the answers are

ZCG Wit's A dropped the D question, but there is no egg use, because a dropped D problem too many people

ZCG rank11 just no money sad-story.

We are sad, suddenly found that looks like the master because it is the topic of people so do not rank? And get the money ZCG the card line?

The engine room seemed to jump up at that moment, OwO we were all cheering OwO

Feel that moment happy ah, a long time not so happy

At this time I went out of the field to find some way to streamline the practice, and then encouraged ZCG to write a D question

And then measured the discovery ran not slow, handed a return is T 7 points

Then measured their own data, found the program seems to have strange bugs, changed to find the number of States about 400w up and down

Looks like a 1.8s run? However, the time limit is only 1.5s, desperately optimize the constant, but still card not over, so sad

Desperate Nest to give up struggling, decided to wait until the end of the game to see the Owo (should there be a more refined state of optimization practice?)

(They're all hot for everything.) 6 Ah, there is no old driver to teach me the correct position of D problem

Finally went to see the F-question, found that there is no good idea, even the sub-block to do the table can not be

It looks like the F question doesn't have a few people, it's normal.

Anyway, the marathon ended up in a strange way.

Whether you can get the money at the end, I feel so happy these days qaq

51Nod Algorithm Marathon 15 Remember a tragic and happy cheat sub-competition

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.