Автор awoo, история, 4 года назад, По-русски

Привет, Codeforces!

В 17.05.2020 12:20 (Московское время) состоится Educational Codeforces Round 87 (рейтинговый для Див. 2).

Пожалуйста, обратите внимание на необычное время проведения раунда.

Продолжается серия образовательных раундов в рамках инициативы Harbour.Space University! Подробности о сотрудничестве Harbour.Space University и Codeforces можно прочитать в посте.

Этот раунд будет рейтинговым для участников с рейтингом менее 2100. Соревнование будет проводиться по немного расширенным правилам ICPC. Штраф за каждую неверную посылку до посылки, являющейся полным решением, равен 10 минутам. После окончания раунда будет период времени длительностью в 12 часов, в течение которого вы можете попробовать взломать абсолютно любое решение (в том числе свое). Причем исходный код будет предоставлен не только для чтения, но и для копирования.

Вам будет предложено 6 или 7 задач на 2 часа. Мы надеемся, что вам они покажутся интересными.

Задачи вместе со мной придумывали и готовили Роман Roms Глазов, Адилбек adedalic Далабаев, Владимир vovuh Петров, Иван BledDest Андросов и Максим Neon Мещеряков. Также большое спасибо Михаилу MikeMirzayanov Мирзаянову за системы Polygon и Codeforces.

Также спасибо Neal neal Wu за прорешивание задач.

Удачи в раунде! Успешных решений!

Также от наших друзей и партнёров из Harbour.Space есть сообщение для вас:

Codeforces and Harbour.Space

Привет, Codeforces!

Мы хотели бы пригласить вас на вебинар под названием Digital Lockdown: AI against COVID-19, который проводит Сергей Гордейчик, руководитель нашей программы Cyber Security.

Во время этого вебинара Сергей поделится своим анализом и инсайтами о том, как положительно и отрицательно искусственный интеллект используется во время глобальной пандемии COVID-19. Настройтесь узнать некоторые практические примеры того, как компании используют ИИ для инноваций и разрушения во время кризиса, исследуя такие темы как медицинская визуализация для КТ-анализа, диагностики и массового наблюдения.

Присоединяйтесь к нам в четверг, 28 мая, в 12:00 (BCN), чтобы получить знания и углубить свое понимание того, как мы можем использовать ИИ для решения как операционных, так и социальных проблем.

Принимая участие в этом часовом вебинаре, вы получите сертификат участника, специальный цифровой подарок от Сергея и получите шанс выиграть БЕСПЛАТНЫЙ 3-недельный модуль в Harbour.Space University, в зависимости от наличия и условий курса.

Забронируйте свое место сейчас!

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

Место Участник Задач решено Штраф
1 square1001 8 294
2 Anadi 8 305
3 tfg 8 681
4 244mhq 7 192
5 xay_naive 7 248

Поздравляем лучших взломщиков:

Место Участник Число взломов
1 qwscaln 29:-2
2 Ankit 5
3 the_redback 3:-1
4 lvao-x 3:-1
5 WICK_ED 2:-1
Было сделано 142 успешных и 828 неудачных взломов.

И, наконец, поздравляем людей, отправивших первое полное решение по задаче:

Задача Участник Штраф
A fedoseev.timofey 0:02
B Ashishgup 0:03
C1 hitman623 0:04
C2 square1001 0:15
D Not-Afraid 0:10
E autumn_eel 0:17
F squarepants 0:47
G riantkb 0:37

UPD: Разбор опубликован

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

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

Good Luck ..

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

Wow this is really a good time in the Philippines! We can finally experience to join a contest at 5PM

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

Codeforces is entertaining quite by regularly holding contests in Lockdown. I'm enjoying. What about you guys?

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

awoo , MikeMirzayanov with all due respect , can you please reschedule the round to next day or during usual time since kickstart will start 5 minutes before this round will end . We can't code for 5 hours straight .

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

Whatever time it is the participants always show up in large numbers. I'm proud of this community :)

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

Hey, this will clash with Kickstart round C for the last 5 minutes of contest, could you please schedule it something like 10 minutes earlier?

Thanks

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

Back to back contests.. That's why I love codeforces.

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

Does the hacking phase got any points? Or will it affect the rating?

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

I have rarely seen unusual time in educational rounds. What is the reason for unusual time?

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

    I am not very sure but as far as I know, the contest time depends on the availability of the setters/testers during the contest. So the reason might be the mutual time decided by the setters/testers as their available time. Someone correct me if I am wrong.

    EDIT: It seems one of the setters has already notified the reason. This contest is tied to a local contest in Saratov.

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

    IDK

    Maybe because of some other coding events(or contests)

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

I think it's clashing with Google Kickstart round C. Though just 5 minutes but still it matters

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

    There is no break between the two contests that is only problem, usual time would't have created this problem. At last it is up to problem setters, they have their reasons.

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

Will it be easier than general codeforces round of div 2 ? (I have fewer experience about educational round )

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

    I feel educational rounds slightly more difficult than regular div 2.But be sure to learn newer things.

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

    maybe harder cause its problems is from GCJ

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

    from my experiences the difficulty is pretty much similar. but the open hack phase introduces some new challenges for us

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

This contest has a clash of 5 minutes with Kickstart Round C. It would be better if this contest gets preponed by 5 minutes or so.

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

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

I kindly ask newbies and pupils not to participate in this round, you are causing big queues. you are wasting time. Stop programing!!!

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

dsn

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

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

Unfortunately, we cannot shift the round time because it is tied to a local contest in Saratov.

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

Codeforces evolution ->

2017 — Spamming "Is it rated?"

2020 — Spamming unfunny memes

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

    I feel it's my fault :P

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

      No bro you are the legendary grandmemer of codeforces ,soon you will be among the top contributors

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

        Thx <3 but Nah I won't reach top contributors the higher your contribution is the harder it gets to gain more and I'm running out of memes

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

Kickstart -> Educational -> Atcoder. This is just usual Sunday !!!. what's the hurry ?

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

so should we just abandon last 5 minutes of this contest for kickstart ?

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

deleted

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

How do I unregister from this round?

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

Nice contest time :)

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

Finally, I didn't do codeforces in the early morning. This unusual time is too nice for me

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

It's a good time for Chinese people, but it may not be good for other places :)

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

Should I skip this round for kickstart or should I give both. Any suggestions?

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

Live epic upsolving after the round:

https://youtu.be/SdwVz4qzhkY

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

Hey, how come no more non-Kotlin Heroes contests scheduled after this Educational round? (Like dang, many hours past the contest...)

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

Just meme :-) Pics-Art-05-17-01-11-34

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

I think codeforces community is trying to know which time is the best time for holding contest so we don't encounter any problems. I think it is the strategy to find the most suitable time.

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

Is there any specific reason for UNUSUAL TIME or its just fun? :)

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

Hope this contest will have some graph and DS problems.

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

Great time!! Thanks for arranging contests so frequently . Thanks in advance for the webinar.

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

A really good time for Chinese! We can enjoy the contests this weekend without staying up late.

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

It's the first time I am sitting for contests back to back. Hope the results will be good.

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

Less than 20k participants after a long time . Results of Kick start clash may be . Looking forward for an another interesting problemset .

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

Contest Extended!

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

Delayed?

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

The contest got delayed 10 minutes and now the overlap with Google Kickstart is 15 minutes

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

Delayed for 10 minutes.

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

