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

Автор Livace, история, 9 лет назад, По-русски

Привет, Codeforces!

23 октября в 18:35 MSK состоится рейтинговый Div. 2 раунд. Участники из первого дивизиона приглашаются для внеконкурсного участия.

Задачи для раунда были подготовлены мною. Спасибо Даниилу (qoo2p5) Николенко, Никите (FalseMirror) Босову, Александру (Alladdin) Проскурину, AmirReza (Arpa) PoorAkhavan, Ильдару (300iq) Гайнуллину, Алексею (ashmelev) Шмелеву за помощь в подготовке и тестировании задач, Ане Изюмовой за помощь с переводом, Николаю (KAN) Калинину за координацию раунда и Михаилу (MikeMirzayanov) Мирзаянову за замечательные платформы Codeforces и Polygon.

У вас будет 2 часа на решение 6 задач.

Надеюсь, вам понравятся задачи! Удачи!

Upd1: Разбор

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

Div1

  1. Farhod
  2. vintage_Vlad_Makeev
  3. KrK
  4. rajat1603
  5. chemthan
  6. Barichek

Div2

  1. wzp666
  2. isybuq154
  3. SORONGON
  4. Sheng_D_Bao
  5. wxh010910
  • Проголосовать: нравится
  • +187
  • Проголосовать: не нравится

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

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

»
9 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится -47 Проголосовать: не нравится
Spoiler
»
9 лет назад, скрыть # |
 
Проголосовать: нравится -118 Проголосовать: не нравится

Is it rated?

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

As far as I recall, all Codeforce Rounds in the past 8 months ago since joining the Codeforce community have been rated by default, unless otherwise stated before, during, or after the Contest.

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

As far as I remember, all the Codeforce Rounds in the past eight months have been rated unless otherwise stated before, during, or after the Contest.

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

seriously guys , how two comments with same question and in the same time and they have the same color :/ , the first got upvotes and the other one got downvotes ?

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

** ** *****?

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

** ** *****?

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

Is it Rated Contest or unrated???

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

To all people who are asking whether the contest is rated: check the tags.

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

del

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

The increase of the legendary word.

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

Hope problem statements are understandable easily and the contest will enjoyable.

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

I'm one point below div 1. So to me seems like a notorious coincidence

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

I hope the difficulty of problems decreases gradually. In the last few contests, I have noticed a massive decrease in the number of submissions for the last two problems. The image shows one such contest. Note the actual number of submissions during the contest were quite less than that in the image. The same thing happened in yesterday's cook off on codechef.

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

Oh, God why?

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

Scoring distribution?

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

delayed :P

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

Delays, classic

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

