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

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

Hello Codeforces community!

Codeforces Round #318 (for both divisions) will take place on August, 29 at 19:30 MSK. It is the Thanks-Round devoted to Russian Code Cup. You will be given 5 problems and 2 hours to solve them. Scoring will be announced close to the round. I strongly recommend you to read all problems.

RussianCodeCup is the largest open programming competiton for Russian-speaking participants by Mail.Ru Group. Its history started in 2011. And since the first championship RCC offers great problems and generous prizes. This year finals will be held on September, 19th. Wish good luck to all the finalists! Thank you, RussianCodeCup, for your gift on the 5th anniversary of Codeforces!

I am honoured to be a problem setter for this round. I wouldn't do it alone. I want to thank Zlobober for his great help with problems preparation and MikeMirzayanov (and all people working on Codeforces and Polygon) for this awesome site. It's an amazing place to learn and compete. My big thanks to winger and AlexFetisov for their help with testing a round. And to Delinur for translating statements. As you see, not only a setter creates a round.

It's my first Codeforces round but not my first problems here. You can check out A, C and D from VK Cup 2015 — Round 2. Also you might remember some of my problems in TC rounds. I'm very happy with finally preparing a full round for Codeforces and I hope you will enjoy it. I tried my best to prepare nice and diverse problemset, you will judge it. In all problems you will have to help Limak who is quite unusual bear.

I wish you great fun and no frustrating bugs. Looking forward to seeing you!

UPD: Scoring is 500-1000- 1750 -2000-2500 in div1 and 500-1000-1500-2000- 2750 in div2. Enjoy a round!

UPD: Editorial

UPD: Contest is over. The winners:

Div1:

  1. Marcin_smu
  2. mnbvmar
  3. subscriber
  4. LoneFox
  5. Shef

Div2:

  1. cescmentation_folch (5 problems solved!)
  2. fhxb520630 (5 problems solved!)
  3. bugCollector
  4. Sehnsucht
  5. okaduki1

And note from an author. There were some wrong solutions passing. Sorry for that. I tried my best to create strong tests but I failed a bit. Did you like this round? What do you think about problems?

Thanks for participating!

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

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

No T-shirts ?

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

You solve a lot of users' problems in the blogs...

Wish we can solve your problems too ;)

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

Maybe we should study your previous problems well, to get a whole look of the style of your problems. Maybe?

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

Good luck to all participants (Codeforces Round # 318 — Russian Code Cup). I wish you a good mood during the contest and rankings.

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

Considering the previous round i think it will be better to do dynamic scoring.

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

I think someone is getting ready to get first in this contest. to : sorry_dreamoon Be careful. You have a new mission : Antoniuk

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

I hoped this Contest for T-Shirts but ... TT.TT

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

LOL Guys you are so worried about T-shirts as if you can win them)

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

I wish you great fun and no [frustrating bugs]. Oh yeah we all know where this will be going.

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

This round takes place at the same time as the "Red de Programacion Competitiva" marathon :(

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

I think that I love This contest

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

Actually although all problem statements in qualification and elimination rounds was in Russian two Japanese coders advanced to finals (rng_58 from third place and anta from 21st) :-)

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

Is the statement in Russian only?!?!

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

the stupid one who saw he can't translate, to have upvotes i wish you can translate this comment ************

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

Problems will be in English? or not?

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

Excuse me if I am wrong, but this guy prepared for VK Cup Round 2 one easiest and two hardest problems? If he did than this is real intriging.

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

This is usual round, guys. Statements will be both in English and in Russian.

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

Thank you roundwriter! Can't wait to see this round! :)

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

Lets hope Errichto prepares a great editorial as well as a great round for us . In the past few contests he has helped a lot of guys through his insightful comments . ALL THE BEST :)

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

Hopefully, it won't be another Div 0 Contest.

And don't get fooled guys. It will be like last round. In last round, there was a "PPS" stating top 20 of div 2 will get t-shirt, even though they didn't mention it before contest. I guess they are taking things another level higher. Saying no t-shirts now and then giving top contestants t-shirts later :D

