Блог пользователя majk

Автор majk, 7 лет назад, По-английски

The end of the December is fast approaching and it is time for the best last contest of the year! The Good Bye 2018 round will take place on Sunday, December 30, 2018 at 14:35 UTC.

As the people who already engaged in discussions about the ultimate problem suspect, I am the problem writer. As such, I'd like to thank to:

The round will last for 2:30 hours and you will be given 8 problems for both divisions. There will be an interactive problem.

You have the last opportunity to reach Your rating goals for 2018. Good luck!

UPD: The top 3 participants eligible for ICPC 2019/20 season can win a great prize.

UPD2: The scoring distribution is 500-1000-1750-2250-3000-3000-3750-4000.

UPD3: Round is finished. I hope you enjoyed the contest! I am really sorry for the duck-up in problem G. I'll share more details once the important things (systest, editorial ...) are taken care of. The systest might be slightly delayed because of that.

UPD4: Editorial

UPD5: We apologize for the issue with problem G. We are still investigating this issue. Verdicts “Idleness limit exceeded” may be changed to other. We will write a full report about it later.

UPD6: The results are final, rating will be recalculated shortly. Congratulations to the winners:

  1. tourist
  2. eatmore
  3. Um_nik
  4. ecnerwala
  5. Radewoosh

UPD7: Some more information about problem G

Анонс Good Bye 2018
  • Проголосовать: нравится
  • +1032
  • Проголосовать: не нравится

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

please, add Eve to the tags

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +30 Проголосовать: не нравится

I always enjoyed contests from majk. Hope to see something interesting for the last contest of the year!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Looking forward to it :))))

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -52 Проголосовать: не нравится

I am so sorry, but is it rated?

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +6 Проголосовать: не нравится

Best birthday gift ever! Thanks, majk!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

I don’t have good memory of goodbye 2017 hope this one overwrites that.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

wait for the rating up!

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +81 Проголосовать: не нравится

Damn,

It might take CF 1 year to update the ratings.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -29 Проголосовать: не нравится

"...you will be given 8 problems for both divisions." For (div. 2 and 1) or (div.2 and 3)?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

Why is this post tagged with 'Alice' and 'Bob ? By the way, Happy new year in advance to everyone in Codeforces community.

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

"You have the last opportunity to reach Your rating goals for 2018"

This makes me kinda sad. As I feel like I won't be able to reach it.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +63 Проголосовать: не нравится

Here's a list of past Good Bye contests.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

tfw my rating goal for 2018 was CM...

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Happy New Year to all!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

happy new year!

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

TinTin122 don't miss this!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

kg16 try your luck on this :)!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

so excited to back expert by end of 2018

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -28 Проголосовать: не нравится

if i dont get crapping expert this time i will do russian shooting

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Just a little thought. Why dont codeforces make everyone automatically registered for every contest like codechef where we dont need to register for a contest ?

»
7 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

Last contest of the year, Wishing a very good rating for everyone...

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -27 Проголосовать: не нравится

Good to see an Indian Problem Setter. Random doubt, Is there any contest that is from an Indian User?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -23 Проголосовать: не нравится

Will this round be rated for div 3?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -197 Проголосовать: не нравится

Upvote me, If you think, I can cross 1600 rating in Good bye 2018 contest.

Downvote me, If you think, I can't !

Be honest with your opinions, that will motivate me to do hard-work !

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

You can win if you want

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

best pat of the year

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +189 Проголосовать: не нравится

Everyone else on New Year's eve vs me

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

