Блог пользователя i.e

Автор i.e, 6 лет назад, По-русски

Мы с turist рады пригласить вас на Codeforces Round 669 (Div. 2), который пройдет в 08.09.2020 17:35 (Московское время). Он будет рейтинговым для всех участников, чей рейтинг ниже 2100.

Задачи были придуманы и подготовлены turist и i.e. Мы хотим поблагодарить всех, кто оказался причастен к этому раунду:

У вас будет 2 часа на решение 5 задач, одна из которых будет интерактивной. Вы можете ознакомиться с руководством по интерактивным задачам здесь.

Отдельное спасибо хочется сказать моему замечательному минипигу Швайне, который вдохновлял нас в течение всего времени подготовки задач.

хрю

Разбалловка будет ближе к началу контеста.

UPD1: В условиях не будет картинок с минипигом. :)

UPD2: Разбалловка: 500-1000-1500-2000-2500.

UPD3: РаЗбОр

UPD4: Поздравляем победителей!

Div1 + Div2:

  1. ksun48

  2. WZYYN

  3. tribute_to_Ukraine_2022

  4. neal

  5. jiangly

Div2:

  1. Hoxilo

  2. deep_fake

  3. GiannisAttemptafreethrow

  4. watemus

  5. wasureta

  • Проголосовать: нравится
  • +736
  • Проголосовать: не нравится

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

Автокомментарий: текст был обновлен пользователем i.e (предыдущая версия, новая версия, сравнить).

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

Auto comment: topic has been updated by i.e (previous revision, new revision, compare).

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

As a tester I would say that, the contest is really well prepared and the questions are awesome.

antontrygubO_o orz.

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

Why is LordVoldebug mentioned as a tester twice?

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

i have a night now i scared about picture))))) thanks)

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

My EYES, My EYES !!!

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

Why is Putin2024 a tag?

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

Why is Putin2024 a tag?

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

No such pics in problem statements plz

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

To be honest, I was scared by the minipig Schweine when I opened the website. Will he be the hero of the problems? I'm looking forward to it(I love interesting background)!

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

what a terrible day to have eyes.

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

istg if you look straight into the eyes of the amazing minipig Schweine you'll have goosebumps.

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

I peed myself looking at that

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

Можно эту свинью вставлять вместо скримеров, такой ужас

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

Is this pig the protagonist of the stories in the oncoming round?

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

Please don't put a picture of the minipig in every problem statement.

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

I hope we don't have a picture of the minipig in every problem statement.

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

My new sleep paralysis demon Boy-scared-of-man-in-door.jpg

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

Opening the site and this minipig is the first thing that comes out to eyes lol. Really looking forward to see him as the theme hero if turns to be so!

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

That picture is terrifying,please no such pictures in problem statements.

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

Can you please put your amazing minipig under the spoiler?

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

Why people are being dumb and stupid, and overreacting to the picture??

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

Good ideas of problems you've prepared! Each is worth tasting.

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

A very cute pig =))

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

Get a good night's sleep after look the amazing minipig #_# 1h a.m here

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

Can someone please explain to me why my friend who had rating 1479 before contest got +37 after achieving 3025 rank, and I only got +10 since I had lower rating (1470) than him, and got higher rank than him(2744). This thing is not letting me sleep. Please respond if anyone knows about this ??

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

MikeMirzayanov I think this pic is too much...

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

i.e's comeback after their drop to specialist is my motivation.

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

Can somebody tell me what is an interactive problem?

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

Is number of user increases or the people uses multiple account ??

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

I was going to participate in the contest, but now I've seen that pig I'll better lock myself in my bathroom

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

It will be another nice interactive problem :))

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

Thanks for Reference of how to deal with interactive problem

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

We want to know.

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

IInteresting xd

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

.

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

scary pig

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

As a minipig, give me contribution

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

the contest is really well prepared and the questions are awesome. :)

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

The pig makes me want to skip the contest...

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

Good luck!

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

![ ](b02acad31d9104ae6c2b82f4478eb7a9741ba34b.jpg)

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

as coautor and creator of deleted offensive meme I want dislikes and harassment charges on twitter

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

"UPD1: There will be no pictures of minipig in the statements. :)"

So sad. I think I'll have to skip the round then.

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

I hope I would become expert in this contest :)!!

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

That pig looks hideous.

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

This picture is so scary!

I was so scared!!

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

MikeMirzayanov This is too much.Please delete this pic.

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

Sorry for off-topic but why hasn't ratings for the last round been rendered back again yet?
PS: Ratings are back now

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

No scary pic in problem statements plz.ToT

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

Why is this picture here??

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