Or, they won't be giving any and I am just over thinking. I won't be getting t-shirt either way...

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

Guys, can you please tell me how can i add my school in my profile . Thanks in advance .

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

'Newbie' zone.... be prepared for me.... I'm almost there... ;_;

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

someone should make codeforces fantasy league ,just like fantasy premier league in football ^.^ ,we can bet on favourite coders to win the round

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

Bear Limak will cause us trouble...

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

Looks like something interesting will happen with the bolded problem scores

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

Why 1750 and 2750 written with bold font?

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

What is the real difference between the knowledge level of a Blue guy and a Red Guy ? ?

I think knowing more algorithms and more exposure to thousands of problems!

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

Ohhh, nice div1 registrants list ..

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

Where rooms?

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

There is guy who is printing "YES" or "NO" (in capital) in Bear and Poker . I tried to hack his solution and it gave me unsuccessful hacking attempt.Why? Its written in problem we have to print like this: "Yes" or "No".

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

I guess you should be awarded for designing the first anti-tourist contest ever! at least till now!

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

not able to hack

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

Забавный сегодня день...

Отравился, проспал до 6 вечера.

18:00 — 20:00 — решил 5 задач на Тимусе.

20:00 — 01:00 — решил 6 задач в тренировке.

01:00 — 02:00 — решил 5 задач на Тимусе.

02:30 — 03:50 — решил 5 задач во втором дивизионе (первым и впервые решил Е) и занял первое место до системных тестов.

10 часов подряд решаю задачи...

UPD: Эх, E упала...

UPD2: Идея была верная, но оказывается надо было сразу обработать "соплю" из подряд идущих вершин, а не ждать когда БФС не с той стороны по ней пойдёт.

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

dreamoon_love_AA hacked my A. Feel so honored!

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

The problems are so nice, thanks for the contest!

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

I liked the problemset, but I've no idea how to solve Div1 D or E. Anyone want to share approaches?

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

I really hate when someones solution has overflow but when you try to hack it , it passes your test but is wrong and should give overflow in this test.
UPD : 12760657 it didn't pass the full tests.

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

Was this contest easy or my skills have improved ?

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

Couldn't hack (or fail) because of lags at the end :( Div1 A-C look quite easy compared to other rounds. Though I failed to implement C..

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

This is the first time I solved A,B,C and had half an hour left. Thanks for that!

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

Am I wrong or there were no -50 points if you submit a solution that fails on a pretest from problem's sample tests in previous rounds?

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

I pressed submit when there are still 20 seconds left but didn't submit my code successfully....... So sad T_T

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

The problem set was commendable for me, especially the idea of problem C. Cheers!

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

I was a bit late submitting div1 A because I didn't believe that it's that easy(specially after div1 A of previous round) and I must be understanding it wrong or missing something , anyone had the same situation?

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