When verdict of problem will be accepted and when will be "Happy New Year"?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Hope to All high rating.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Happy new year,guys!(So what does the tag"Alice and Bob'...mean?)

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +57 Проголосовать: не нравится

Every time i see this blog, majk color keeps changing :D

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

2018 was a great year with lot of good contests hope this year be even better. thank to every one how prepared a contest and a special thanks to mike.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +25 Проголосовать: не нравится

I hope that everyone can get high rating && change his/her handle's color by no magic.

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +37 Проголосовать: не нравится

First contest in cf history with more than 10000 registrations

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится

I hope codeforces servers could handle the requests from this much contestants.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +58 Проголосовать: не нравится


9000 and counting ...

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -19 Проголосовать: не нравится

DearMargaret ----> DearMargaret.

He doesn't want to achieve his goal anymore ?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +25 Проголосовать: не нравится

Happy New Year! Fun & high rating for all of you:)

But I have to warn, that CF-Predictor doesn't support handle change. So if you change handle, the prediction is going to be completely wrong (for the first time only). As there are some people who changed handles, today's prediction is going to be a bit inaccurate for everyone.

Don't be upset, just enjoying the competition!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

It's about time that I become a specialist.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

It's biggest number of registrants ever

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

Будем надеяться , что сервера CF не упадут из-за 10к участников.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

scoring distribution doesn't seem even

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Good Luck! (:D)

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +39 Проголосовать: не нравится

\10000 Registration!/

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Lets see if i can end this year with pupil

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

I suspect huge queues...

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

I freaked out when I opened the registrations page — lots of grandmasters :o. But then I realized they have just changed their colors :P

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

I already reached my 2018th goal (min 1600), but, damn ,this contest seems to be like a chocolate candy , cant keep my fingers from touching it. I hope for everyone steep positive slope in this contest.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

however,good luck to the server!! Total: 10312

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +14 Проголосовать: не нравится

Will the CF servers be able to hold 10000 participants?

let's hope for a smooth one this year boys.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Been Newbie throughout 2018, time to pull out all I've got, to, at the very least become Pupil. I know the Purple, Orange, Red and Black Reds be like "Seriously, someone fighting to reach green??"

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +4 Проголосовать: не нравится

All the best to legend Petr

hope he does screencast for it too

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +125 Проголосовать: не нравится

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +15 Проголосовать: не нравится

Will the fake colors be disabled for hacking purposes? majk, gotta ping real fast, sorry.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

tourist is here.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

tourist joined. Let the battle begins!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

11444 candidates registered...

It'll be a fierce contest.

Best of Luck Guys...

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Finally, I find a contest announcement with no one asking whether it is rated.

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +81 Проголосовать: не нравится

Problem B: "As everyone knows, the world is a two-dimensional plane."

So the earth is flat?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