i fear the demons that possess the problemsetters.

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

This pig is causing PTSD.

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

The picture should be removed imo. Maybe it's some kind of meme and maybe it's funny for some people, but I don't get the picture of the pig. I might be overreacting, but it's extremely disturbing to have to see it every time I scroll through codeforces home page. After all, this isn't creepypasta.

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

I was not sure about registering for the contest but after the pig appearing in my dreams for two days straight I am glad to say I'll be losing my score today :/

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

Thanks for putting the pig picture in Spoiler, that's so much better!

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

Oh, thanks for delete the pic.

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

You should have also added, "Resemblance to any living or dead person is purely coincidental." Unless I am mistaken in identifying.

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

 

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

I hope interactive problem will be nice :) and good luck everyone for the contest.

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

After so many ups and downs i am hoping that my rating increases. :(

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

I made the mistake of clicking on the spoiler 10 mins before the contest. Now, I just have to hope that it won't haunt me during the contest :/

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

First problem is literally laughing at me

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

Is it just me who is feeling the questions to be more difficult than usual?

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

When I start practising 1500 rated problems then I'm unable to A,B problems in contests, When I practice A,B level problems then I'm unable to do 1500 or more rated problems. Any solution anyone? :/

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

Unclear question 1407B - Big Vova , I couldn't understand what lexicographically maximal is.

In the clarification, it says "a is a prefix of b, but a≠b" I don't know when a is called a prefix of b. It would be great if Authors could give example to make things clear. Long and unclear question.

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

Is D DP?

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

Even if solution of A is $$$O(n)$$$ why constrain is so low?

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

I love so much when I understand the exact task just 5 min before the end

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

How to do problem C?

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

Similar problem to today's problem E: https://dmoj.ca/problem/ioi11p4

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

Should have not attempted this contest....Bad Day :(

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

Personally this is the hardest contest I ever had.

Can some one tell how to solve A and B after the contest?

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

    For A if the number of zeroes is >=n/2 then just type out n/2 zeroes.Otherwise it means that the number of 1 is greater by at least 2 than the number of zeroes so you write out n/2 ones or n/2+1 ones depending which of those is divisible by 2.

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

Problem A is very nice for its position. Well done.

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

Smn plz check my solution on B https://mirror.codeforces.com/contest/1407/submission/92280369 I don't know why it fails on the second pretest

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

The interactive one was nice...

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

Nice Problems

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

Problem A killed me, 3 WA and 22 minutes to get it passed. It was my mistake thought :\

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

Someone has hints for D?

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

problem A is too hard

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

Anyone willing to help my submission for div2 qns C. Did the flush and follow query format but still cant pass. Thanks

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

Hmm.. Now, I'm interested to know how Mr. Kinky Pig inspired this conspira- um.. contest.

Nice problemset btw.

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

Round gave me PTSD.

Took 36 minutes for A, 8 minutes for B. Life's weird.

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

    kinda same with me, 28 mins for A and 11 minutes for B.

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

    Story of this contest:

    • Spent an hour in A, didn't solve with a couple of wrongs.
    • Went to B.. Got a way to solve it in ~10 minutes but WA because of simple small mistake (literally had to change position of variable declaration) but ofcourse I panic-ed and went back to A leaving B for a bit.
    • More 20 minutes on A.
    • Jumped back to B, immediately realized the small mistake and boom AC.
    • Remaining time of contest in A with no luck..
    • Contest ends so I look at submissions of A and realizes I don't need an even sized array as output.......
    • Facepalms and laughs.
»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Has anyone solved D with $$$O(n * log(n) ^ {2})$$$ solution. I got TLE.

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

    Can you tell me your idea. I tried to solve using binary search and segment tree, my solution complexity is also $$$O(n*log(n)^2)$$$ but got not getting correct answer.

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

      Actually I thought like $$$dp[i]$$$ is the minimum steps required to reach $$$ith$$$ index. Now there are cases if $$$h[i] \gt h[i - 1]$$$, $$$h[i] \lt h[i - 1]$$$, or $$$h[i] = h[i - 1]$$$.
      $$$ Let$$$ $$$dp[i] = 1 + dp[i - 1]$$$
      if $$$h[i] = h[i - 1]$$$, then do nothing
      $$$if(h[i] \gt h[i - 1])$$$ then, find the first index $$$i$$$, let's say $$$j$$$ such that $$$h[j] \gt = h[i]$$$, and also find index $$$k \lt j$$$, such that $$$h[k] \lt h[j]$$$.
      $$$if(h[j] == h[i])$$$ then $$$dp[i] = min(dp[i], 1 + dp[j])$$$
      $$$else$$$ $$$dp[i] = min(dp[i], 1 + min(dp[k + 1], dp[k + 2], ..., dp[j]))$$$
      similary handle for $$$h[i] \lt h[i - 1]$$$.
      I think this is correct but IDK why I got TLE.

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

Is it just me or the implementation for Problem B was very hard?

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

https://www.youtube.com/playlist?list=PLBqHLq3IFiRLBB96TUEoxBvP80s73uSPo

Do visit the editorials of all the problems given .

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

I'm really sad I got C solution idea but couldn't code it in time :(

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

A is cool, but cursed

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

Pupil to Specialist...Great Contest.

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

https://www.youtube.com/channel/UCBStHvqSDEF751f0CWd3-Pg/

Subscribe to this channel for all editorial videos .

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

Missed that the length of the array is even in A, wasted 30 mins. Maybe authors should bold important info in the question itself rather than in the constraints section.

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

Am I the only one who thought problem A required an output of even size... My mistake ofc but just wanna know if I'm the only dumb here lol....

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

Today's div2A problem was the most perfect div2A problem I have ever seen in any CF div2 round.

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

My rating after me solving A after fourth attempt:

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

In today problem C I have submitted O(n) solution in pypy3 it got TLE in tc 6 . Again I have submitted almost same solution and got an AC in 997 ms . I have seen most of the pypy3 codes getting execution time above 900 ms .
But then I have coded it in c++ as it may get TLE again in the systests and got AC in around 300 ms. This is not only today that I have faced this kind of problem , I generally switch to C++ in case of any problem involving recursion . But how may I know that an O(n) can also get TLE .
So to all the respected problem setters please check if the python solution is accepted with a considerable margin or just increase the time limit.

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

    The issue with python is that it never take a fixed amount of time for running a piece of code, running the same code multiple time can sometimes yield different results. This is not just on codeforces but many other platforms also faces criticism for uneven time limits of python but you see its really not in their hands because increasing time limit can make unintended brute force solutions pass the system tests. You can correct me if I'm wrong.

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

      I am not blaming them . I just want to say they should check if the python solution is getting accepted with a considerable margin . If not they can just increase the time limit by some milisecond . 1 to 1.5 or something like that.

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

    They clearly can set TL by language which they dont

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

    Problem with python programmers (who do CP) is they only know how to whine about time limit. First of all, you use not the best tool for a task(python instead of c++/java) then you complain about things not being same for you, like WHAT?

    Also there are many high rated python coders, so clearly things haven't really been unfair, you just don't know python enough for CP. Either learn python more indepth, understand all intricate and subtle things about it then use it for CP (you won't need to complain then) OR use a more appropriate tool(C++/Java/Rust/..)

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

    I agree with you that this interactive had kind of a tight time limit.

    It is possible to pass just using the default PyPy IO 92228274 (951 ms), but the TL is tight. Important to note is that the built in IO in PyPy is far slower than CPython IO. The same code in CPython runs in 655 ms 92292022. The work around for PyPy is to use a drop-in fast IO template 92308464 (670 ms).

    About your code 92261279, there are two ways you could improve it.

    1. Don't import a crap ton of stuff that you don't need/use. Your unused imports at the top take like 150 ms in PyPy3. Also by doing from math import * you are overwriting the very useful built in pow function.

    2. You can make use of fast IO templates like this to greatly speed up the IO in PyPy.

    With both of these improvements your TLE code runs in 748 ms in PyPy 92307825.

    As a final remark, it is possible to get below 300 ms even in PyPy 92288195.

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

Edit: case was wrong nvm

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

In question A div 2 We can not remove consecutive elements so for case 4 1 1 0 0 Why answer's (1 1) and (0 0) are getting passed , Since in both cases consecutive elements are getting removed.

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

This was my first interactive problem which i had tried and got wa only for using long long variable..Is there any restriction about using long long at interactive problem???

Sorry i don't know about that matter.

Thank you kindly for any good response. @realhype

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

Who could tell me the correct algorithm to solve Problem.D ? Thanks!

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

What to do if one dosen't get the logic, like me in problem A.?

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

    Skip the problem.Do the others and comeback.Each person can probably solve questions upto slightly above their rating. By that logic I usually try up until D, many a times skipping questions I didn’t get in 10 min.Today is a good example. Didn’t get A in 10 min, so skipped it, did B and C, came back to it, it worked out.

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

In div2C, I got system test failed, submitted in C++17 and now even sample test is not passing for that solution(if it was shown during contest, I could have tried to correct it). While when I submitted the same code after contest in C++11, it got Accepted. Why is this weird behaviour? i.e, turist

Link for WA(C++17)

Link for AC(C++11)

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

I don't know good or bad but why was Problem A laughing at me :sob:.

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

Good problems on math.

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

Bye, my rating..Even if we know each other for less than a day, I still miss you from time to time.。

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

Hello everyone,

I received a strange runtime error on TC 10 in today's Problem B — "Big Vova" in pypy2.

Here's the link to simplified code, 92298672

But after adding a useless line to the solution it got accepted. Which was:

if pos == -1:
     print(1/0)

Link to the accepted solution, 92298831

If you read my code, the above snippet never gets executed according to my logic.

I am confused if this is pypy2 fault or cf. There were few other python submissions that had the same problem like this one for example 92244789. If anyone of you knows what's happening please do let me know.

Link to my original submission during the contest 92248591

I would like i.e turist to see the submissions. Thanks in advance!

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

So,when will move the cheater and change the rating?

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

can i get input and output files for q1 and q2 because i am not able to find my logic anywhere wrong for q1 and in q2 when i checked for wa for input2 it is showing same same as answer and also check my code for q1(https://mirror.codeforces.com/contest/1407/submission/92244915) and q2(https://mirror.codeforces.com/contest/1407/submission/92258924)

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

    In B(q2) you are sorting based on best gcd value with only the maximum element this won't work since we need gcd of all elements upto i for each value of ci.

    Instead you need to keep choosing the element that gives best gcd value with gcd(all chosen elements till now). And initially choose only the maximum element.

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

Question D. Discrete Centrifugal Jumps With explanation.

I hope my comments will help others to underastand the solution :)

// vrkorat211 - Vivek Korat

const int N = 3e5 + 5;
 
int n;
int a[N];
void GO()
{
    cin>>n;
    for (int i = 1; i <= n; ++i)
    {
        /* code */cin>>a[i];
    }
    std::vector<int> dp(n+1);
    stack<pair<int,int>> st1,st2;

    st1.push({a[1],1});
    st2.push({a[1],1});

    // dp[i] = minimum step to reach at index i with given two jump properties.
    // pair.second in stacks will store index of pushed element.
    // it will be used to access dp array.

    /**Algo.**/

    // st1 will keep elements with strictly decreasing order.
    // st2 will keep elements with strictly increasing order.

    // for both sequence, if the sequence is broken then pop some elements
    // to get sequence property(strictly increasing or strictly decreasing) back. 

    // when we pop element than one of the jump properties will be followed so update dp[i]
    // accordingly.

    /**\Algo.**/

    // Above comments may help to understand the code :)

    dp[1]=0;

    for (int i = 2; i <= n; ++i)
    {
        //one move always possibee from index (i-1) to index (i) in 1 step;
        dp[i] = dp[i-1] + 1;

        if(a[i] > a[i-1])//st1 property violates.
        {
            //pop untill strictly deacreasing property follows with current element
            while(!st1.empty() && st1.top().first < a[i])
            {
                st1.pop();

                if(!st1.empty())
                {
                    //a[i] and top element follows jump property.
                    //update dp[i]
                    dp[i] = min(dp[i],dp[st1.top().second]+1);
                }
            }
        }
        else if(a[i] < a[i-1]) //st2 property violates.
        {
            //pop untill strictly increasing property follows with current element
            while(!st2.empty() && st2.top().first > a[i])
            {
                st2.pop();
                if(!st2.empty())
                {
                    //a[i] and top element follows jump property.
                    //update dp[i]
                    dp[i]=min(dp[i],dp[st2.top().second]+1);
                }
            }
        }

        // remove top equal elements from both stacks.
        // Because they violates sequence property of both stacks.
        while(!st1.empty() && st1.top().first == a[i])st1.pop();
        while(!st2.empty() && st2.top().first == a[i])st2.pop();

        // Now current element is in proper sequence for both stacks.
        // So push it in both stacks.
        st1.push({a[i],i});
        st2.push({a[i],i});
    }

    //finally d[n] is minimum step to reach at index n.
    cout<<dp[n]<<endl;
}

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

Why I was the last but still give me points?

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

in problem D what is the problem if I get the minimum of going to {current index + 1, the first number bigger than me, the first number lower than me, the biggest number less than me, the lowest number bigger than me} using dynamic programming???? my code

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

92240790 1407A - Ahahahahahahahaha I did pretty much what the question asked for. Coded the brute force approach, but I cant seem to find where I am going wrong ?

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

thanks for nice contest :)

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

I really enjoyed Problem D, thanks!

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

Such a nice D and E. Wow.