I was trying something like dfs to detect 3 member cycles for Div2-B and finally the flat O(n^3) got AC Suffered 3 WA and around 1.5 hours :(.

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

So is this the first time tourist gets a three digit rank?

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

Can anyone please tell why my submission is giving runtime error? It is working fine on my local ide.

Submission link : http://codeforces.me/contest/574/submission/12757848

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

I was so glad by fast solving Div1A (3 minutes), but in result couldn't solve Div1B, though it is not much harder than Div1A:D
But really nice problems. Thanks!

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

What a contest? Tourist gets 3 digit rank, Petr only with 2 correct submissions until 1hr 45min. Kudos to the problem setter. PS: My personal opinion on the problem set is that it was very good. Since C was easy nobody would have ditched contest as a result of not solving any of them.

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

Some O(qn) solutions passed Div1 D, and one O(n2) solution passed Div1 E. I think more tight time limits for those problems are necessary.

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

That was a wonderful round. Fast Editorial and nice problem set.

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

Can problem B div.1 solve by divide and conquer too?

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

http://codeforces.me/contest/573/submission/12750074

Задача A. Мишка и покер ***** В задаче сказано что нужно выводить Yes, участник выводит "YES" на чем я его хотел взломать Получил неудачный взлом. Пожалуйста уточняйте в условии что может существовать не один формат вывода.

Это вообще нормально, и где это указано?

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

I hope rating update is as fast as system test and editorial

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

maybe problemset was good but there is a big differece between a — b,c and d — e div 1.

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

Hi,

Div2 B

can anyone tell me what's wrong with this solution? http://codeforces.me/contest/574/submission/12750750

Edit: one of my friends told me the problem... Using set.lower_bound() to search can lead to set.end() as the result which when I compare to a number can lead to false result. http://codeforces.me/contest/574/submission/12769046

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

I didn't like having to help a bear politician cheat in div 2 Problem A.

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

    I don't think that's something our mortal minds can comprehend.

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

    I guess he really is a machine like his username says.

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

    It's clearly a brute-force, but seems to be incredibly sped up. The first trick is alignment of the variables in memory (some variables are told to be aligned to 16-byte blocks) — it probably helps cache do its work more efficiently (less cache misses and so on).

    The magic part (inner loop) uses SSE (set of processor instructions which allows many operations to be done at once; why do 100 000 32-bit additions/shifts/comparisons when we can use 128-bit SSE registers to do only 25 000 operations?). You can probably decode what it does here. I guess one can write a simple brute-force and then "encode it" in terms of SSE.

    Still, a question to the author: have you worked for a CPU/GPU manufacturer?

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

      Is there a similar way to exploit SSE in Codeforces for other languages (I'm particularly interested in Java)?

      How much faster would C++ be compared to other languages for this problem?

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

        In my opinion, in Java SSE intrinsics make no sense (Java source code is compiled to Java bytecode which is then run by Java Virtual Machine; you have no access to JVM code, so you cannot optimize it by hand — for example using SSE code).

        I have no idea how other languages compare to C/C++. However, the fact is that many of them may lack support for the intrinsics and thus we won't be able to control the power of SSE.

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

      Actually alignment is required for SSE instructions to work.

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

      Thank you for your explanation. In addition, I think those techniques are not needed if our submission runs on 64-bit systems.

      I have not worked for a processor manufacturer, but I have a bit of experience of performance tuning on CPUs and GPUs.

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

Did author suppose that local optimization should pass in E?

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

It seems that the test data of E is really weak and should be fixed.

This obviously wrong solution of HYPERHYPERHYPERCUBELOVER passed 41 out of 42 tests, and the 42nd test is so small that it could be solved in O(2NN). (maybe it was added during the contest..?) He got accepted with the same solution with some minor modifications.

You can find more obviously wrong solutions which got accepted after the contest..

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

I hate to wait for rate; but it's late and it's my fate.

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

It seems that in problem C there are no tests with maximal degree 3 and answer NO: 12766417

But such test exists and is quite simple.

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

will i go with rank 108 div1?

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

Finally red!

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

Две пачки Лимака автору контеста

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

Why the problemset and the gym are still blocked?

UPD working now.

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

Really nice problemset! Natural and short (but yet original) problems which were really fun to solve or interesting to know the solution :) Thumbs up!

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

Master again.

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

После раунда статусы у всех отправленных решений изменились на "Попытка игнорирована". Что это может означать?

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

In future (t-shirt giving) contests, we could state that there will be t-shirts for div2 after the contest, in that way, there won't be div 1 people here, and div 2 guys can also have a chance to win t-shirts.

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

Мне кажется что это хитроумный план tourist-а, залажать на контесте. Что бы все снова начали о нем говорить, а то теперь когда он выигрывает никто не удивляется(он же Гена).

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

I tried to hack a solution of the problem C. It showed invalid input. Can someone help? Link: http://codeforces.me/contest/574/hacks/164504/test