CF Servers failed :( Denial of Judgement

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +51 Проголосовать: не нравится

Написал раунд Good Bye 2018 — Good Bye Rating

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +25 Проголосовать: не нравится

»
7 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

Petr hasn't solved problems A and B yet :O :O :O

He tries to get AC problem H, but solving problems A and B will take just 3-4 minutes for him.

UPD: Finished. He didn't solve them, neither he solved H :(((

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

After reading first 5 problems GoodByeExpert :(

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Hacks for B?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

problem c was nice :D , how to solve D ?

  • »
    »
    7 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +25 Проголосовать: не нравится

    n!+((ans for n-1)-1)*n) Don't know why it works though.

    • »
      »
      »
      7 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      How did you get this? :D

      • »
        »
        »
        »
        7 лет назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится +1 Проголосовать: не нравится

        Observation ;)

        I was trying different methods to get 56 for n=4 using the answer of n=3 i.e 9. Coincidentally the first method I tried gave the correct answer for 10 and it passed :)

      • »
        »
        »
        »
        7 лет назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится +8 Проголосовать: не нравится

        A concatenation of 2 permutations will have the sum n*(n+1)/2 iff the suffix of the first permutation won't contain any elements from the prefix of the second. That mean that the prefix of the first permutation needs to have the same elements as the prefix of the second (when we are talking of some prefix i and suffix n-i). Now 2 consecutive permutations will satisfy this condition always except for one time when the suffix elements are sorted in decreasing order. For example: 1 3 5 4 2 , the next permutation will have some elements from {5,4,2} in the prefix. Now it's only the matter of implementation. For each prefix i add to the answer A(n,i) * ((n-i)!-1)

  • »
    »
    7 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +3 Проголосовать: не нравится

    It should be clear that we automatically get n! subarrays, from the permutations themselves.

    For a given permutation, look at the the length of the prefix that remains the same when going to the next permutation. For example, for n = 4 say the permutation 1324 appears at index i. from 1324 -> 1342, the length of the prefix that remains the same is 2 (because 13 stays the same). Then, this means that we get 2 more subarrays that work, i.e. the ones starting from i + 1 and i + 2.

    The answer will be n! plus the sum of the lengths of these prefixes. We can calculate that recursively, given by the formula in the other comment.

    • »
      »
      »
      7 лет назад, скрыть # ^ |
       
      Проголосовать: нравится +8 Проголосовать: не нравится

      So every subarray p which works is a permutation of numbers [1...n]? Can't there be some other subarrays?

      • »
        »
        »
        »
        7 лет назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится 0 Проголосовать: не нравится

        So, this part was really hand wavy, but I think that a given subarray can have at most one duplicate, and if that's true then it would follow that every subarray that works is a permutation of 1..n. Not at all sure whether that's true, though.

        EDIT: This is not true, as given in an example by DEGwer in the editorial comments. spacewalker's comment below is good justification though.

      • »
        »
        »
        »
        7 лет назад, скрыть # ^ |
         
        Проголосовать: нравится +5 Проголосовать: не нравится

        It is... at least in this scenario.

        Every subarray is either a permutation of [1..n], or some suffix of a permutation, plus a prefix of the next permutation.

        Consider some permutation P, and divide it into parts R1 a R2 b R3 such that the length of R2 b R3 is maximal, and R2 b a R3 is decreasing. The next permutation algorithm tells us that the next one, Q is R1 b reverse(R2 a R3). Let's look at the subarrays based on where they start:

        So we end up with a range R1 a R2 b R3 | R1 b reverse(R2 a R3). (The divider indicates where Q starts.)

        • The subarray starts in R1 a. Then the prefix of P we don't hit is precisely the prefix of Q that does intersect with the subarray. So it's a permutation of [1..n].
        • The subarray starts in R2 b R3. If you simulate moving the subarray start through R2 b R3, you'll notice that the differences in sums of neighboring subarrays increase, then decrease. This means that the only time the sum will equal is when the start moves in Q.

        So either the subarray is a permutation of [1..n], or it doesn't have the right sum.

  • »
    »
    7 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится 0 Проголосовать: не нравится

    We can calculate for each x, the number of permutations where suffix of length x is not sorted. All these permutations combined with prefix of ext permutation of length n-x will have all distinct elements.

    As out of all x! permutations only one will be sorted.
    This can be calculated as n! * (x! — 1) / (x!) for all x <= n-1
    and simply n! for x == n

    The sum of all these terms will be the answer.

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +2 Проголосовать: не нравится

    ( (  ×  i!  ×  ((n-i)!-1))) + n!

»
7 лет назад, скрыть # |
Rev. 5  
Проголосовать: нравится +12 Проголосовать: не нравится

This contest was the worst performance of mine ever.. what a great way to end the year :/ I really felt out of luck this time, spent an hour on D but couldn't guess that formula even though it seems I was close. Oh well.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

Please don't tell E was erdos gallai + binary search

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

what a problem D is!

how to solve D.

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +12 Проголосовать: не нравится

    The idea is: number the permutations p1, ..., pn!. Then, for each interval of length n, say [l, r], some part of it is in permutation pi and the rest in permutation pi + 1. Let's say that [l, m] is in pi, and [m + 1, r] is in pi + 1. Now, you need to make two observations: Between one permutation and the next, any prefix either is the same as the other, or changes in exactly one element. If pi and pi + 1 have the same prefix of length r - (m + 1) + 1, then [l, r] will have sum . Else, they will not.

    The second observation is that a prefix of length l will change every (n - l)! permutations, so in total, this prefix will change times (the  - 1 comes from the last permutation).

    Therefore, to solve this problem, you notice first that if some interval is completely contained in a permutation, its sum will equal . Then, iterate over all the sizes of prefix, and for each, add to your current answer . The result is the answer.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