delayed :(

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

Delayed by 10 minutes!!!

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

The voltage increases... another ten minutes.

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

delayed:c

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

what the hell is going on ??

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

Damn it, it's getting even worse now we have to abandon last 15 minutes of this contest

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

A penalty of 10 mins to everyone!! HAHA Another 5 mins! Congratulations

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

Delayed by 10 mins : hope server is fine

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

Quite unfortunate seeing 10 mins extension. Google Kickstart starts at 4:30 m today, 15 mins earlier than this contest ends. :(

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

Now a 15 minute overlap with kickstart,rather than 5

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

I don't think it's very sensible to further delay the contest with an overlap of 15 minutes with Kick-start (which is a fairly popular competition and has almost 10k+ participants this year..)

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

Everyone said make it 5 min earlier. Boom you delay it by 10 min.  People start worrying for Kickstart. Meanwhile Codeforces : "Here comes another 5 min, you guys just probably spamming"

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

let's hope this delay is not a sign of long queues during the contest

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

Contest should be postponed.It directly overlaps with Google Kickstart 2020.

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

Google Kick Start! :(

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

Is this a measure by the problem-setters to decrease their competitors in Kickstart? >.<

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

    In that case, people will do Kick Start instead of this contest.

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

      I don't think so, Kickstart has it's prestige but to people who want rated contests, they might skip Kickstart(or join late).

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

For the First time, a 100 minute contest! XD

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

Amazing.

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

Another 5 mins....

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

yo come on xd

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

okay now i am probably gonna take part in atcoder instead of kickstart (:

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

Another 5 mins :(

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

This is frustrating

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

Now , i m not participating

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

Man, You guys are killing me. Delayed further by 5 Mins. Its a 20 min overlap now.

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

Please make sure not to start to early ;)

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

I am truly amazed by the arrangements.

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

WTF is happening. Again 5 min delay.

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

Why delayed again?

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

JUST TELL ME THE FINAL TIME OF STARTING CONTEST. GETTING PRETTY ANNOYED BY CHANGING TIME.

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

I want my 20 minutes back

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

I was already ready to go in, as here again the transfer for 5 minutes )

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

Now the overlap is 20 minutes!

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

just forget about Kick Start

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

Seems its a trap now :)

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

Why are they playing with our feelings?

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

my patience is giving up .

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

5 more mins?

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

What the hell is that,2 delays?

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

The contest is delayed by 15 minutes, so now we have 20 minutes intersection with Kickstart. Tough spot to be in.

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

Here we go again!

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

10 minute delay had a bonus!

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

Again Delayed! It hurts more than a breakup.

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

While(onClick("Start Contest") { startTime+=5; }

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

1 is okay but 2 is a bit frustrating

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

Server in trouble?

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

delay the round without notice is really uncomfortable...

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

Are you guys planning to delay it over and over so that it starts exactly at the same time as Kickstart?

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

Once more!! Once more !!

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

wtf???????

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

why is starting time getting postponed every 5 minutes?

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

I wonder what had happened to this round.

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

Now 20 min penalty woaah why cf ??

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

Testing our patience? xD

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

What should be the priority kickstart or codeforces ??

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

Now we'll get to see real CF fans

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

Maybe they are waiting for 20K registrants.

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

Another 5 min, Hope clear statements !

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

delayforces /qiang

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

How to solve A?

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

When I say myself,**"Now we go",**then Suddenly I see 10 min left,and after 10 min ,again I boosted myself ,and again I see 5 min to go

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

Will they keep delaying it until unusual time becomes usual ?

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

Will educational rounds have points for hacking??

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

Very nice Time for Chinese participants!! like it!

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

Testing our patience? xD

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

Kickstart guys going to suffer

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

Every delay is costing you a lot of participants!!

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

Guys, don't mess with cf. They will add 5 minutes delay for each meme xD

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

a contest with 100 min xD (until kickstart begins)

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

I am wondering how are you holding an onsite contest during the COVID-19 epidemic?

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

UnusualtimeForces × DelayForces √

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

delayforces :(

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

Yet another 5 minutes extended.

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

They should either reduce the length of the contest for everyone or postpone the contest altogether (IMO).

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

there is a condition:
the contest will not start until there is +20000 participants

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

Is it rated?

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

for(;time<=4:30;start_time+=5)time++;

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

If they add 5 min more, I'll wait 5 min more

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

how to solve D? my q*lgn*lgn using binary indexed trees(bit) ofcourse times out :(

UPD — my same code with cin cout passes?!

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

    you don't need binary search, traverse the BIT to find the answer ~810ms

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

    Use binary jumps

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

    Either fast descent on BIT or segment tree (in $$$\log n$$$), or the following:

    Suppose we are trying to find the minimum element in the resulting multiset. To do this, let's implement a function that counts the number of elements not exceeding $$$x$$$ in the resulting multiset in $$$O(n + q)$$$ as follows: if we distinguish only between elements greater than $$$x$$$ and not greater than $$$x$$$, we can maintain the multiset as two simple counters. To find $$$k$$$-th statistics, simply check that the number of elements $$$\le x$$$ is not less than $$$k$$$; if it is so, $$$k$$$-th statistics is not greater than $$$x$$$.

    That way, we can count the number of elements $$$\le x$$$ in $$$O(n + q)$$$, and to find the minimum element in the resulting multiset, we may binary search the first $$$x$$$ such that the number of elements $$$\le x$$$ is non-zero.

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

    My q*log^2(n) luckily passed, please hack it https://codeforces.com/contest/1354/challenge/80496838

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

How to solve C?

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

    For C1,i solved it by finding the inradius of the polygon multiplied by 2.

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

    1.0/tan(pi/n)

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

    C1: 2 times the apothem of the polygon, meaning

    tan(pi*(2*n - 2)/(4*n))
    

    C2: I have literally no ideea.

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

    C1: 1/tan(π/(2n))

    C2: cos(π/(4n))/sin(π/(2n))

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

    Here is how to solve C1 (C2 is a whole other story). It requires you to know a little bit of trigonometry (sin, cos, tan formulas)

    Take a look at the above image, what we are looking for is the blue line. If we find the length of the line we can double it and that is our answer.

    How to do that: We can find the angle x by dividing 360/n where n is the number of vertices. Now we need to divide that by two so we can have half the x angle, lets call v = (360/n)/2 = 360/(2*n)

    We managed to create an imaginary right triangle and we know one angle (v) and the opposite side (with length 1/2 = 0.5), notice that the blue line is the adjacent to the angle v.

    Tan formula: tan(v) = opposite/adjacent For our case we solve for the adjacent and we have adjacent = opposite/tan(v) = 0.5/tan(v)

    So i hope that now it is clear that our answer is 2*(0.5/tan(360/(2*n))), just remember to double the n value at the beginning because we look for a 2n-agon.

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

      I saw a bunch of submissions of c1 by doing some sort of summation of cosine of angles. what was that all about?

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

        Some people solved both C1 and C2 with the same code and made the same submission. I guess that C2 requires some addition. I didn't manage to solve it but I think that the solution can be broken down to finding two different sides that sum up to the total square side. (or at least that was my approach)

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

          So C1 and C2 are not suitable for pupils(I mean students of primary schools). :(

          Luckily I find out the solution :D

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

      why can't we use sin() to calculate directly please explain. My approach was same i just used sin, so that sin(x) = side(0.5)/radius hence radius radius = side(0.5)/sin(x).

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

        Because sin = opposite/hypotenuse in our case we don't need the hypotenuse but the adjacent. You could use both sin and cos to factor out hypotenuse and solve for the adjacent (because tan = sin/cos) but is simpler to use the tan formula instead.

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

What's the point of problem C?

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

    It seems C1 is without rotation, and C2 has a slight rotation, but I didn't manage to find out by how much

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

      Same with you, and for C1 I even dont know how to get the accurate answer, I just tried and tried and finally get the answer which I even dont know why.

      For C2, I just continued to try, but unfortunately, I didnt get the answer. I find some rotation might be correct but seems it is just my guess not the answer.

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

    Mathforcse /cy/qiang

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

Why does lazy propogation give TLE/MLE for problem D.

80500739

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

    Memory limit is 28mb.

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

      How can this problem be solved using segment tree WTF?

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

        A classic segment tree uses 4*N memory (I've heard this can be tightened, but I use the 4*N version). So you'll keep a leaf for every possible value in the set, representing the count of elements in the set with that value. Then you build the ST saving the sum of children. So, when you are asked to add an element K, you can do that in O(log(N)) adding 1 to every node in the path from leaf to root. If you are asked to remove the Kth element, you make a "binary search" over the segment tree. This is, if you are in node A:

        *Is the left leaf enough to find at least K elements? That means to check if ST[A*2] >= k. If it is, then you'll recursively find the Kth element in that branch *Is the left leaf not enough? Then you go to the right leaf, recursively, but the call will be query(A*2+1, k-ST[A]) because the left leaf will cover part of the "prefix" you are looking for, so you need to subtract it from K.

        There's a base case, when A is a leaf, you simply return the value associated to that leaf. Once you've found that value, you also need to update the ST by substracting 1 to every node in the path from leaf to root.

        So you see every operation is log(N)

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

    Use 4e5 instead of 5e5

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

Please miss us with the geometry problems.

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

    Normally I would agree, but it helped that all the formulas were online ;)

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

      I've always wondered: Is it moral/allowed/good practice to google formulas or algorithms? It feels wrong to me :(

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

        this argument can be used to saving code templates for speed , or having a text with for example a standard segment tree code.

        yes it is moral and good practice as in competitions like icpc or even actual jobs , you can get those easily.

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

          Hey, I have an exam in a month's time. Is it moral and good practice for me to use my phone to look it up on Wikipedia? When I'm doing an actual job, I can access wikipedia easily.

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

      where did you find the formulas? i also searched for them in internet but couldn't find.

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

          I don't get how is that related to C2: The article you cite has the formula $$$1/2sin(pi/2n)$$$ when $$$n$$$ is odd, but here $$$n$$$ is the number of sides in the polygon. In problem C2, the number of sides is $$$2n$$$

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

            Wait hmm

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

              Lol

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

                Wait actually I incorrectly assumed that I was dealing with an odd polygon and I was somehow convinced that it worked. Even I am confused now :|

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

                  LOL, When see you post the link related to the C2, I just feel unhappy but now I feel better because it doesnt seem to work.

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

                  The link I posted for c2 and the formula in it DOES work, I’m just not sure why

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

                  Well, though upset but have no choice about it. Maybe because I'm not a native English speaker so it's hard for me to search a web like that. But during the contest I didn't get the idea to google because I just thought CF didn't have anything that can be googled. If I were at the contest again and I knew that could be googled, I wouldn't google it because I think that doesnt help you anymore as all of the region contests cant google anything!

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

            I don't how how, but 80516401 got AC with this formula.

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

          loyal reader of the murderous maths (I am a primary student)

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

how to solve C1 and C2 ?

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

Can anybody explain how to solve C2?

  • »
    »
    4 года назад, # ^ |
    Rev. 2   Проголосовать: нравится -35 Проголосовать: не нравится

    If n is even, twice the apothem. If n is odd, just the diagonal. **Longest diagonal

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

      I tried it on the contest, did not work, are you sure you are not wrong?

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

      Hi! What do you mean by "just the diagonal". for C2, I tried this which worked for $$$n==3$$$ and $$$5$$$ but not for more: tilt the $$$2n-gon$$$ so that its longest diagonal and square's longest diagonal coincide.

      How did you get $$$1/2sin(pi/n)$$$?

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

        Longest diagonal Here

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

          OK, but how is that related? The article you cite has the formula $$$1/2sin(pi/2n)$$$ when $$$n$$$ is odd, but here $$$n$$$ is the number of sides in the polygon. In problem C2, the number of sides is $$$2n$$$.

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

            For problem C2, the answer for a polygon of 2*n sides is half the longest diagonal of a polygon of 4*n sides, i.e., 1/2sin(pi/4n)

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

    I don't exactly know why this works, but I solved it by inscribing the given polygon in another regular polygon with twice the number of sides, then inscribing that in the square like in C1. Only difference is that the side length of the new polygon would no longer be 1, so you need a little trig to find that new length.

    I hear some solved it by ternary searching for the optimal rotation angle, but I haven't yet mastered that technique

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

    I solved it post contest and I came up with few things.

    1. The previous orientation which was used for C1 for n being even would be suboptimal. (The hint comes from the obvious first testcase where n=3 and yet the answer is not 2)

    2. If you place it in the similar manner as done in C1 there will be some gap left both from top and from bottom to the horizontal sides (In this case if we take the hexagon and place it normally with the centre diagonal as the side of square the top and bottom leaves some space)

    So we have to re-orient the polygon and the rotation turns out to be 45 degrees. (I do not have a concrete proof but the square can be squeezed down the most in that orientation)

    I would like to explain further but it would require me to show it via illustrations and I don't know how to do so.

    The answer is sum of two particular lengths (which are within the polygon and make up for the length of the side of the square) which depend on the side length of the internal angle based triangles. (the 2*n triangles formed from the internal angle)

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

Many java users including myself had intended solution with BIT but still MLE? I don't think its ok that even intended solutions fail, really ruined the entire problem for me.

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

Problem-B was on Stackoverflow

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

    you can solve the exact same problem on leetcode only difference is they are considering alphabet instead of numbers

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

Nice questions and good round! I only managed to solve A and B :( I couldn't derive anything for C1 because I was blank in the middle of the round. Anyone, ideas for C please? I tried D but TLE'ed on Test-9. It's probably one of those cases where I'd perform complete $$$O(nk)$$$ operations. I couldn't figure out how I could bring down complexity to $$$O(k)$$$ (I later tried a prefix sums like approach which I couldn't make work). Could anyone help me optimise my solution?

Code

EDIT: Okay, nevermind. I read BIT and Segment trees in a comment above and realised my approach is no better than naive approach. I don't know how to implement either of the two yet :(

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

    for C1, symmetry is the key! Seeing symmetry, what i did is i calculated summation of cosine of angle of every segment with horizontal axis till n/4. (I assumed i am placing the first segment horizontally.)

    I could not do c2.

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

How to use PBDS for multiset , on web i got i need to change less to less_equal , but after that begin() , end() operations were not working

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

Im waiting for someone to post the geometry meme under this announcement

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

Am I the only one who noticed that today's problem B == 701C? :D

UPD: Well, I wasn't happy for that. I was just astonished as I've solved the problem before with exactly the same idea. I wish they were all unique, but just saying. Thanks for efforts.

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

how to solve C2?

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

    Simulate building the polygon length by length, Keep track of the biggest & smallest x & y positions, and from this get the lengths of the square All that's left to check is the best rotation of the shape, My solution was to ternary search the angle of rotation between 0 degrees & 360/n degrees My solution — https://github.com/OisinDavey/CodeForcesRounds/blob/master/edu87/C.cpp

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

      Thank you!

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

      I wrote a code with ternary search with similar ideas. But after a rotation, I was finding the minimum length of the square in a slightly wrong approach.

      "Keep track of the biggest & smallest x & y positions"

      Then, this part of your comment saved me. Thanks :D

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

Math of C killed me . :(

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

oh my god i'm so dumb i thought it said 7:35AM again so i woke up at 6:20AM and didn't realize that the contest was running the whole time LOL

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

Why does std::multiset give memory limit error??????

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

Геома, ммм, вкусно

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

Can someone explain why this solution fails? Instead of finding the length of the side directly, I found it using an indirect approach. Submission

I found the length of the longest diagonal and then using Pythagorean theorem the side of the square can be found. I think there were some precision issues with square root calculation. How to go around this?

Edit: Got the problem. The setprecision() is in the wrong order :(

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

Очень понравились задачи С1 С2 <3 <3 <3, дают прекрасную возможность выучить алгоритмы которые в будущем можно будет использовать для решении кучи задач, раскрывают невероятно полезные свойства линейки карандаша и циркуля, учат сидеть и гуглить формулы. Таких задач определённо должно быть больше в мире спортивного программирования.

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

    Видимо, Вы из тех, кому в принципе математика для программирования не нужна. Математика же не поможет, например, сайты верстать или случаи разбирать. Подумаешь, что на финале ICPC обычно есть одна геометрическая задача, которая иногда решает — получишь ты медаль или нет.

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

      Подумаешь, что на IOI нельзя делать задачи на тригонометрию.

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

        Воу, не знал. Ну тогда если вы планируете закончить свои выступления с окончанием школы, то задача действительно не для Вас.

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

          И как ваши знания геометрии? Помогли в финале ICPC?

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

            А как твои знания IOI Syllabus? Помогли на IOI?

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

            Мне, например, знаний не хватило. Учился бы больше — может выступил бы лучше.

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

      А вот по факту мы собрались чтобы задачки по проге порешать, а не над геомкой думать, где смысл давать задачи на геому на Educational раунд, её нужно в школе учить, а не на кф.

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

      А зачем говорить о математике в целом? Задачи на алгебру вполне хорошо заходят для программирования, но вот геометрия всегда вызывала общее негодование.

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

        Непосредственно в том сообщении — для преувеличения. А вообще, считаю, что отделять геометрию от математики неправильно, но было бы логично, если бы геометрия не пересекалась бы с программированием. Но она пересекается, и сильно.

        Лично я сам далеко не всегда в восторге от геометрических задач, но я не понимаю необоснованного хэйта, где за броскими фразами о ненужности геометрии скрывается простой посыл: "задача — говно, потому что я ее решить не могу".

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

    Там тернарный поиск по углу поворота, задача чисто техническая, не понимаю о чем Вы, сдается с плюса и ручка с бумагой не нужна

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

How did the solutions of D with complexity o(q * logn * logn) got accepted? In worst case the no of operations will exceed 1e8

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

    It seems that for people who had the same intended solution one might have passed and another didn't. That's mainly why I didn't like this problem, it is just optimization hell.

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

    There are 1.5s and the number of operations done in 1s can exceed 1e8, like <= 3e8, so it could get accepted

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

    Yes,it can pass.I just use BIT + binary_search.

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

      Exactly what I did but still MLE...

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

          Yes, I have the same intended solution which has memory limit exceeded. [80506407]

          Actually you cant even read the input to memory unless you use byte arrays in java. I wonder if the testers actually solved the problem in java before using such low memory constraints. . There are only 6 accepted solutions so far in java for the problem. My solution (in which I always use StringTokenizers to parse input was failing to even read the input.!!!

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

          Your solution and my solution are almost the same but still, my solution gave TLE on test case 37. Why is it so? My submission: https://codeforces.com/contest/1354/submission/80507579

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

            Because of "long long".It is much slower!

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

              Thanks a lot for your help. The same code got accepted when I changed them to ints. Isn't it a little bit unfair to keep the time bounds so strong that the same solution fails just because of using long longs in place of ints?

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

                The intended has a lower complexity, so it's not really unfair. Solutions of higher complexity may or may not pass.

                Also, I would advise thinking whether the data type can reach long long. If there is no doubt it cannot, use int's because I have seen various cases recently where this is the difference bw TLE and AC.

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

          Gary2005 why have you taken the case of -1 as a query in a seperate case?

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

            Because it is special case.I thought it wouldn’t work well with binary search.

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

      I got TLE

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

I don't get why people hate C1/C2. Yes, it is a geometry problem, yes, it can be solved with pen and paper work.

But:

1) The geometry itself is very simple and does not contain any case-bashing, just a simple formula.

2) There is a way to solve this problem almost without any greedy ideas and formula-deriving, with standard algorithms such as binary/ternary search.

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

    Normally I dislike geometry problems but these were at least simple enough and good for an educational round.

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

    In fact they can be solved just with junior middle school math !

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

    How to use optimal searching (binary/ternary) in these problems as you mentioned?

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

    I think it's cool. I'm looking forward to the editorial!

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

    Probably because we're here for coding problems, not pen and paper problems. If I wanted that I'd go look for math tests online.

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

      If you're not here for pen and paper work, then you could code a solution that does not rely on pen and paper at all (except for rotation formula).

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

        I could write long code for all div2 A 1-liners too, but that doesn't mean it makes the problem any better from my view. It's usually easier to solve a 1 line equation problem in 1 line than doing something like b-search, it's less time consuming, and it's not very satisfying to finish when you've just written a single equation.

        If it wasn't a coding contest I think it'd be a good problem, but I didn't enjoy it here. Tbf I didn't solve c2 which probably makes me not like it more lol, but in general I don't enjoy 1 line sols.

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

    people like to code more than to solve by hand some geometry problem. This is codeforces not geometry forces. Also please ban pikemike from problemsetting.

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

      Seriously? Someone has set 80+ Educational rounds and you're requesting to ban the guy. Wow.

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

    actually a lot of people could guess both formulas for c1 and c2. And in educational rounds for each problem you get one point, so i don't think that's totally fair

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

    how to derive formula for c2... how to do this with binary search?

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

    Fuck you and your geometry problems
    We came here to write code and not to solve math problems

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

    Thanks BledDest for the problem. How do you solve it using BSearch/Tsearch? What would the check(int len) function look like?

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

      The problem is by adedalic, not me.

      Solution for C2 with ternary/binary search:

      Suppose that one of the sides of the polygon is parallel to the side of the square. When you start rotating it, the difference between its $$$x$$$-coordinates starts decreasing, and the difference between its $$$y$$$-coordinates starts increasing, until some moment when it begins to go vice versa (and, at some moment, the height and the width are the same). After the polygon is rotated by $$$\frac{\pi}{n}$$$, the difference between $$$y$$$-coordinates becomes maximum possible, and between $$$x$$$-coordinates — minimum possible.

      Since we want to find a moment when the difference between $$$x$$$-coordinates is the same as the difference between $$$y$$$-coordinates, we may use binary search on rotation angle to check whether the angle is too small or too big.

      Or, for a more straightforward solution, we can write a function $$$f(ang)$$$ which gives us the size of the bounding box of the polygon, if it is rotated by angle $$$ang$$$, and use ternary search to find its minimum. The proof that this works is the same — initially the width decreases and the height increases, and at some moment, they are equal.

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

    Yeah, C1 and C2 were excellent problems. I dont understand why people hate it. Its just basic high school maths.

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

    I don't get why people hate C1/C2. Yes, it is a geometry problem, yes, it can be solved with pen and paper work it can be easily googled .

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

Can anybody help me out in C2 with some proof .

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

General idea for C2 (without proof):

Consider the line segments connecting: - vertex 1 with vertex n+1. call these vertices V1 and V2. - vertex (n/2) with vertex ((n/2) + n). Call these vertices V3 and V4.

Let's assume vertex 1 is located at angle 0 (positive x axis direction) without losing generality. We need to rotate the polygon by an angle alpha until the horizontal difference between V1 and V2 and the vertical difference between V3 and V4 are equal.

let beta be the angle of V3 compared to the polygon center of mass. The goal above will be achieved when: cos (alpha) == sin (beta + alpha) in other words: (Pi / 2) — alpha = beta + alpha

Then you find alpha and multiply it by the distance from the center of mass to any vertex.

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

Oh... I miss the contest :'( I thought the contest starts at 14h30 utc.

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

How to solve E?

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

    If any component is not bipartite answer is NO. If you fix the vertices which will get color 2, then you can color remaining vertices as 1 or 3. Now it's just knapsack problem.

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

    The key observation is that colors $$$1$$$ and $$$3$$$ are interchangable: if we have a good coloring and change $$$1$$$ to $$$3$$$ in it (or vice versa), it is still good.

    So let's instead solve the problem where we paint the graph into $$$2$$$ colors: $$$1$$$ and $$$2$$$. To do this, find all connected components and check if they are bipartite. If there is a non-bipartite component — the answer is NO. Otherwise, we either assign $$$1$$$ to the first part of the component and $$$2$$$ to the second part, or vice versa.

    Our goal is to assign $$$2$$$ to exactly $$$n_2$$$ vertices, so if the number of vertices with $$$2$$$ in the $$$i$$$-th component is $$$cnt_i$$$, then we must have $$$cnt_1 + cnt_2 + \dots = n_2$$$. For each $$$cnt_i$$$, we have two possibilities: it is either the size of the first part of the component, or the second part. So we may write a knapsack-like dp to satisfy this equation.

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

      E is very educational,thank you for you effort!Though I didn't pass it during the contest because I forget that 'dp' starts from '0'.

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

    First, observe that there is no answer if the graph contains cycle of odd length.

    Second, observe that if we have fixed the position to fill the 2's, we are free to decide to fill 1 or 3 in remaining nodes (as long as we have enough such number)

    We can consider the answer in each connected component and do a DP, detailed as follows:

    1. Detect if there exists odd cycle (this can be done by considering the depth of nodes when visiting a already-visited node)

    2. Find the size of each connected component.

    3. For each connected component with size, try to fill 2 in alternate depths. There are only two ways of such filling, one of them uses $$$A$$$ 2's and another of them use $$$B$$$ 2's ($$$A+B$$$ is the size of the connected component)

    4. Do dynamic programming on the values of $$$A$$$ and $$$B$$$ you got in each component (you will need backtracking)

    5. With the DP table you have built, determine if you can have an answer having exactly $$$n2$$$ 2's. If so, also fill the remaining spaces with 1 and 3.

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

    Do check this , I have implemented this using top down dp (with comments). https://codeforces.com/contest/1354/submission/80571115

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

[Deleted]

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

Why was the limit on $$$N, Q$$$ for problem D so tight? To avoid a policy-based data structure solution to fail? Is it expected for an $$$Nlog^2(N)$$$ solution to pass system tests, given that it would take approx. $$$4.10^8$$$ ops?

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

    The intended was BIT sol and 1.5 seconds gives enough leeway for it, despite this many BIT sols failed so I am not entirely sure how the authors were trying to educate us with problem D.

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

      I think you're supposed to use nlgn sol using trick to bsearch on fenwick faster.

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

        I got MLE not TLE :think: also unoptimized bsearch passed for people

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

          I think it's because you used class, that adds extra memory overhead. Try getting rid of all template stuff to use less memory, though idk if that would work.

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

    To let the contestants using fhq-treap fail because of MLE.

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

For D, q*lgn*lgn passes with cin/cout but times out with print/scanf.

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

Do the organisers have any solutions for D that work with any version of python? Given that there were no accepted submissions during the contest (and at the time of writing still none)...

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

    OK there are now some (at time of writing 2 independent) accepted submissions in pypy3, so I take back what I said. Still incredibly tough for us python users, but I guess that is the cost that comes with using a more handy language...

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

E is a good problem. C1&C2 are too bad

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

    E is wack shit that shouldn't be in an Edu round in the first place. C is the real skill that one should hone.

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

      Why? C is simple formula problem and in fact, it should be a complete math problem instead of a competitive programming problem, which is not situable in an edu round.

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

      I agree E doesn't require much creativity but why E isn't suited for edu round(I think it bring concepts of bipartite graphs, knapsack and the building dp answer which is educational)

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

        For real, asking people to answer up to 3 (why not 2), tracing dp (which is an abomination) and leaving such problem in the E position.

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

          If only colors to be used are 1 and 2, arriving to the concept of bipartite will be instantaneous. And it's just a couple of more lines of code. Tracing dp is hated but so is geometry so your claim for C can be loosely applied here. Where do you suggest to place this problem in problemset?

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

    If you liked E, there's a similar problem on AtCoder that is very nice also:

    E — Independence

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

Formula for C2 (without proof):

C1: 1/tan(π/(2n))

Link: https://codeforces.com/contest/1354/submission/80516480

C2: cos(π/(4n))/sin(π/(2n))

Link: https://codeforces.com/contest/1354/submission/80516821

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

    Can you give at-least some intuition? How did you come up with this?

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

      https://codeforces.com/contest/1354/submission/80533336 First of all orient the polygon such that one of it's main diagonals(consider this x-axis) is parallel to a pair of sides of square.Then,you'll notice that if we rotate this diagonal by some phi say in counterclockwise direction.The length of projection(along x) of this main diagonal will shorten and become 2*circumradius*cos(phi).At the same time height one of the points belonging to the side of polygon that is || to the main diagonal starts increasing and it becomes 2*circmumradius*sin(psi+phi) where psi is initial angle made by this point with x-axis i.e psi=(n/2)*pi/n.So the optimal case is when cos(phi)=sin(psi+phi).So we get pi/2-phi=psi+phi i.e. (pi/2-psi)/2=phi.So our answer is 2*circumradius*cos(phi).

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

How to solve problem G?

  • »
    »
    4 года назад, # ^ |
    Rev. 2   Проголосовать: нравится -83 Проголосовать: не нравится

    IDK

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

    Well, here is a solution (I think, I did not participate, and nor do I intend to implement this to check).

    First, we choose random 31 elements, and then find the maximum among them. This can be done in 30 queries. The probability of the maximum being a stone is atleast $$$1 - (1/2)^{30}$$$. Now, we have the index of one stone. Remove this index from the array.

    Now use this and query it against the first stone. If the first stone is lighter, it is a gift. Else, it is also a stone. Use the first two to query 2,3. If 2,3 is lighter than 1 and our stone index, then there must be a gift among them. Binary search that. If not, use 1,2,3 and our stone (4 stones now) to query 4,5,6,7.... etc. This whole thing can be done in less than 20 queries (10 for the "forward" binary search, 10 for the "reverse" binary search).

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

      Well, I too thought of a similar idea. But, I am interested in a deterministic solution.

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

        I think this was the intended solution, since "Hacks are forbidden".

        Note that obvious ideas to make the first step deterministic such as partition totally array in 2 and always choose heavier subarray fail on a case like [20 20 20 1 20 5 19 19] — the algorithm will end up choosing 19.

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

How to solve div 2 problem B

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

    well, this is pretty standard. You can use Two pointers and find the answer in linear time. Another approach is using binary search: If there exists a valid subarray of length $$$l$$$, also this is true for all $$$y \ge l$$$, so you can apply binary search over the length of subarray and check each subarray of current length in linear time, so complexity is $$$O(n\cdot \log n)$$$

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

Anyone has good solution for D?

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

    Imagine we have a frequency array that counts how many times each integer appears. Well, now use a Segment Tree of Sum over that array, you can do each operation in $$$O(\log n)$$$-time.

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

Was D added to fuck all Java participants?

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

    Yes, it was really unfortunate :(

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

    sqrt bucketing, solvable using O(n) memory.

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

      I do not expect to have to do that for a Div 2 D, though :/

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

        actually idea is not that hard, even easier than segment tree (but I guess we are more familiar with segment tree). Most of sqrt bucketing ends up with T: O(n*sqrt(n)) S: O(n)

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

          How would it use less memory than fenwick if implemented with just array?

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

            not talking about fenwick tree.

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

              I think what he is talking about is that the solution that most used is fenwick tree which is also O(N). So sqrt bucketing is probably worse>

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

    Even worse is that sometimes it passes with the same memory, other times it doesnt. [80497819 has the same memory used as my solution [80506407 but passes. I changed the way I read inputs from StringBuilder to DataInputStreams and that passes too !!

    awoo, is it possible to at least rejudge java solutions in the contest adding a little bit of memory overhead, otherwise I think its completely unfair!

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

      It's unfortunate, but it is well known java's limitations compared to cpp, so if you choose to use it that is at your risk, especially if there are solutions that do pass.

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

        How do you know it's well known limitation? Only 6 solutions in java passed during the contest. I have been doing CP for almost 8 years now, with the same (or similar input readers) and never had to face this kind of issue. On a positive note, I did learn a more efficient way to read inputs (but was that the intention of the problem authors?) A well known limitation of java is to use Scanner to read inputs vs other buffered readers, (and similar to output). But this is really new and one of a kind issue. If the authors had not intended it, they can just acknowledge and care about it from next time (would be nice of them to re judge the solutions of java in the contest, but not required). If they did intend it, then I can start looking for even more efficient ways to read inputs from next time :)

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

          I meant in general java is slower and uses more memory, which is well known, and this is why most people use cpp, so using java in general puts you at risk. I do think that the input method being the problem is pretty bs though, and that should've been tested.

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

For Problem D

CPP solution is working fine with memory = 4 * n

But Java solution is getting Memory Limit Exceeded for memory = 4 * n

This looks unfair, kindly let me know if I am missing anything.

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

    Java solutions using new StringTokenizer(in.readLine()) fail because the entire line is too big to fit in the memory constraints. Need to use a better I/O method to pass :(

    My solution and I/O method below.

    public int ipar() throws IOException
    {
        int n = 0;
        boolean seenDigit = false;
        char c;
        while (Character.isWhitespace(c = (char)in.read()));
        boolean neg = false;
        if (c == '-') {
            neg = true;
        } else {
            n += c-'0';
        }
        while (Character.isDigit(c = (char)in.read())) {
            n *= 10;
            n += c-'0';
        }
        return neg ? -n : n;
    }
    
»
4 года назад, # |
  Проголосовать: нравится -23 Проголосовать: не нравится

First time I came to know that $$$π$$$ is not equal to $$$22/7$$$.

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

My submission for D got TLE on test case 37. Its time complexity is O( q*log^2(n) + n*log(n) )

Here's the link: https://codeforces.com/contest/1354/submission/80507579

But almost the same code which is O( q*log^2(n) ) got accepted. (I submitted it after the contest)

Here's the link: https://codeforces.com/contest/1354/submission/80514775

I don't understand why? Please help me out.

UPD- Found the mistake. I used long longs instead of ints :(

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

Problem B was available on GeeksForGeeks and Stackoverflow . So all those participants who copied from there would get plagiarism or not ??vovuh

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

    I guess number of dislikes is the number of people who took B from above mentioned platforms. XD

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится +1 Проголосовать: не нравится
      1. It is totally fine to use code from other sources (as long as it is not from other participants during contest). Even ICPC allows prewritten material.

      2. This problem was easy enough to derive in like 1 minute anyway

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

        Yes it was pretty straightforward 2 pointer question but to save time things might have been copied .

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

          Yes and it doesn't matter. Most people have templates of code saved up anyway...

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

      I didn't take part in the contest and even more I didn't prepare any problems, but I disliked you because why do you need to mention me? How do you know if I'm tied with this problem somehow?

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

        I am extremely sorry. I didn't mean it that way. I just wanted to ask you about that fact that wether or not is there a plagiarism check for these kind of things since you are a problemsetter and you might know about it and I didn't tied you to that problem .Just a general doubt. I didn't mean to insult you in any way . Just curious.

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

 80510010 It's very close for a problem with TL 1.5s. Will this pass system testing?

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

Is special memory problems a new "thing" in CodeForces now?

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

Did anyone else spend a long time on D bcz they thought the BIT sol was so standard you must have to use less memory than a 1e6 array? I was thinking for a long time how to only store value on input and compress, but then decided to try BIT and was dissapointed to see it worked.

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

    With simple maths we know that we can have around 28*1024*1024/4 = 7340032 integers, which is definitely more than 1e6. I think it's important to know how to evaluate the data we can store in such tight memory limit question. Yet this question is still very unfriendly to people using java and python :C

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

      I did that but assumed there would be memory overhead causing the need for a tighter sol, which happened to be the case with other languages, but not cpp.

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

    Btw BIT solution was already available on the web.

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

      Damn. I should have searched for Order Statistics tree implementation, instead of BIT implementation during contest.

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

    Umm say the multiset contains all numbers from 1 to n, then I would need an array of n size to store it, right? Otherwise I wouldn't be able to tell which number is there or not. And BIT uses the same amount of memory as the array. So I cannot understand how you thought that even lower memory must be used.

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

      I thought it'd be something similar to bloom filter, so I was thinking along that line.

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

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

I feel that all the java submissions for problem D should be re-evaluated as the contest seems to be biased towards cpp guys! The same code is accepted in one language and not the other. This is simply ridiculous,never seen this happen before!

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

https://codeforces.com/contest/1354/submission/80472333 can somebody explain this code of c2

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

https://codeforces.com/blog/Kirill22 Надеюсь, это распространится и буду приняты необходимые меры.

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

Why do you completely hate Python?

I like programming in python. I had a perfectly creative and good solution for D with a segment tree. I created a list with around 2,000,000 zeros. MEMORY LIMIT EXCEEDED. in python3.7 python2.7, pypy3 and pypy2. And the sad thing is that it makes sense, because the memory limit was 28MB, and each int is about 32bytes. After the competition I transformed the solution to C++, and lo and behold, it was ACCEPTED. Would it have been so terrible to limit the memory to 80-100MB instead of 28? It just seems super unfair to me in this situation.

Also, you keep telling us to USE PYPY2. But on two separate occasions now (one in yesterday's competition as well, in young explorers), when you have to print many test cases,I get a time limit exceeded, which I DON'T get in python3.

You can check my profile to see I'm not making this shit up.

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

Why do you completely hate Python?

I like programming in python. I had a perfectly good solution for D with a segment tree. I created a list with around 2,000,000 zeros. MEMORY LIMIT EXCEEDED. in python3.7 python2.7, pypy3 and pypy2. And the sad thing is that it makes sense, because the memory limit was 28MB, and each int is about 32bytes. After the competition I transformed the solution to C++, and lo and behold, it was ACCEPTED. Would it have been so terrible to limit the memory to 80-100MB instead of 28? It just seems super unfair to me in this situation.

Also, you keep telling us to USE PYPY2. But on two separate occasions now (one in yesterday's competition as well, in young explorers), when you have to print many test cases,I get a time limit exceeded, which I DON'T get in python3.

You can check my profile to see I'm not making this shit up.

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

    No one cares about python..Understand it or accept it

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

      Dude, Atcoder, Google kick start (and other), leetcode are all accept python. CF is the last platform that has c++ benefits (even Java sucks here).

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

It's surprising how almost the same set of authors can set absolutely horrible contests (like this one) and very well balanced contests (like last Edu round).

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

    Is it horrible? Nope. How, I found this one interesting. Specially C1 and C2. You can get to a formula where you don't need to think of precession errors.

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

      C2 is too hard to be Div2C. D is just dumb. I do CP because usually getting the asymptotic complexity right is enough. Policy Based Data Structures also use O(N) memory, but memory limit on D is set too low just to fail PBDS. That's absurd.

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

        Nope, C2 isn't too hard for div2C. I am assuring you as a class 10 student with no prior math olympiad experience. And it would be like a cup of tea for an IITian because of massive difficulty level geometry questions they went through. You probably had a very bad day, in other day, you may get accepted in only 5 minutes.

        But D is just a trash. It's just an unfair advantage towards cpp guys

        • »
          »
          »
          »
          »
          4 года назад, # ^ |
            Проголосовать: нравится +4 Проголосовать: не нравится
          Nope, C2 isn't too hard for div2C.

          Number of submissions to the problem say otherwise.

          I also don't know where you got the misconception but an IITian does not need to know proper geometry — it's only coordinate geometry and trigonometry which are part of the syllabus.

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

          yeah it requires some basic geometry only ....... as one can easily understand by taking diff values of n and fitting polygon inside a square that the square must have side equal to length of longest diagonal .......which is the line connecting exactly opposite vertices....... then do some geometry .... and get the results.... I am still not able to find the fact that why people are considering C2 as tough or maybe it was easy for me as maths and geometry are my fav topics being in ICSE board upto 10th i like goemetry very much

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

            You did not solve C2 and here you are talking about its solution and difficulty level. Its not that simple. Your statement — "that the square must have side equal to length of longest diagonal " is absolutely wrong. For solving c2, it won't be the case. You can fit a hexagon inside a square where none of hexagon diagonal is parallel to square side hence your statement is wrong. For solving it you can have diagonals making some angle with square's side and then computing this angle is the key part.

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

              question also says that you can rotate the polygon....please read the question first then give knowledge to others,,,,,,,,,

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

                Try C2 and solve it. I already gave you hint how to do it. You will understand what I meant :)

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

        If PBDS was allowed, the question would be like : Do what's written in the statement!

        I myself also tried a PBDS solution but I think low memory limit was justified (Not talking about Java/Python users..that's a completely different issue).

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

          Agreed. I am not saying they should have allowed PBDS. I am simply saying it's a bad question when you have to set constraints to fail one O(n+q) memory solution (PBDS), while allowing the other (Fenwick Tree) to pass.

          Any solution with correct asymptotic complexity should pass if the question is good.

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

Уважаемые организаторы Educational Codeforces Round, проверяйте своих участников на списывание. А то уже у меня есть основания полагать, что не один человек просит у знакомого скопипастить код

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

Like almost all Educational Rounds, i think this round too lived upto its expectations. I personally found the problems very interesting, especially for a guy like me who is still in the learning phase. PS: I found an exponential jump in difficulty of problems after C1.

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

How to solve c2(without formula)?

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

editorial?

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

The D problem was really interesting , same as that the problems C1 and C2 are really worst.

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

authors: make problems with simple geometry us: GEOMETRYFORCES XDDDDDDD

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

In problem G, is there any special use of the fact that k <= n/2 ? Won't just k >=1 suffice?

Just curious, why aren't hacks allowed in G? My very very incorrect solution to G passed.

Edit: Now I get, the intended solution was using random.

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

    congrats on kickstart rank

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

    It allows a solution to quickly check if an element is a stone, with high probability using ~ 30 queries. Probably hacks are forbidden to avoid hacking seeds etc.

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

I still don't see the point of adding math problems in a programming contest
Please can someone explain it!

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

when will the next normal round be held , cz from 29th may it's showing kotlin only

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

NEVER use problems like C1 & C2 ever again! it's a total time waste! what's the point of applying an equation you can easily find online to get the answer! either use quality problems or postpone the round till you have something worthy, but this.. this is not acceptable at all.

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

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

Can anyone tell me Why ordered_set gives memory limit exceeded in D?

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

    I too want to know, what ordered set gives mle and segment tree with lazy propagation got accepted? Thanks in advance.

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

      I guess MLE proves the high constants involved in the implementation of ordered_set. And by constants I mean memory — O(n*c) ,where c is quite high to fit in the memory limit of the problem.

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

This was one of the most unbalanced contest.
D was so unfair for various languages. Further C was designed to be a dull geometry problem.

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

Hi, I am facing an issue. My first Submission to the problem D was showing TLE during the contest but after the contest when I resubmit the exact code, it got accepted. why?

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

    what's the point of lying , it isn't the exact same code you added a new value (mx) and used it to change multiple conditions.

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

      Bro, I said First Submission you checked 4th submission. Why would I lie if anyone can check my submission? Please Compare 80504013 and 80527339.

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

        i apologize. this is actually quite weird someone should look into it.

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

          What should I do? I dropped a mail to the mike and problem setter.

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

            It is probably just barely on the edge of time limit. Problem D was super dumb anyway and designed to be on the edge of TLE / MLE which is absolutely dumb :/

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

        You are taking too close to the TL. During load (like a contest), the time taken is more than normal. So for unstable time taken, you may or may not TLE, it's luck then.

        Even I have had this happen in a round, sucks but is fair.

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

I solved C2 by searching the web Largest hexagon that can be inscribed within a square. hexagon

Then I guess the 2*n sided polygon should be put n/2 sides chord to the b right triangle hypotenuse, and n — n/2 sides chord to the c hypotenuse. Code

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

    please explain your code a bit .....thanks

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

      dia is the diameter of the circle which the polygon is inscribed in. You can computed it by half of the side length of the triangle and half of the center angle of each triangle, we get 0.5/sin(PI/n/2). The chord can be computed by the diameter and the center angle. n/2 sides center angle is PI/n (n/2) , half it we get PI/n(n/2)/2. The half of the chord is dia * sin(PI*(n/2)/n/2), the chord is dia * sin(PI*(n/2)/n/2) *2.

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

How could WindScanner solve C1 after D only 20 seconds? This comfused me:(

80460341 80460643

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

    Maybe he read both the questions and solved them, but didn't submit until he had solutions of both problems ready. tourist surprises us with this strategy many a times.

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

      And also in 1324 , as an untrusted participant, WindScanner solved D&F almost at the same time when it is only 10 minutes from the comptition started and got 4th place in the end. I don't think that is normal, I think he is just a cheater.

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

    Weird indeed, because it's not even the same code template. Hopefully, it won't be, but it seems like cheating. We have already seen here some cases of pair of cheaters on-contest

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

    fakeMatrixCascade Have you noticed his submissions still count? He ascended to candidate master

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

80530953

Inviting you folks to hack my F, it seems super simple and I cannot fathom why there's 6 second timelimit for this task.

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

    Time limit is set to $$$6$$$ seconds to allow flow solutions (I think that even though they are slower than exchange argument dp, they should be still allowed to pass).

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

      Thanks for the insight! Can you give a rough sketch of a flow solution?

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

        The answer looks like that: we choose $$$k - 1$$$ minions and place them in some order, then we choose $$$n - k$$$ minions which are placed and instantly destroyed to give a bonus to previous minions, and then we place the remaining minion.

        Let's analyze which value each minion adds to the answer. The first minion adds $$$a_i$$$ to the answer (since it doesn't give any bonus), the second one empowers the first, so it gives $$$a_i + b_i$$$, then $$$a_i + 2b_i$$$, and so on. The minions that are summoned and destroyed give $$$b_i \cdot (k - 1)$$$, and the last one gives $$$a_i + b_i \cdot (k - 1)$$$ power.

        For each minion and for each position, let's calculate the value we will get if we choose that minion for that position. Then we should distribute the minions into positions so the sum of values is maximized, and this is a well-known assignment problem which can be solved with Hungarian algorithm in $$$O(n^3)$$$, or with mincost flow in $$$O(n^3)$$$ or $$$O(n^4)$$$.

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

Most stupid round ever!

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

    Oh really? So you solved all the problems and got to the conclusion that it is soo stupid. The fun with this round begins with problem E (E-G). The first 4 problems (A-D) were just problems that somebody might enjoy, other's not so much, because of the math, memory limits or other things. I solved only the easiest problems from this round and the only frustration i have is that i didn't have time to think about E-G and i still don't think that it's stupid. For mediocre guys competitors like me there are the first few problems, for the cool guys there are the last 3. Why do you think red's are not complaining that C was sooo mathy and D was sooo tricky. It is because it's just too easy for them. There were problems for everyone. Who is good with math had C, who is good with DS had D, who is good with observations and maybe coloring problems had E, dp F, again observations and interactive problems had G. This round has it all and i really don't think that you are to say what is stupid or not.

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

      I agree with everything you said except for problem D. Many also saw the obvious BIT solution but were screwed over by the MLE. I don't know the hate for C since it seemed not too hard with only slight bit of math that you can find online.

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

        Well yes as i said, some might like some problems others might not because of various reasons (programming language, math background...).

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

    Also screw you for posting from a fake account.

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

Why is there a $$$6$$$ seconds time limit for problem F?

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

I was amazed by looking at the second question in today's contest. It's the same as this standard question which I was doing today at 1:00 PM IST as practice for LeetCode Monthly contest. I didn't even change the code a bit, I just returned the size of string instead of an original string as given in the question in the link. My code is here.

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

    yeah as it is a very general sliding window problem, so it can be seen on any platform!

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

The contest announcement post with negative votes! Rare records. Anyways, thanks for the contest.

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

Is there a simpler way to solve D without using a Segment tree/Fenwick or smth similar?

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

    Considering the memory limits, I doubt it.

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

      I mean it's interesting that they asked to output any element left. So I thought maybe there is a smart way to find an element which will for sure be left in the multiset. But maybe there is no such a solution so idk.

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

        Yeah I also thought it was a non-standard sol which you had to do something smart. I guess not

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

    Binary search like this(from rank2)

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

I'm really glad to see that the announcement of this round has negative contribution. No one wants to solve non computational geometry problems. Those are meant to appear in math competitions not in programming competitions.

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

    Totally agree.

  • »
    »
    4 года назад, # ^ |
    Rev. 2   Проголосовать: нравится -27 Проголосовать: не нравится

    also they did not cared about kickstart......

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

      Why should they? Someone participating in Kickstart should have just skipped this round, after all, there are many contests ahead.(Downvotes incoming ig)

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

    you are a narc

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

    This round should be unrated.

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

    I didn't like many problems too, but c'mon, people still put time and effort into making the round, and I don't think it deserves downvotes. It was a functional round with semi-interesting problems (except D), and I don't wanna see 1-liner pure math geo either, but it was still decent problem for what it was. Just probably they should not have something like it next time, as now they see people's reaction.

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

    Why do you hate geometry problems?

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

    +1

    Round should be unrated!

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

Has the tutorial been released?

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

WHY WHY WHY do those with a rating of more than 2100 stand in the standings as officially, will this change?

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

You guys need to stop laying bricks, math problems are tier 1 borderline chief. All hail Mikhail.

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

So you Div 2 trash have downvoted a round for a problem you can't solve? Well done, wish you stay in Div 2 forever and never realize geometry is not the worst topic.

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

    I downvoted because my solution for D gave MLE ,However the same idea passes using c++. I spent more than half the contest trying to optimize it which isn't fair, i even sent a message to the coordinators during the contest and their reply was "Unfortunately, the memory limit in this problem is tight. Make sure that your solution is memory efficient." Anyway apart from D ,the contest was good.

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

    Let me tell you, they cant see the bright side.

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

    Cuz C was only geometry problem, there wasn't any programming. And B problem was at the internet already

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

    I don't think that's C is really "geometry", imo it is "math". For me problem is "geometry" if it requires some shitty geometry algorithms.

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

What is the reason for so many down votes on this announcement ?

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

People cannot understand why it is called Educational round

I think we people do not appreciate the efforts made to create such rounds. Authors and testers are not angles who do not make mistakes.

If you think you can create a better round, why don't you propose a round to codeforces and see how participants react to your work although you might have spent a month preparing the round(people might call your work trash).

People do not want math nor geometry problem because they cannot think. they want something they can solve, and when they cannot, they turn around and say it is a bad contest (nature of human).

I myself did not solve C1 nor C2 nor D but I think they are beautiful educational problems.

I just wanna say thank you for all the authors and testers.

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

    When i encounter a problem i cannot solve that's when the excitement starts

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

    You said my words, thank you for understanding.

    I am trying to make a contest by myself, and its never easy to make good problems, so even if the problems weren't as nice as hell, then its still fine.

    It seems the problems are too googlable, and so, i guess its not acceptable.

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

Just a shitty contest once in a while but please keep it unrated ! I work hard for ratings and I don't google during contests ! Today I payed a -80 rating drop for not googling between contests.

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

    If you're really worth your rating you will get it back later

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

    Atleast authors should say something about easily googlebale tasks ! why are they all just silent ?

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

      Because its an Educational round. Read the rules and you can see that these rounds can contain well-known problems.

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

    Yeah, you are totally right!1! I spent 10 minutes googling related formulas like incircle radius but that didn't help me to come up with my solution... So my rating should be bigger (xD, trolling)

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

When is the editorial coming ?

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

Can anyone explain a simple O(n) solution for B?

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

    Convert 111333211123 into arr = [[1,3],[3,3],[2,1],[1,3],[2,1],[3,3]]. arr[I][0] represent number. arr[I][1] represent how much arr[I][0] was in a row. go:

    minimum= 99999999
    for g in range(len(arr)-3):
    if (len(set(arr[i:i+3]))): #if this subarray contains all numbers
       minimum = min(minimum, 2+arr[i+1])
    

    2+arr[i] cuz we need only this nums 1 1 1 2 2 3 3 3

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

How much long will it take to display the ratings on our profiles?

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

About problem C2, seems like the side of the square is equal to FJ(The samples matched). I submitted without proof why it works. Can anyone please check the math, and explain why it works. I can't figure it out!
code: https://bit.ly/2LFcU4A

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

    Angle subtended by an chord or arc of circle at circumference is half of angle subtended by same arc at centre(Its a properties of circle). So now we know one side and opposite angle and we can calculate the other side by using basic trigonometry(as triangle formed is right angled triangle).

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

      Hey man, I know that property, and that's how I came up with this sketchy solution. My question was, for 2*n sided (n is odd) regular polygon why the smallest square where the polygon can be inscribed has side length FJ (or Aj, since AJ = fJ)?

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

I think this contest should be made unrated for everyone because the solution of problem B,C,D could be directly found in google.This makes this round a test of our googling skill not coding skill.Many contestants have taken advantage of it.Even some of them copied directly from the source websites.I found some solution were directly copied from geeksforgeeks. It's really funny that they submitted the solution with the comments of the website.If this round is still rated, that would create a very wrong practice among the coders.Now everyone will google the problems in first place in the next contests. Anyway,happy coding.

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

    I mean like there is nothing wrong with googling. In most rounds google is not applicable (for the most part) and even if does create a "bad practice" people will immediately realize that they will not always be able to use google in future rounds. Also many use templates of prewritten code which is also allowed by ICPC so overall I don't see any problem with it. However, I will agree that problem D was terrible this round because of how it screwed over so many people with the intended solution.

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

      I don`t understand your position on D. Problem has straightforward O(n*log(n)) solution with segment tree. If you do not know that some intended solutions can get TL or ML than you should read name of the round. Otherwise, it is your risk to use intended one or think on better algorithm.

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

        Of course segment tree and BIT are the obvious solutions, especially BIT. I am talking about how many non c++ users used exact same solution as c++ users with BIT and still got MLE.

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

          That is not fair that you can read and split whole array in 1 line and I need to write whole for(;;) loop. Java have clear advantage. Sry for exaggerating but sometimes it is normal that a person in sneakers can run faster than in boots :)

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

        I realize that this is an educational round but I don't find anything educational about optimization hell.

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

          This exact thing happens to Python coders all the time. Is the solution then to throw out problems that can’t be solved in Python? Where is the line drawn?

          The reality of the situation is that you need to know how to handle stuff like this if you want to code in Java. Problems that are optimization hell get set in ICPC, two from the top of my head this year are ICPC Camp from NAC and Jumping from SER.

          A contest I went to earlier this year at Mercer had a problem where you had to print a double to 3 decimal places. It turned out that the data was written in C++, and the rounding procedure for printf in Java did not work. Thus, all the UCF teams there (except the one team with a Python coder) could not solve the problem.

          Stuff like that will continue to happen as long as the majority of the competitive programming community uses C++. It’s the reason I switched from Java to C++, and it’s the reason you should know some basic C++ if you want to be successful in Java.

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

            Yeah I guess you're right. I mean it doesn't typically happen where using a different language matters but I am just a bit frustrated because over the past few contests I have gotten screwed over for Java's slowness, and considering Java is the second most used CP language, I would think that there would be some care taken to make sure solutions for it pass. I am trying to make an active effort to switch to C++ but I am not sure how well that will go while I'm in the midst of learning new algorithms and such.

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

              Yeah, I understand the frustration.

              It took me about two months to reach the same proficiency in C++ that I previously had in Java. My advice (YMMV) is to just dive headfirst into coding in C++, and only submitting stuff in Java if you have no idea how you could do it in C++. At the start, you might only solve a couple problems per contest in C++, but over time that will increase to half, to most, and finally to all. It might cost you some penalty points, but if the reason you're doing contests on Codeforces is to practice for more important contests (like USACO or ICPC), then the practice you get for those is more important than your rating. Besides, if you deserved the rating that you have, you will get it back quickly once you are more proficient in C++.

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

For people who complain that C2 is non computational geometry problems, I share my binary search solution: https://codeforces.com/contest/1354/submission/80487561

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

    Can you explain the solution

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

      If the square is without rotation, the minimum square will have spare space on one side. We consider the minimum rectangle, and rotate it. when the rectangle rotate, the long side of it will decrease while the short side increase. when it becomes a square, it is the answer.

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

        i believe this is also the expected solution. going on the problem now shows binary search and ternary search tags.

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

    This is actually a cool solution

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

this is a great round. thanks pikmike. those who downvote this round dont love math and cant realize beauty of geometry. it was a classic problemset. however i cant solve problem c2 and d , but i learned very much from these.

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

OMG, I just looked at problom E and misunderstood: |colu−colv|<=1 , then got no idea...

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

Ok, thanks in advance, I need help to know a thing. Today's Problem D(MULTISET) I user policy-based Data Structure (Orderset) and I assume that my code took (2n) Space Complexity, it got MLE. But I saw some solution used up to (4n) Space complexity (Segment tree) and yet that solution got Accepted (y). Can someone please help me to know why??

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

    Policy-based data structure is implemented as a balanced binary search tree, if I'm not mistaken. BBST has hidden memory costs associated with pointers, as well as with the augmented information on nodes (if I'm not mistaken, subtree size, which is used to determine the index of elements). Hence, it actually takes a lot of space because each node in the BBST stores a lot of information.

    Also, properly implemented segment tree should only use up to 2n space complexity. For struct segment tree, you can prove this by drawing the structure of the tree and observing that it is a binary tree with n leaf nodes, which means it should have n — 1 internal nodes.

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

      By "properly implemented segment tree" do you mean the iterative one? (all the recursive segtree implementation I know uses 4*N memory ) If so, how do you binary search on it?

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

        The memory consumption of recursive segment tree is in fact higher than iterative, but that is more of the fact that you need to store pointers to the left and right child nodes. In terms of actual number of nodes created, it can be proven to be 2N-1: each internal node is a union between two disjoint sets of leaf nodes.

        I don't use an iterative segment tree, but I think a similar logic to "seg descend" method could work here: you start at the root and check whether the left child satisfies your requirement. If so, go to the left child. Otherwise, go to the right child. Just code it iteratively rather than recursively.

        Edit: for the specific problem given, I think there is a recursive segment tree implementation that stores 6N 32-bit signed integers. However, given that it is 28 MB memory limit and this algorithm uses 24 MB, plus probably some overhead here and there, I'm not sure whether it passes. Intended solution is probably Fenwick tree or iterative (array) segment tree, not recursive (struct) segment tree.

        Edit 2: Just to check, I coded the struct segment tree solution. It MLEs on test 4.

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

          The iterative segment tree I'm refering to is this (using 2*N memory) and it treats the segment tree as a forest of binary trees, which makes it tricky to do binary search like the recursive versions.

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

            Actually for this problem because the limit on n, 10^6, is so close to the next power of two, 2^20, I think you could just create an iterative segment tree as described in that post with 2^20 nodes, which means that it's always a perfect binary tree, which should make binary search easier.

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

              That's a nice idea xd. Anyway right after posting that comment, I actually mananged to do binary search without changing the size by just storing all the roots when initializing.

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

          I applied the same logic using recursive segment tree with 4*n size and it passes easily ..you can check my submission here https://codeforces.com/contest/1354/submission/80530927

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

            I was talking about pointer-based struct segment tree when I said "recursive". Sorry about the misunderstanding.

            Yep, yours looks about right. Because you're using array indexing to keep track of left and right children in your segment tree, you don't need to store explicit pointers, which was probably what caused MLE for mine.

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

Lol even rating update and editorial release has been delayed.

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

    Is the system test is done? I didn't notice it...

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

      Probably not. Well I may be wrong.

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

        Bruh, the contest evaluation status is seen in the “standings” column of the “contests” page. And its been “Final standings” (Was “Preliminary Standings before that) since about 5:30 IST for Edu. 87. So it is indeed the case that ratings haven’t been updated but system testing is done.

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

          Not exactly. For Educational Rounds, the Final Standing appears both before and after system test.

          When the test details contain the hacks, it means that the system test is done.

          Sorry for my bad English. :(

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

            I'm pretty sure I saw it change. But if you want further proof, enter the contest and check the status on the right hand side. It says "practice". It usually says "system test pending" in case it hasn't been done.

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

          Obviously, those are not the final standings. You can see that still grandmasters and masters are there in the final standings (even after you click on show unofficial button).

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

          I hope you are now aware of the fact that your perception was indeed wrong.

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

Why the editorials are not out yet after 12 hrs to Contest.

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

    Maybe because the system testing is yet to be done.

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

      Why does system testing matter for releasing the editorial?

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

        If the editorial is out then people will hack others weak submissions by reading all the conditions from the editorial and thus their rating would decrease and this would be unfair because person didn't put his mind to find the flaw rather used the editorial

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

          Since the open hacking phase is over, why would that matter?

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

          It doesnt matter since the solution is going to fail in system test anyways. The hacker is not going to be benefitted since there is no reward.

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

            there is no system test for educational round as solution is already accepted and if your solution is hacked after the open hacking it doesn't affects your rating but it would affect if done within hacking period

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

Why there are no editorials for this contest ??

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

When will this contest be rated?

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

    The rating calculations include some manual actions. The most persons usually initiating these actions live in a timezone where it is currently more or less early in the morning.

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

my BIT & O((q+n)log(n)) solution for probloem D

https://codeforces.com/contest/1354/submission/80567274

Just change binary search strategy a bit.

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

    Hi, I was trying similar in the contest. I got a Memory Limit Exceeded on test 4 80499850. Can you explain your modified binary search a bit, I was doing a conventional binary search in the case of deletion to find the minimum index for which getsum function of BIT will return k[i]. Can you explain these lines of your code:

            else{
                x=-x;
                int ans=0;
                for(int step=m;step;step>>=1){
                    if(ans+step<=n&&a.d[ans+step]<x){
                        x-=a.d[ans+step];
                        ans+=step;
                    }
                }
                a.add(ans+1,-1);
            }
    
    • »
      »
      »
      4 года назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

      know little of python, sorry.

      In my BIT, I usd array d[n+1] to store the amount of numbers, like

      n=8

      mutiset: 1 2 3 4 5 6 7

      d: 1 2 1 4 1 2 1 7

      when get q: -6, I try to find bigest ans, while less than 6 numbers is in (0,ans]

      guess ans=8, d[8]=7 numbers in (0,ans], too big

      guess ans=4, d[4]=4 numbers in (0,ans], ok

      **so, the final ans is at least 4. I still try to find bigest ans, while less than 6-4=2 numbers is in (4,ans] **

      ans=4+2, how many numbers are in (4,6] ? d[6]=2 , too big

      ans=4+1, how many numbers are in (4,5] ? d[5]=1, ok

      final ans=5

      less than 6 numbers is in (0,ans]

      NOT less than 6 numbers is in (0,ans+1]

      so ans+1 is the 6th number

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

I read various comments regarding the quality of the problemset. I totally agree that B C D were easily found on web and this is a bad practice in rated contests . But frankly speaking, many might have learned binary search with BIT , lots of concept related to regular polygons. Atleast I have learned few new concepts. So until and unless there is some learning for everyone in the contest, it is a good one .

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

    Also, the Educational Rounds are for this purpose only. If somebody would read what the Educational Rounds are all about here: https://codeforces.com/blog/entry/21496, he/she can clearly notice that these rounds are not for competition but to gain knowledge about the data structure, algorithms or techniques that one might know already. And for those who know them, it is just a practice for them.

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

When will this contest be rated?

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

It was a good game! Many stupid people criticize the game just because they didn't finish the problem, it's ridiculous

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

editorial?

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

It's taking a longer time to get system testing started. I wonder when it will start.

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

I really liked problem G! I solved with a randomized solution. I assume $$$N \geq 5$$$ in the solution written in following.

Step #1. Find one stone between $$$3$$$-rd to $$$N$$$-th box
Because of $$$N \geq 5$$$ and $$$K \leq 0.5N$$$, there is at least one stone between $$$3$$$-rd to $$$N$$$-th boxes.
Let's take $$$G$$$ boxes randomly in $$$3$$$-rd to $$$N$$$-th boxes. Here, in my solution during the contest, I set as $$$G = \min(N - 2, 23)$$$.
Since at least half boxes contain stone, the probability for all boxes to be gifts will be at most $$$2^{-G}$$$, if $$$G < N - 2$$$. If there is at least one stone, compare weight of two boxes $$$G-1$$$ times, and the heaviest one is the stone.

Step #2. Find the range that "no gifts in box $$$1$$$ to $$$x$$$, but at least one gift in box $$$x+1$$$ to $$$2x$$$
First, we'll check if there's no gift in box $$$1$$$ or $$$2$$$. You can check by comparing weight of this box and the stone found in step #1. If there's, we got the answer. Otherwise, we ask the question like following:

  1. Is there any gift in box $$$3$$$ to $$$4$$$? We can get by comparing weights of boxes $$$1$$$ to $$$2$$$, and boxes $$$3$$$ to $$$4$$$. If there's, then terminate by setting $$$x = 2$$$.
  2. Is there any gift in box $$$5$$$ to $$$8$$$? We can get by comparing weights of boxes $$$1$$$ to $$$4$$$, and boxes $$$5$$$ to $$$8$$$. If there's, then terminate by setting $$$x = 4$$$.
  3. Is there any gift in box $$$9$$$ to $$$16$$$? We can get by comparing weights of boxes $$$1$$$ to $$$8$$$, and boxes $$$9$$$ to $$$16$$$. If there's, then terminate by setting $$$x = 8$$$.
We continue until we found and double the range for each iteration.

Step #3. Find the least-index boxes in $$$x+1$$$ to $$$2x$$$ that contains gift
We find the least $$$p$$$ by binary search that holds following:
  • (weight of boxes $$$1, 2, \dots, p$$$) to be larger than (weight of boxes $$$x+1, x+2, \dots, x+p$$$).

The $$$p$$$ will be the requested answer! If $$$N \leq 1000$$$, we will use at most $$$23, 2+9, 9$$$ steps in step #1, #2, #3, so it asks $$$43$$$ questions. My submission is 80502712. You'll learn a lot about binary search if you solve this problem.

Anyway, I'm so honored to get the 1st place (though system test is yet to start) in this round! Thanks to awoo and other writers for organizing this contest.
»
4 года назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

by chance, the round didn't become unrated, creators((??

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

Kickstart, Coderforces Educational, AtCoder Beginner Contest 168 all together why?

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

Wait, is there any test case with $$$m>5000$$$ in E? The constraint says $$$m\leq 10^5$$$.

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

So,after this round,Is it any round exists recently?(except Kotlin Heroes)

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

Is this round rated?

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

Why ratings aren't updated yet?

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

when do we get editorials for Educational Codeforces Round 87 ? waiting since yesterday

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

People who are waiting for editorials....

Try this

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

Comment deleted!

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

I want to know when to start the final system test

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

Seriously, someone should atleast confirm when would the ratings be updated. This is really sad and frustrating

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

    Yeah, its been almost 24 hrs to when the contest started yesterday and yet the ratings haven’t been released. Why isn’t the process automated?

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

what's going on?? it's almost 24hours

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

Why it happened again?

10enf1.jpg

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

when will the system testing start?

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

Please refrain from downvoting the announcement. Author put in considerable effort to come up with good problems. Late release of rating changes has nothing to do with him. Even if you are angry for late editorial and rating changes etc.. please don't downvote.. the author deserves that much atleast for his effort. Thank you.

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

Can somebody tell if this contest was up to the mark in any aspect? (2 times delay in starting time, delay in editorials, delay in system testing, delay in rating changes, googlable solutions for C1, C2, and D, it's more like a codeforces delay round instead XD)

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

    I agree with your point. But I hope as per submissions in C2, D there are very less submissions .So most does not get googlable solutions.

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

System testing finally started :D

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

OMG... Why can't you all just sit and wait? Instead, everyone would downvote the contest and add his "super important" comment about how much pain it is for him to wait.

You know what real pain is? I tell you what. Finding something relevant to the contest while reading your senseless comments about how long you've been waiting for your rating to be updated after crushing the round with getting accepted googled solutions with no idea of why they pass system tests. Not to mention the fact the browser goes mad loading all these comments.

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

    Waiting is acceptable, just worrying about waiting for so long but suddenly announce unrated.

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

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

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

Screenshot-194.png

Alisher_Kamolov's hacks. Seems like cheating.

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

I tried to use segment tree in Problem D and I submitted exactly the same code twice. One using GNU C++17 (64) got TLE (80590272), the other using GNU C++17 got AC (80590625) with the time only 873ms.

Can anyone kindly provide an explanation on this? Thanks.

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

Rip no update yet, its been over an hour since the system testing finished...

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

Is this announcement with maximum comment and minimum votes?

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

I am glad that my name is among yellow's and red's (in first to solve each). I never imagined that this is even possible (for a person like me).

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

In problem B, I have used the binary search logic by storing every occurrence index of '1','2' and '3' and submitted the code in the contest with verdict accepted. In the code I have checked whether it is possible to have substring with all the three characters present in it by multiplying the sizes of the 3 vectors storing the indices and compared it to zero. It went wrong on test number 41 in system testing as it gave output 0.When I submitted the code by comparing individual sizes to 0 it got accepted. Initial Submission(accepted in contest and wrong on test 41) — https://codeforces.com/contest/1354/submission/80476580 Final Submission (accepted on all test cases) — https://codeforces.com/contest/1354/submission/80621256 Can someone clarify!

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

    In your if statement, the product of all three vector size are overflowing. By just adding 1LL in front of it, your solution got accepted. https://codeforces.com/contest/1354/submission/80627780

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

      But can you tell me why is it overflowing insider_pants? It's well within the limit of LL

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

        what you did originally was you just multiplied the sizes of all three vectors but by default compiler typecasts the size of vector into int. So basically, you were doing int * int * int and int has limit of around 2*10^9. It can overflow as the size of the string is in range of 10^5. By adding 1LL in front of it ensures that the compiler typecasts all the sizes into long long and then multiply and now the product cannot overflow.

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

There is no upcoming div-2/3/4 or edu contest on the list. It made me sad.