Wait for 10 minutes more :(

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

Looks like they wanted the total registrations to reach 7k :P

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

this delay means a lot of inqueue :(

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

Thanks for the delay. I've just noticed that I didn't register for the contest before the delay.

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

Please, no more delays.

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

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

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

How to solve Div2 B Nikita And Strings.i didnt' able to solve it plzz help

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

Can anyone explain the problem 3? It seem simple but got WA.

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

How to solve B ??

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

was O(N*M*2*log(n*m)*8) too much for D

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

How to solve C ?

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

How to solve D?

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

What was A's hack ?

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

Does this problem have a logN per query solution? :

ask for number of occurences of x in range l,r

update range l,r by some d

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

A was clearly the hardest problem, as I didn't really understand the following sentence. :(

"It is known, that problem is from this contest iff its name contains one of Alex's friends' name exactly once."

So I made two submissions, both of which are incorrect but passed pretests. :P

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

Why in D grid is 1000 x 1000 (when time limit is 2 sec), it is too big for slower languages. Why not 500 x 500?

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

E was just a tree version of http://www.spoj.com/problems/LITE/

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

Anyone can tell me how they did C? I did a recurrence but I got WA. if its odd then hit the middle one, then recursively destroy (i, mid-1) and (mid+1, j). If even then if mid=floor(n/2) destroy (i,mid) then destroy (mid+1, j) then hit mid. Anyone sees why this is wrong or what the correct answer is?

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

Is the intented solution for F O(NsqrtN), and if it is, why are solutions with that complexity getting a TLE?

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

hack for A-> DDanilanil :)

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

    Some other people forgot to check if the name does not appear more than once in the problem name. Simple hack : AnnAnn but your case is more tricky like AAnnnn since some people removes the first occurrence of the name and then recheck if it is in there one more time.

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

How to solve F?

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

Can't D be done in O(n*m)? I see a lot of O(n*m*k) solutions passing pretests.

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

Any corner case for Div2 B ?

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

Can't D be done in O(n*m)? I see a lot of solutions with complexity O(n*m*k) passing pretests.

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

What should be the output for this in problem A : "DanilDanilOlya"

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

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

How to Solve C ?

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

Ended up only solving D. A failed at systest because of stupid sizetype being unsigned(so 1-2=2^32-1 which isn't <1), B failed because i stopped searching for more As/Bs after finding B/A, while D was easy BFS(at least for me). I don't understand how did such a small amount of people solve D.

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

Codeforces HACK round #442 (Div. 2)

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

If someone would be kind enough to tell me what went wrong with my E submission ( http://codeforces.me/contest/877/submission/31648193 ). Thanks

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

Is there something wrong with codeforces's servers ???

I have submitted the same code 3 times and each time I got run time error even though I didn't change anything in the code.

Can someone tell me why 31659189 solution is giving runtime error ?

My idea is to turn the tree to an array and then turn this array into sqrt(n) Buckets and then preform the queries on them to get a n * sqrt(n) solution

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

can anybody plz tell me how to solve div2 E.

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

Can anyone explain me why? 31638541

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

oh boy!

I got WA on D test 31

I used a simple BFS too and can't find any bugs in my code or algorithm

could sb help me with it :'(

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

Can somebody tell why this code gave WA for case 49 — http://codeforces.me/contest/877/submission/31647784 in problem D?

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

Suppose if I have a map of size 4 in Div2 C: and I go with the sequence : 2 1 4 3 2 What's wrong with this? Aren't all the tanks damaged after following this sequence? Please Help!

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

could somebody plz tell me why this simple bfs code fails on test 31 http://ide.geeksforgeeks.org/5QUsiv Thanks.

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

Livace do you hate me? I'm in top 5 div1 :(

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

I solved B by the DP method. I tried to find the largest "increasing" subsequence. Wrong answer 15. Can anybody prove why my decision is wrong? My solve: 31644137

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

The problems were cool, but the pretests were really annoying since they actually didn't contain anything important (like tests 48 & 49 for D).

Only 2 D's from my room passed system testing. Out of 14!

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

In the Problem statement for C it was given that If we drop a bomb on the tank in nth cell then the tank will be half damaged and will move to (n-1)th cell.So if we start dropping bombs from nth cell and and go on until first and then in the very last we drop bomb on 2nd then it gives answer (n+1).

for example say we have n=3. So at first we have a configuration 1 2 3. After dropping the first bomb on third cell--> 1 23 _ (3rd tank moved to 2nd cell and half damaged) After dropping the 2nd bomb on 2nd cell --> 12 _ _ (3rd tank is completely destroyed and 2nd is half damaged and moved 1st cell) After dropping the 3rd bomb on 1st cell --> _ 1 _ (2nd tank is completely destroyed and 1st tank is moved to 2nd cell)

This is true for any number of cell.

Have I misunderstood something? I can't also see that problem now as the problem page is showing a error saying "Oops! Something broke on Codeforces. Do not panic. You can try to reload the page or go back to the main page . We already read the megabytes of logs, solving the problem."

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

After I saw that contest will be only 2 hours long, when 6 problems, I thought maybe contest should be longer. Now I think that contest surely should be longer! Because three problems A, B, D are really tricky so interesting to hack.

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

I feel like I've seen problem E before...

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

I have a question about div2 D.

Here is the statement of concern:

Problem Statement

Does this mean she can run UP to k or she has to run k unless she hits the edge/an obstacle? I assumed it meant she ran k, but my solution — 31656460 failed test case 5.

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

How should i understand div2 B correctly my friends? I thought a beautiful string is a string that can be cut into exactly 3 substrings described as in the problem. What did i do wrong? I can't even understand english nowadays!

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

in problem B can anyone please explain where my approach is wrong.

I first created blocks of a's and b's with their respective counts and then i consider the current block is the middle element and if it is 'b' then left and right part could be anything (i.e. bba, bbb, aba, abb) and if current block is 'a' then (aaa, aab, baa) and find the maximum among these (to do this i just calculate the total 'a' and 'b' in the left and right substring respectively).

code : http://codeforces.me/contest/877/submission/31666767

please help me where i am wrong !

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

Problem F Why unordered_map is even slower than map? Both TLE on test 11

unordered_map use 1450ms on test 10 map use only 576ms array use 249ms on test 10

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

31659292 877B - Nikita and string Hey can somebody help me find out what is wrong with my solution to B — Nikita and String. I got wrong answer in test case 37. Thanks.

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

In div2 D, what ever i do, i always get MLE at test case 5 with this solution:31687090 .why? How can i fix it?

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

Where Can I find Tutorials ?

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

anyone can help to explain why in second sample case for problem C. Slava and tanks can destroy all the tanks? The solution doesn't drop a bomb in 4th cell.

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