all math problems and i got hacked, gg

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +33 Проголосовать: не нравится

It was a year full of "well, I cannot prove it but seems a lot had solved it. let's try the intuitive solution. Damn! seems it worked".

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Pretest 8 for B?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

The difficulty of Problem D and E seem to be quite different. How to solve E?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

any idea about test 18 problem E?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

How to solve D: 1) Write bruteforce 2) output n*n!-bruteforce(n) 3) find this sequence in oeis 4) profit

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

Btw, is there a Hello 2019 where I can recover back?

1500 rating is not quite suitable for a Legendary grandmaster :D.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Very interesting problemset. Does anyone know how to pass 18th test of problem E?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

How to solve E

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

it cost me totally three papers to solve problem D

BTW,a nice contest :)

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

Who thought it was a good idea to propose a stackexchange answer as a problem?

Reference

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +5 Проголосовать: не нравится

    The problem statement provided a reference to those algorithms.

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +46 Проголосовать: не нравится

    Before clicking your link I was expecting to see this :)

    I've still managed to spend more than an hour to get it to work, though :(

    • »
      »
      »
      7 лет назад, скрыть # ^ |
       
      Проголосовать: нравится +3 Проголосовать: не нравится

      why u didnt solve a and b , petr

      • »
        »
        »
        »
        7 лет назад, скрыть # ^ |
         
        Проголосовать: нравится +39 Проголосовать: не нравится

        It's a combination of two things: I was hoping to get H right until the end of the contest, which would give more points; I was quite tired at the end of the contest, so I was basically staring at the statements and not understanding them (at least not immediately, and then I switched back to H).

    • »
      »
      »
      7 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      I also assumed G would be googlable, but I couldn't find this thread. I also solved D by googling the algo for next permutation and probably would've taken one extra hour to solve the problem otherwise (and with a complete proof, since it's not straight forward that you can only cut a sequence in the unaltered prefix)

      • »
        »
        »
        »
        7 лет назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится +1 Проголосовать: не нравится

        Problem D seemed quite solvable to me: I just wrote some random permutation such that the next one differs much from it, and looked at how much the sum differed from the expected sum at each point:

        prev:    2  8  3  7  6  5  4  1
        next:    2  8  4  1  3  5  6  7
        diff:    0  0 +1 -5 -8 -8 -6  0
        

        In another view:

        target sum is 36
                      subarray                          sum  difference
        2  8  3  7  6  5  4  1                           36      0
           8  3  7  6  5  4  1  2                        36      0
              3  7  6  5  4  1  2  8                     36      0
                 7  6  5  4  1  2  8  4                  37     +1
                    6  5  4  1  2  8  4  1               31     -5
                       5  4  1  2  8  4  1  3            28     -8
                          4  1  2  8  4  1  3  5         28     -8
                             1  2  8  4  1  3  5  6      30     -6
                                2  8  4  1  3  5  6  7   36      0
        

        From such example, we can see that, for the whole suffix that changed, the differences are nonzero in the general case: the first one is positive, and all the following ones are negative.

        Next, there is a straightforward calculation of how many permutations differ from the previous one in the last k positions. And then summing that up.

    • »
      »
      »
      7 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Nice find!

      I wonder though. The answer at StackExchange does not use the fact that all primes are of the form 4k + 3. It seems correct in the general case.

      So, how does the 4k + 3 help? When trying to solve problem G, I've found that law of quadratic reciprocity has a special case for numbers of the form 4k + 3, but couldn't make anything of it.

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +25 Проголосовать: не нравится

    That's not just a stack exchange problem. It's even worse: a relatively well known theorem (erdos gallai) which as a matter of fact was directly linked by the wikipedia article from the statement. I also find the problem veeeery bad, and apart from the trivial idea once you know the theorem, I found the code quite disgusting.

  • »
    »
    7 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +16 Проголосовать: не нравится

    That's not the correct causality. We found out after the problem was set, but still saw some substance to the problem (you first need to understand which question to ask and why).

    UPD: I thought it was about problem G. Disregard.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

super tricky problems hehe, tnx

»
7 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится +8 Проголосовать: не нравится

For B, I just output: {tx, ty} = {(sum of all(a[i]) + sum of all(x[i]))/n , (sum of all(b[i]) + sum of all(y[i]))/n}
I feel confused after seeing big codes of others :|

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Actually, the best contest of 2018...

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Today's problems were fun! Thanks to majk and coordinators!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +23 Проголосовать: не нравится

Problems were very well explained. No ambiguity. It gave you time to think instead of wasting it trying to understand the problems.

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +9 Проголосовать: не нравится

Nice problems. Bad difficulty. 2.5k+ solved D and 300- solved E. It's really big step. What results are you expected for that problems?

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +2 Проголосовать: не нравится

    We knew the jump was big. We expected a bit more solutions on F, but E is roughly what we anticipated after the tester spent time on them. I originally thought that F is a nice and simple Div1A-B problem.

    • »
      »
      »
      7 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      What was the solution for F? My idea is: first check how much water/grass needs to be added to avoid getting stamina < 0 on lava (water preferred to grass, added as early as possible); start with all flying, then "convert" it to walking/swimming with cost 2/1 for all lava in order; swimming is preferred and gets converted from largest position to smallest, walking gets converted from smallest position to largest. Finally, ensure the stamina doesn't drop below 0 on grass/water by converting flying in the same way (this part is trivial).

      • »
        »
        »
        »
        7 лет назад, скрыть # ^ |
         
        Проголосовать: нравится 0 Проголосовать: не нравится

        Yes, this greedy was my solution as well.

      • »
        »
        »
        »
        7 лет назад, скрыть # ^ |
         
        Проголосовать: нравится 0 Проголосовать: не нравится

        Are you saying you have two passes of conversion? Not sure, but it doesn't sound right.

        Maybe for the second pass, you need some flying converted to swimming earlier. And previously, you converted water from largest position to smallest. It may have been profitable to move the converted part closer to the front, so that the second pass is cheaper.

        In my solution, I had to handle both passes you describe simultaneously. To look ahead, I first calculated two quantities from back to front: how much surplus energy we will need moving ahead, and how much grass will be available ahead for conversion (I convert to flying, not from flying). Still not sure whether I got everything right though.

        • »
          »
          »
          »
          »
          7 лет назад, скрыть # ^ |
           
          Проголосовать: нравится 0 Проголосовать: не нравится

          How would I convert flying to swimming earlier? I convert to swimming asap whenever possible. If by earlier you mean position-wise, that could just lead to a worse situation where I just removed some flying I could convert to swimming to add stamina for flying over early grass in the 2nd pass.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +109 Проголосовать: не нравится

My rule of thumb: Quickly check the hard side of problem, and Ctrl+F for the word "factor", "prime number" or any number theory stuff. If there's any, skip the round.

Trust me. It works very well.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

Great contest to end 2018! Specially because you have multiple solutions for the problems :), which you get to know when you visit your room and see people doing tons of things to solve B!!

»
7 лет назад, скрыть # |
Rev. 4  
Проголосовать: нравится +23 Проголосовать: не нравится

[RANT]

I feel really hurt by problem G.

  • One of my solutions, 47754232, should clearly be WA#1 (notice that very early in the source code I output N nonsense lines of numbers!). However, it failed only on 4th pretest, costing me 50 points (actually a couple of times, as understandably, I couldn't expect the bug to stay there!)

  • One of my other solutions, 47754966, passed pretests in just under 3s. This was quite weird for me as my solution was essentially:

while (4 seconds did not elapse) { ask the interactor for stuff; }

(This is very important for what happens next.)

...but okay, it happens.

Then, 20-25 mins later, I get an announcement that we can't actually use more than 100 queries! This of course incurred a large penalty on me (a few more WAs, 40min worse time etc.) as I needed to do a bunch of patches in order to make it into the limit. (Hopefully, it will pass the systests.)

  • The statement for G still contains the phrase "You can print as many queries as you wish, adhering to the time limit." Dammit!

[/RANT]

I feel you should do something about each of the above.

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +17 Проголосовать: не нравится

    I have checked the submission you mentioned manually and changed it so that it doesn't ask too many queries. You seem to have some bug in your approach, since on test 5 it sometimes detects as few as 6 factors, depending on the randomness. The correct approach should have error probability of order 10 - 14 with 50 queries.

    I am deeply sorry about the issues you had during the contest with this problem, but in this case we will not change the verdict.

    I am happy to discuss more if you wish, either here or PM.

    • »
      »
      »
      7 лет назад, скрыть # ^ |
       
      Проголосовать: нравится +11 Проголосовать: не нравится

      I vented in the comment before and I don't think I have anything else to add. It's good to know that I had something wrong in my code, too. I still totally hate the way the things worked out (I hardly remember getting that infuriated by a single task), but there's no frickin' thing to do now.

      I wonder if I would've passed the original version of the problem. Or maybe not, I'd be fuming if it turned out I would.

      :<

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -99 Проголосовать: не нравится

I dont see how tourist can come up with the solutions to hard problems so fast. I think he is a great googler.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Boy, I am so slow, not only am I slower to code than everybody, but even my programs are judged slower than everybody...

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

how do i view the contents of a hack?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I made 5 unsuccessful hacks trying to hack two O(n3) solutions of problem B. This is the second problem in recent contests were the limit is set to 1000 and O(n3) solutions pass!

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +5 Проголосовать: не нравится

Problem D. I don't sure it's correctness. a[n]=n*(a[n-1]-1) starting with a[1]=3. ans = n!*(n-2) + a[n-2]

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +15 Проголосовать: не нравится

Are you sure that "Idleness limit exceeded on test 4" is not a bug in interactor?

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +8 Проголосовать: не нравится

Possible way of thinking in D:

Suppose the concatenated sequence of permutations is p(1) || p(2) || … || p(n!) where “||” is the concatenation operator. The sub-array you will choose will always be in the form of: suffix of length L from p(i) || prefix of length n-L from p(i+1).

Let’s loop on j from 1 to n to see how many suffixes starting at index j (in any of the permutations) we can choose out of all n! suffixes out there. First note how p(i+1) will differ from p(i), the rightmost number in p(i) which is less than to the number on its right (call this number v1 and its index in p(i) ind) will be swapped with the smallest number in sub-array [ind+1:n] (call this number v2) such that v2 > v1, then subarray [ind+1:n] is sorted in ascending order, sub-array [1:ind-1] won't change, resulting in p(i+1).

We have 3 cases here:

1) ind >= j, then all the changes will happen within the sub-array [j:n] to get p(i+1), so prefix of length j-1 is same in p(i) and p(i+1), so you are sure this suffix || prefix should be added to answer.

2) ind<j-1, then the prefix of length j-1 will be different in p(i+1), here is one important thing to notice:

In p(i), sub-array [ind+1:n] is sorted in descending order and p(i)[ind] < p(i)[ind+1]. This implies that p(i+1)[ind] will be v2 and sub-array [ind+1:j-1] in p(i+1) will have sum at most = v1 + v2 + (sum of sub-array [ind+2:j-1] in p(i) or 0 if ind+2>j-1). So the prefix of length j-1 has sum in p(i+1) < than that of p(i) and this suffix || prefix shouldn’t be added to the answer.

3) If ind==j-1, then prefix in p(i+1) will have greater sum (as v1 is swapped with v2), and this suffix || prefix also shouldn't be added to answer.

To conclude, our answer for every suffix of length L (for L from 1 to N) is the number of suffixes of length L which are not sorted in descending order = n! – nCL * (n-L)!. Add 1 at the end to account for p(n!).

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

I was frustrated seeing so many people solve D quite fast. But What!? OEIS!? Thanks a lot to let me know such a great thing!

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +64 Проголосовать: не нравится

I made a submission for problem G which passed pretests with 100 sqrt requests, and then printed the answer. After the limit was put in place, it still showed as passed presets, but it failed systests on test 1. Is there anything we can do about this? The problem statement says 100 requests, and printing the answer doesn't seem to be a request.

The submission is here: 47750364

»
7 лет назад, скрыть # |
Rev. 4  
Проголосовать: нравится +12 Проголосовать: не нравится

Maybe I should actually read the wikipedia link that was given in the problem statement E instead of wondering where everyone got the solution from.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

in problram F:

3
1 1 1
GWL

shouldn't it be 5+3+1=9?

no, it's 2.5+0.5+3+1=7

I didn't even realized can fly half meter until someone told me.

Watch problem again, The duck looks at me like look at a retarded : |

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +86 Проголосовать: не нравится

After long struggle with Python3 and bugs, my 2018 sadly ends with

My solution rquires division over big integers. However I have no template for it, so I tried to implement it using C++ first, after some time I changed my mind. Because of unfamiliar with Python, I spent long time coding, thinking about many things about language rather than the problem(like is there any functions like std::unique()?). Oh it's really a terrible night for me.

Well I didn't mean stop writing problem, I think the problem is a good problem but it's harder for people only using C/C++, compared with those are familiar with Java or Python.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

Why do I see legendary grand masters with ratings less then 1400? Is this a glitch? Someone please explain.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +38 Проголосовать: не нравится

A duck comes to another duck to 'duck' lmao

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +15 Проголосовать: не нравится

47761370

Oh come on! TLE 50, for real?? That's , man, it's not supposed to have TLE on !

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +21 Проголосовать: не нравится

When will the ratings be updated?

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +13 Проголосовать: не нравится

The moment I saw the solved count of D for the first time, I felt like something wasn't right, and went for OEIS, yet found nothing (I tracked the wrong pattern I supposed). Then 20 minutes later I solved D by a math-inspired dp solution, with a few proofs backing my claim.
Then two hours later people told me that D can be OEIS-ed...
I don't know what to say regarding my case... :)

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

Is it rated majk?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится

Out of curiosity, how were the large primes of the form 4k+3 created for test data in G?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

It's so...disappointment... I used unsigned long long and get Time Limit on pretest 4 for n = 1:

for (ull d = 1; d <= n - 2; d++)

I shoud just use usual long long, but... loosing 39 points of rating because of such stupid little mistake...

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +8 Проголосовать: не нравится

Good Bye 2018

ok

open the contest

solve first problem

ok

look at rest of problems

it's all math

uh oh

manage to solve the first 4 through some gift from the math gods

lose a couple rating but that's expected

eh

contest extended for 10 minutes

what

give up while there's 3 minutes left, can't possibly code E from scratch

time to relax after this disaster of a round, go play minecraft

1 minute later

C got hacked

what

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

3 10 10 50 WGL

In problem F how is the ans 220 for this ? I think it should be 240? Am i missing something? pls help

  • »
    »
    7 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +10 Проголосовать: не нравится

    To fly pass 50 meters of lava, you'll need 50 units of stamina, taking 50 seconds.

    Going past 20 leftmost meters normally will build up 20 units of stamina, taking 80 seconds.

    To build up additional 1 unit of stamina, the most optimal way will be swimming in-place within water segment. It's like, from a point in the water segment, you swim to the right 0.5 meters, then swim back to your starting point (or you can choose to start swimming to the left then going back right, the result is still the same). Each unit of stamina stacked costs you 3 additional seconds.

    You'll need 30 more units of stamina before flying pass the lava, so you'll need 3·30 = 90 seconds for the process of building up stamina.

    Overall, the answer will be: 50 + 80 + 3·30 = 220.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +56 Проголосовать: не нравится

Math problem: * exists *

Codeforces users:

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -30 Проголосовать: не нравится

rename codefoces in mathforces

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +52 Проголосовать: не нравится

Tourist beat 2nd place by more than 2000 points. Anyone else thinks this is scary?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится

Мне пришло сообщение о том, что случилась утечка моего кода по задаче D. Оказывается, такое может случиться, если пользоваться ideone.com. Я не знал о том, что использование ideone.com не является безопасным. Заявляю, что никоим образом не хотел причинить вред ресурсу codeforces. Прошу не блокировать мой аккаунт и не применять ко мне штрафных санкций.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +64 Проголосовать: не нравится

I was wondering why rating update is taking so long. Then I noticed that my rating change is 0

»
7 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится +2 Проголосовать: не нравится

It was really a GoodBye 2018 Contest

Good Job Problems Setters and thanks for Giving me a good feeling as a Competitive Programmer

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

The contest is amazing.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Goodbye 2018! This year I learned much knowledge and made many friends with the ones who also love algorithm and love codes.I think codeforces is a wonderful platform that give we all another home! Hope we all better and better:) Happy New Year!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

In Python for C question, return t + (t*(t-1)*d)/2 gives correct answer but, return (t/2)*(2 + (t-1)*d) where t is the number of terms in AP and d is the difference.. gives wrong answer on testcase 18. Can anyone explain this please?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I see many of the comments referring that D can be easily solved with OEIS. Can someone explain what is it and how to use it?

  • »
    »
    7 лет назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится +3 Проголосовать: не нравится

    https://oeis.org/

    A sequence encyclopedia. In problem D you're given a N, if you assume the answer is a known sequence then you can brute force the first 10 elements of the sequence, and then search it on OEIS. If it's a known result then the website is going to provide you with a formula to calculate the i-th term of the sequence, i.e. the answer to the problem.

    In this case the problem itself wasn't on OEIS, but the diference between every interval (n! * n) and the answer for the problem, call it ans(n). If you brute force the solutions for the first 10 n or so, i.e. ans(1), ans(2), ... ans(10), you can look up the sequence of the difference dif(n) = n! * n — ans(n) on OEIS and get the formula that solves the problem.

    If the website gives you some formula f(n) to calculate dif(n), then then answer to the problem will be ans(n) = n! * n — f(n), derived from the previous equation.

    This is the difference sequence i found on OEIS: https://oeis.org/A038156

    This is the one i used, which is the opposite of the previous one: https://oeis.org/A166554

    The second link provides you with the formula "a(0)=1, a(n) = n*(a(n-1)-1) for n>0", so the answer you would be looking for is n! * n + a(n), since i said it's the opposite to the actual sequence, i.e. a(n) = -f(n)

    Don't forget to include % MOD when calculating everything on the implementation.

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Well, it's better not to use it ;) Give some time on it's mathematics to see how overlaps between two permutations contain all the numbers (thus, the same sum), and you will yourself derive what's needed! Sample cases for the rescue, verify your formula for 3 and 4!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can anyone help me understanding the approach of C? I am a beginner.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Huh, some specialist took the third place.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -18 Проголосовать: не нравится

Good luck & high rating!

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I am so happy to be a specialist after goodbye 2018.

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Case 7 of F is: 1 9 W

Jury's answer is 18. Can someone tell me how this is possible? The best option I can find is 19.

[Solved] swim 4.5 meters and fly 4.2, 4.5*3 + 4.5 = 18

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится -11 Проголосовать: не нравится

[Deleted]