Автор KAN, 10 месяцев назад, ,

Добрый день!

12-го ноября в 19:05 по московскому времени состоится Отборочный Раунд 3 олимпиады для школьников Технокубок 2018. Раунд будет длиться два часа, участникам будут предложены 6 задач. По его результатам лучшие участники (но не более 45% от общего числа участников раунда) будут приглашены на финальный этап в Москву. Для регистрации на раунд и участия перейдите по ссылке. Не забудьте заранее зарегистрироваться на раунд! Для опоздавших будет открыта дополнительная регистрация (с 19:15 до 19:35).

Зарегистрироваться на Отборочный Раунд 3 →
Соревнование открыто для всех в виде отдельных раундов для первого и второго дивизионов.
Для всех участников всех трех редакций этого соревнования будет пересчитан рейтинг.

Параллельно с Отборочным Раундом будут проведены открытые раунды для обоих дивизионов, в них могут принять участие все желающие.

Напомним, что согласно правилам раундов Codeforces во время соревнования ваши решения будут тестироваться только на претестах (предварительном и неполном наборе тестов), а системное тестирование состоится после окончания раунда. Обратите внимание, что претесты не покрывают все возможные случаи входных данных, поэтому тщательно тестируйте свои программы! После прохождения претестов у вас будет возможность заблокировать решение, тем самым получив привилегию искать ошибки и взламывать чужие решения, но отказавшись от возможности перепослать ваше решение при каких-либо обстоятельствах (например, даже если вы найдете ошибку или вас взломают). Со временем задачи падают в стоимости. После системного тестирования учитываются только полные решения. Подробнее про правила соревнований можно прочитать по ссылкам:

Регистрация на олимпиаду Технокубок еще открыта. Победителей и призеров олимпиады ждут значительные квоты при поступлении в престижные технические вузы России и ценные призы! Если вы — школьник 8-11 классов и пока не зарегистрировались на Технокубок, то самое время сделать это:

Зарегистрироваться на олимпиаду →
После регистрации на олимпиаду не забудьте зарегистрироваться на Отборочный Раунд!

В финал соревнования будут приглашены лучшие участники каждого из отборочных раундов (но не более 45% от общего числа участников раунда).

Спасибо MrKaStep, komendart, veschii_nevstrui, bixind, AndreySergunin и DPR-pavlin за подготовку задач Технокубка, а также lewin, любезно предложившему последнюю задачу. Также спасибо zemen и AlexFetisov за тестирование раунда.

Желаем удачи на олимпиаде,
команда Технокубка.

UPD: Мы сожалеем, что из-за технических проблем не получилось провести раунд без сбоев. Раунд будет нерейтинговым. В отборе Технокубка раунд учитываться будет, кроме того, мы планируем провести еще один отборочный раунд. Надеюсь, вам понравились задачи.

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

Технокубок 2018 - Отборочный Раунд 3

Codeforces Round #445 (Div. 1, основан на Отборочном раунде 3 Технокубка 2018)

Codeforces Round #445 (Div. 2, основан на Отборочном раунде 3 Технокубка 2018)

Опубликован разбор.

•
• +584
•

 » 10 месяцев назад, # | ← Rev. 2 →   +65 This round will be my first blue-name-contest. Good luck.
•  » » 10 месяцев назад, # ^ |   -54 We don't care
•  » » » 10 месяцев назад, # ^ |   -46 I do agree with him
•  » » » » 10 месяцев назад, # ^ |   -22 Me too
•  » » 10 месяцев назад, # ^ |   +14 This round will be baumanec's eighteenth purple-name-contest. Good luck.
•  » » » 10 месяцев назад, # ^ |   -39 whocares
•  » » 10 месяцев назад, # ^ |   -7 I’m from China and I had a bad round because of the terrible Internet.502 Bad Gateway MikeMirzayanov All of my classmates also met this problem for half an hour, could you plz give us a unrated?
•  » » » 10 месяцев назад, # ^ |   0 In Russia we had this problem too. It was not because of terrible Internet but because of problems on codeforces
 » 10 месяцев назад, # |   -152 iS It RaTeD??
 » 10 месяцев назад, # |   +36 Hope that there would be no issues like the last "rated" contest...
•  » » 10 месяцев назад, # ^ |   0 We did have issues though
•  » » » 10 месяцев назад, # ^ |   0 Too bad things are not destined to be as we have wished... :<
 » 10 месяцев назад, # |   -66 std::string detectIsItRated(std::string comment) { std::transform(comment.begin(), comment.end(), comment.begin(), ::tolower); return (comment.find("is it rated") != std::string::npos ? "Need Ban" : "Thanks"); } 
 » 10 месяцев назад, # |   -56 iS iT rATED !?
 » 10 месяцев назад, # | ← Rev. 2 →   0 First contest I'll have time to participate in for 2 months. Hopefully I'll be able to reach expert!
•  » » 10 месяцев назад, # ^ |   0 Better luck next time!
•  » » » 10 месяцев назад, # ^ |   0 I will be expert if this is rated. pls........
 » 10 месяцев назад, # |   +2 another contest! thank you!!
 » 10 месяцев назад, # |   +120 By the way, this contest round number is 445, and this contest ID is 890 in Div.2 one. (889 in Div.1) Finally, Codeforces achieved to a host y = 2x round. (Let y be the contest ID, let x be the round number)
•  » » 10 месяцев назад, # ^ |   -25 super funny
•  » » 10 месяцев назад, # ^ |   +34 Nice observation ;)
•  » » 10 месяцев назад, # ^ |   -29 HAHAHAHA LOL!!!!!!! XXXXXXXXXXDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
•  » » 10 месяцев назад, # ^ |   +17 good one
•  » » 10 месяцев назад, # ^ |   +25 And can you make graph of y-2x vs round number? ;)
•  » » » 10 месяцев назад, # ^ |   +73 Yes! To make the graph more easier to see, I made the graph of 2x-y vs round number, not y-2x vs round number.
•  » » » » 10 месяцев назад, # ^ |   +30 you freak _/_
•  » » » » 10 месяцев назад, # ^ |   +14 That sudden fall of 30.. Isn't it strange? What exactly happened?
•  » » » » » 10 месяцев назад, # ^ | ← Rev. 2 →   +10 Well... the value of 2x - y decreased, while 2x increased, which means that y increased faster. It means that there were rounds that are not regular CF rounds.If we have a look at contest list, we can see that there was whole bunch of non-regular rounds between Round 340 and Round 350.
 » 10 месяцев назад, # |   +28 Happy 11.11 festival! :D
 » 10 месяцев назад, # |   0 Ну шо,время взломов :)
 » 10 месяцев назад, # |   -6 KAN's contests are very interesting, hope for everyone a good time and high rankings.
 » 10 месяцев назад, # |   -9 I wish all of newbies to be pupils. It is time to change colours. Good luck to all!
•  » » 10 месяцев назад, # ^ |   -8 and all pupils to be specialists finally ;)
•  » » » 10 месяцев назад, # ^ |   0 And all specialists to be experts finally. ;D
 » 10 месяцев назад, # |   0 Chinese students have finished the Noip.So I'd like to enjoy this contest instead of caring my low score.XD
 » 10 месяцев назад, # |   0 Will hope that the contest will not have any glitches and the contest will remain rated :) KAN
•  » » 10 месяцев назад, # ^ |   0 Yes please
 » 10 месяцев назад, # |   -6 hope this round with short problem statement...
•  » » 10 месяцев назад, # ^ |   0 dont loose hope XD
 » 10 месяцев назад, # | ← Rev. 2 →   +23 These days codeforces contests frequency is very low :(
•  » » 10 месяцев назад, # ^ |   -7 A correction indeed, Codeforces RATED contest frequency is low.
 » 10 месяцев назад, # |   0 well may be , i can reach DIV-1 today :p Let's Hope for the best :)
 » 10 месяцев назад, # |   +73 I don't want unrated contest ;(
•  » » 10 месяцев назад, # ^ |   +20 I'm also :(502 Bad Gateway500 Internal Server Error
•  » » » 10 месяцев назад, # ^ |   0 I also had these two issues.
•  » » 10 месяцев назад, # ^ |   0
•  » » 10 месяцев назад, # ^ |   +2 2 back to back unrated contest would be too bad
 » 10 месяцев назад, # |   0 Why there is no extra registration for Div.1 ?
 » 10 месяцев назад, # |   +45 laggforces
 » 10 месяцев назад, # |   +13 It Will be unrated :(
 » 10 месяцев назад, # |   +20 am I the only one who has problems to load the contest area?
 » 10 месяцев назад, # |   +87 Servers of CF , during the contest !
•  » » 10 месяцев назад, # ^ |   +10 This image is an upvote machine. Every time servers are down people are racing to post this.
 » 10 месяцев назад, # |   +31 WTF is going on with the server???
 » 10 месяцев назад, # |   +50 Will the contest be made unrated?
 » 10 месяцев назад, # |   +24 This contest should be unrated. There are way too many server issues for this round to be fair
 » 10 месяцев назад, # |   +20 Shouldn't it be unrated? Some people may take a web on the computer, and they write it when the web does not work, it's unfair~
 » 10 месяцев назад, # | ← Rev. 2 →   +11 KAN will this round be unrated? I really hope not but it probably will.
 » 10 месяцев назад, # |   0 KAN will this round be unrated? I really hope not but it probabky will.
 » 10 месяцев назад, # | ← Rev. 2 →   +96
•  » » 10 месяцев назад, # ^ |   +43 New version:
 » 10 месяцев назад, # |   +72 is it rated?
 » 10 месяцев назад, # |   +69 My whole contest f**ked up due to servers issue.
 » 10 месяцев назад, # |   +34 Many people couldn't submit for 1/2 hour because of "502 Gateway Timeout" and various other connection errors.Is it rated?
•  » » 10 месяцев назад, # ^ |   0 I believe it was a sitwide problem, so it affected everybody. Maybe because everyone was affected equally it can remain rated?
•  » » » 10 месяцев назад, # ^ | ← Rev. 2 →   +5 i got very low score because I had to wait more than 30 minutes to submit A and B. There's no way it can be fair at this point. Within that 30 minutes, there can be huge differences in ranking if order of submitting is different for everyone.
•  » » » » 10 месяцев назад, # ^ |   +9 That can be adjusted though, I'm sure they have logs of when the site was down, surely anyone who submitted after it can have their time penalty adjusted to what it would be as if no issues occurred.
•  » » » » » 10 месяцев назад, # ^ |   0 "anyone who submitted after it can have their time penalty adjusted to what it would be as if no issues occurred" How would one know what this adjustment should be? I understand you had a good contest, doesn't mean it was fair for the others, man.
•  » » » » » » 10 месяцев назад, # ^ |   0 The adjustment should be the amount of the the site was down for. It's not as if some people were only unable to access the site for 5 minutes, it was the same for everyone. As for some people not being able to see problem statements, I've already accepted that is a grey area in which some people were affected more than others. That is something the contest runners will have to decide upon. But if we're simply talking about time penalties, then yes, it can be adjusted fairly for everyone.
•  » » » » » » » 10 месяцев назад, # ^ |   0 What if someone solved a problem after 1 minute of the server problem and one after 29 minutes ? Are they going to get the same score?
•  » » » 10 месяцев назад, # ^ |   +8 Also, I accidentally closed the problem page and was unable to open it for the next half an hour. There's no way this contest should be rated.
•  » » 10 месяцев назад, # ^ | ← Rev. 5 →   0 It is not rated. For some reason I could not see the announcement — a friend told me.EDIT: Nevermind. Everybody ignore farmersrice he was trolling, we still do not know if it rated. Go spam him with downvotes too.
 » 10 месяцев назад, # |   0 ɔopǝɟoɹɔǝs˙ɔoɯ is temporary unavailable
 » 10 месяцев назад, # |   0 Not again, please, not again.
 » 10 месяцев назад, # |   +21
 » 10 месяцев назад, # |   +337 Codeforces in a nutshell
•  » » 10 месяцев назад, # ^ |   +26 My upvote is on the way.
 » 10 месяцев назад, # |   +14 I skipped free pizza for this :|
 » 10 месяцев назад, # |   +5 I have class tomorrow QAQ . I should go sleep.
 » 10 месяцев назад, # |   +27 Two unrated in a row? PLEASE GOD NO.
 » 10 месяцев назад, # |   +11 The good old Codeforces seems to be back, the way we remember it. I like the problems, doe.
 » 10 месяцев назад, # |   0 I know They are gonna un-rate this contest. They just tried to calm us down for now. Bluff Masters xD
•  » » 10 месяцев назад, # ^ |   0 What's rank till now??
 » 10 месяцев назад, # | ← Rev. 2 →   -24 Problem C, div2. Test 2.What about answer: 1 -> 1 -> 1 -> 2 -> 1 -> 2I suppose this is correct for sequence "0 1 0 1 3" in journal but requires only 2 rooms instead of 3 in official answer.
•  » » 10 месяцев назад, # ^ |   0 emmm,in the 3rd second,the number 2 can't refer to 0
•  » » » 10 месяцев назад, # ^ |   0 actually can, cause we first time visit room 2, so it's ok to put 0 to journal.But anyway, thank you.However, My answer is wrong. In ther 4th second we cant refer to 1, cause last time we visit room 1 was at second 2.My bad
•  » » 10 месяцев назад, # ^ |   +5 Quick tip: Never discuss a problem during contest time, regardless it is rated or not, man.
•  » » » 10 месяцев назад, # ^ |   0 yeap, sorry =(
 » 10 месяцев назад, # |   +155 Codeforces round 502
•  » » 10 месяцев назад, # ^ |   +6 504 too
 » 10 месяцев назад, # |   +5 Уважаемый Codeforces, почему у вас всегда проблема с серверами? С чем это связанно? Из-за проблем с подвисанием я профукал начало и пришлось пропустить раунд :(
 » 10 месяцев назад, # |   +38 You can't say everyone was affected equally . Suppose server was down from t=x to t=x+30. One solves at t=x-1 and submits it at t=x-1. And one who solves at t=x will submit at t=x+31. Further imagine if First guy has access to read the next problem and second guy doesn't havve since he hasn't loaded the problem page of next problem .
•  » » 10 месяцев назад, # ^ |   -12 The first point can easily be fixed by simply subtracting 30 from all submissions made after x. The second point is a more complicated matter, and could go either way.
•  » » » 10 месяцев назад, # ^ |   +4 The first point can't be solved either. Say the servers went down at time t. Someone may have solved a problem at time t + 5 and had been wanting to submit his code, but only got to submit it at t + 30 (when the servers were back up). However, he would receive a score equal to someone who solved it at t + 25, and submitted at t + 30, by your logic. And there were others like me who stopped the contest assuming it would be unrated for sure (as it was only natural to assume so).
•  » » » » 10 месяцев назад, # ^ |   0 Further we can extend the issue, someone see a new problem at t=x-1 and starts solving and submits at t=x+31. No problem. But if someone wants to see the new problem after that, he will have to wait till t+31.
 » 10 месяцев назад, # |   +6 Is it only me or someone else get 502 error during the contest... Just managed to log in.
 » 10 месяцев назад, # |   +31 let's take into account that many of us left the coding arena when the site was not working only to come back later to find out that contest was extended. it's not fair at all to make this contest rated.
 » 10 месяцев назад, # | ← Rev. 2 →   +19 Codeforces Should Really Buy A New Server To Work When The Current One Is 502. Codeforces Should Really Buy A New Judger As An Alternative For The Stuck Judge System In The Contest. Codeforces Should Really Buy A New Set Of Problems In Compensate For Several Unrated Problems These Days.
 » 10 месяцев назад, # |   +20 I hope admins realize that extending the contest by 30 mins does not make up for the issues. Everyone was affected differently so it would be completely unfair to rate it.
 » 10 месяцев назад, # |   +4 make codeforces great again
 » 10 месяцев назад, # |   +7 Internal Server Error again :( Leaving the contest.
 » 10 месяцев назад, # |   +15 Может быть я чего-то не понимаю... Но если увеличивать время контеста, из-за того, что кф упал, то следует уменьшить время сдачи задачи участника после падения, на время "отлежки" системы. А лучше сделать анрейт и новый отбор... P.S. а еще лучше купить серверов.... #make_cf_great_again P.P.S. пишу комент во время раунда, мб что-нибудь поменяется...
 » 10 месяцев назад, # |   +16 The contest should be unrated. As many others, I thought that the codeforces is down, so I gave up. But now I can see they extended the time, which doesn't fix things.
 » 10 месяцев назад, # |   +55 You can't just extend 30 minutes and say it's rated. What about all those people who left in the middle of the contest to do something else? What about the people who solved the problem at the beginning of the downtime interval vs. at the end, are they all the same?
•  » » 10 месяцев назад, # ^ |   0 Says the person who trolled everyone on cf discord that it was rated.Evidence: https://snag.gy/c7Cj0g.jpg
 » 10 месяцев назад, # |   +58 Codeforces teaching me more about Servers Breakdowns than Algorithms and Data Structures.
 » 10 месяцев назад, # |   +1 going rated anyway?)0))))
•  » » 10 месяцев назад, # ^ |   -12 Yes they should not make two consecutive contests unrated .... But Codeforces is down these days which ruins fun of contests :(
•  » » » 10 месяцев назад, # ^ |   0
•  » » » 10 месяцев назад, # ^ | ← Rev. 2 →   +12 That's not a valid reason at all to make the contest rated.1 — While the server was down some people left the problems opened hence they got extra time to find a solution.2 — Some open lots of Codes to hack and generated test cases while the server was down.3 — Some just left the contest since the servers were down for 20+ min ( Most will think " For sure it'll be unrated " and do so.
 » 10 месяцев назад, # |   0 It's still impossible for me to perform a hack... The server is just too slow and will stuck at the hack page...
 » 10 месяцев назад, # |   +22 Alright it's time to vote.http://www.strawpoll.me/14385815/r
 » 10 месяцев назад, # |   +3 Не понимаю, каким образом некоторые участники успевают сдать первую задачу на 00:01 или на 00:02? Я условие за одну минуту не всегда могу прочитать. Просветите, пожалуйста.
•  » » 10 месяцев назад, # ^ |   +14 Читать можно очень быстро и почти по диагонали, решение первых задач иногда придумывается прямо в процессе чтения или от одного взгляда на примеры (если задача слишком классичесская), далее есть готовый шаблон решения, в который надо вбить формулу, скопировать пример, нажать хоткей для запуска, проверить правильность ответа глазами, послать.
 » 10 месяцев назад, # |   +24 I am not sure if it was a DOS attack or the servers crashed for an unknown reason, if it was, we can't let the terrorists win, make it rated!I am just saying this because I think I will go up, so don't take it seriously :P
 » 10 месяцев назад, # |   +65 Sh*t. I opened movie when CF servers gone down, and then my friend told me they are back, then wrote something for B and it is hacked now by Um_nik. Now I have to do binary search on movie for finding where I was. Really sh*t.
•  » » 10 месяцев назад, # ^ |   0 lol
 » 10 месяцев назад, # |   +6 How to solve C? I can only think out some kind of DP that can't even fit memory limit.
•  » » 10 месяцев назад, # ^ |   0 I think we can fix the value which we can get maximum value and count how many way to achieve it, i need 1 more second to submit and know whether it's correct or not
•  » » 10 месяцев назад, # ^ |   +13 1) Brute force it2) Search for the first two columns on OEIS3) Find a pattern4) ???5) Profit!
•  » » » 10 месяцев назад, # ^ |   +4 A 9gagger, I see you're a man of culture as well.
•  » » » 10 месяцев назад, # ^ |   0 I wonder how many contestants solved this problem without OEIS.
•  » » 10 месяцев назад, # ^ |   -8 In my opinion, greedy algorithm can be a fine approach. I used an array (I'll name it A): element with index i is used to store the index of the room which was last visited in minute i. (if this room is visited again in the future, the value of this element is changed back to 0).Then I did a linear check over all numbers in the notebook:Assume that the number written in minute i is x. If there was a room which was last visited in minute x, we could assume that that room is visited again in minute i (it's the easiest way to handle without adding new rooms). Assign A[x] to A[i], then assign 0 to A[x]. Otherwise, since no room was last visited (until minute i) in minute x, the man must have enter a new room. Increase the room count by 1, and assign the index of the new room to A[i].Hope this will help. And sorry if my expressions could be complex though...
•  » » » 10 месяцев назад, # ^ |   0 With all due respect that is very nice but he asked about Div1 C
•  » » » » 10 месяцев назад, # ^ |   +8 Ouch... sorry then. Should I delete this for now?
•  » » » » » 10 месяцев назад, # ^ |   +3 Well, some will find it useful anyway
•  » » » » » » 10 месяцев назад, # ^ |   +9 Hmm okay, provided that they ended up seeing this long comment and figure out my misunderstanding... :< Anyway, thanks, just for having a nice response ;)
•  » » 10 месяцев назад, # ^ | ← Rev. 3 →   -7 To solve Div1 C, Div2 ELet's calculate two functions:dp[i] — How many [i] permutations exists, where last element is i and will return correct maximal value.dpsum[i] — How many [i] permutations exists, where element i is in one of the last k positions and algorithm returns correct maximal value.Then we can calculate these functions in linear time:To calculate dp[i] we simply append i to the end of all the [i-1] permutations, where i - 1 is located in one of the last k positions and algorithm will return correct maximum value.dp[i] = dpsum[i - 1]To calculate dpsum[i] we must remove all permutations, where maximum value will be located outside the last k elements of permutation from dpsum[i - 1]. Then append new element to the end of permutation, it must be less than previous maximum value. So multiplying by (i - 1) we add this new element and increase all larger, equal permutation element values by one, so we get [i] permutations, where i is located in range [i - k + 1, i - 1]. Lastly, we must append all permutations which have maximal value i in the last position of [i] permutation, we calculated it in dp[i].Then we can calculate the number of all good permutations, where correct maximum value is returned by algorithm.Lets fix position i, where maximum value n will be located. Then first i element prefix of permutation must return correct maximal value and maximal element is in the last position of permutation formed by prefix, so we use dp[i]. We choose order of last n - i elements in (n - i)! ways. Suffix of last (n - i) elements forms a permutation.Then we must merge these two permutations together by merging all elements except maximal n together. This can be done in ways.Then the number of bad permutation is count of all [n] permutations minus good permutation count;answer = n! - good_perm_cnt
 » 10 месяцев назад, # |   +9 Я предлагаю 4-ый отборочный раунд, ибо этот раунд можно вообще не засчитывать из-за нестабильной работы системы...
 » 10 месяцев назад, # |   -21 This round must be rated
 » 10 месяцев назад, # |   +5 Hi, I submitted A (incorrectly) just before the website crashed, and I had to waste about half an hour waiting for it to come back on. As a result, my A was submitted 30 minutes later than it should have been, and my rating will likely fall is a result. Can this contest be unrated for me?
 » 10 месяцев назад, # |   +34 Actually I finished coding div 2 C in 32-33 mins mark. I was about to submit and the site went down then. I tried to submit for for the next 20-25 mins but coudn't due to the issues.Also, the site was down and up,down and up at least until the 1.15 mark, and I managed to crunch in a submit during the 2-3 seconds the site was working between the lags around the 58 min mark. And I see some people have already submitted on 28-29 mins mark. I guess this is kinda unfair.
 » 10 месяцев назад, # |   -24 Rated Please
 » 10 месяцев назад, # |   -17 Second consecutive contest of codeforces that is very bad : not clear question bad pretest and anyone can hack easily Bad Gateway Why ?????
•  » » 10 месяцев назад, # ^ |   +6 it was not bad really . problem were pretty clear and pretests were not too weak . i was busy coding div1 B for almost the whole contest so i didnt get that gateway error at all ! however hacking was almost impossible
•  » » 10 месяцев назад, # ^ |   0 Actually it was a good contest except the bad gateway problem. Problem statements very fairly clear and some hacks are always expected in div2A.
•  » » » 10 месяцев назад, # ^ |   0 That's right. but those could be very better. codeforces is a good and popular site as a result anyone have high expectations.I hope codeforces be better in the future like always! :)
 » 10 месяцев назад, # |   +16 Great contest plagued by server issues :(
 » 10 месяцев назад, # |   -16 I was unable to hack in the last 6-7 minutes, but still, let's not make the round unrated. Even the last rated round was unrated. Looks like, system issues are becoming rather common, so this way, who know when we'll have an actual rated round. Please don't make it unrated.
 » 10 месяцев назад, # |   0 How to solve E? f(1, x) can be computed in O(log2), I'm not sure it has anything to do with real solution, though. I tried some randomization stuff but couldn't pass pretests.
•  » » 10 месяцев назад, # ^ | ← Rev. 2 →   0 I thought of the same thing (you're using the fact that X halves or stays the same at each step)? You can also do something like: "if (a[i] <= a[i + 1]) delete a[i + 1] and increase the coefficient of a[i] by 1" and you get a decreasing array, with some extra coefficients. Still not very useful though:(
•  » » » 10 месяцев назад, # ^ |   0 Yep, I did both of them but they were'nt very useful :(
 » 10 месяцев назад, # | ← Rev. 3 →   -16 I hope they consider making it rated for those with positive rating gains and unrated for those who lose rating (as they've done in the past). This could satisfy everyone?Edit: I don't understand why a reasonable suggestion is being downvoted.
•  » » 10 месяцев назад, # ^ |   0 That's a good idea. emmm....
•  » » 10 месяцев назад, # ^ |   0 nah, the rating inflation will be skyrocketing if that were the case.
•  » » » 10 месяцев назад, # ^ |   0 Well, they've done it for a few contests in the past and it seemed to meet most people's demands.
•  » » » » 10 месяцев назад, # ^ |   +10 Can you point which ones to me?
•  » » » » » 10 месяцев назад, # ^ | ← Rev. 2 →   -10 I would, but I don't precisely recall the exact contest. I could dig around the previous 100 contests, but that would be painful. I'll just leave my suggestion as is.
•  » » » » » 10 месяцев назад, # ^ |   0 This idea was applied in csacademy round 37
 » 10 месяцев назад, # | ← Rev. 5 →   0 My attempt on E (Div 2.):We will construct a permutation that has the following structure: Starting with a values, then place the value, namely false_max, that will be the answer of fast_max() procedure, then k values after that, then the rest of the number. Note that the first a + k + 1 elements in this array will be <= false_max. The number of choices can be decomposed into: Choose (a + k + 1) elements from the set of [1, 2, ..., n-1] -> the answer is combinations(n-1, a + k + 1) Place the maximum element, false_max, from the above step at array[a + 1]. Re-arrange the remaining numbers of the chosen elements into (a + k) spaces -> the answer is (a + k)! Re-arrange the remaining not-chosen numbers into (n - a - k - 1) spaces -> the answer is (n - a - k - 1)! That is for one a. a will be ranged from [0, n - k - 2]. Calculate the sum of all intermediate values gives the final answer.Here is the pseudocode:  long long answer = 0; long long mod = 1000000009; for(int a = 0; a <= n - k - 2; a++) { long long temp = mod_fac(n - a - k - 1, mod); temp *= mod_fac(a + k, mod); temp %= mod; answer += temp * nCk(n - 1, a + k + 1, mod); answer %= mod; } I got Wrong answer on pretest 15. Is there anything wrong with my solution, or just that my implementation is so poor that it can't handle the mod part?
•  » » 10 месяцев назад, # ^ |   0 Oh wow what a coincidence, we posted the same wrong solution at the same time!
•  » » » 10 месяцев назад, # ^ |   0 I just realized that after posting my comment, too. I spent my last 10 minutes trying to Google about nCr % p, but some copy-paste can't save me though...
•  » » 10 месяцев назад, # ^ | ← Rev. 3 →   -13 "temp *= mod_fac(a + k, mod);"its actually not (a+k)!, since in the first a numbers there must be no k consecutive decreasing values, otherwise you will stop at them and not reach the a+1th value.to calculate this number, let dp[i] be the number of ways to permute first i numbers such that no k are increasing. dp[i]=(dp[i-1]/(i-1)!+dp[i-2]/(i-2)!+...+dp[i-k]/(i-k)!)*(i-1)! (i is from n-k to n-1)
•  » » » 10 месяцев назад, # ^ |   0 Thanks for letting me know where I got my number wrong!
•  » » » 10 месяцев назад, # ^ |   0 Can you please explain this dp? I struggled for the whole contest to find this.
•  » » » » 10 месяцев назад, # ^ |   -8 Let's find dp[n]. Obviously, you can place the number n only in the last k spots, otherwise you would have more then k numbers smaller then n after n. Lets say you place number n at position i (so you have i numbers, then n, then n-i-1 numbers) (n-k<=i<=n-1). The first i numbers also have to respect the condition (of no k decreasing consecutive numbers), so there are dp[i] ways of arranging them. Also, there are C(n-1,i) number of ways of choosing the first i numbers out of the n-1 other numbers. We can arrange the last n-i-1 numbers in any way, since n will be bigger then all of them, so there are (n-i-1)! ways. Final formula:dp[n]=sum(dp[i]*C(n-1,i)*(n-i-1)!)=sum(dp[i]*(n-1)!/i!)=(n-1)!*sum(dp[i]/i!), where i is from n-k to n-1
•  » » 10 месяцев назад, # ^ | ← Rev. 3 →   0 I think your problem might also have overlap issues. Consider the step when n = 10 and k = 1. For the permutation {1,2,4,3,5,6,10,7,8,9} and a=3 your solution would consider false_max=5, whereas the false_max should've clearly been 4.
 » 10 месяцев назад, # | ← Rev. 3 →   +5 How do you solve problem E? I got WA on test case 15 with this formula so I want to know if the formula was wrong or if it was something in my code.
•  » » 10 месяцев назад, # ^ |   +1 For example: n = 5, k = 1 You will count this permutation twice: 2 1 4 3 5
 » 10 месяцев назад, # |   +3 Hacks for Div 2 a?
•  » » 10 месяцев назад, # ^ |   0 Many people checked sum/2. It get WA when sum is odd.
•  » » 10 месяцев назад, # ^ |   0 one guy in my room checked d+e+f == c+d+e. Hacked.
•  » » 10 месяцев назад, # ^ |   0 for who used sum/2 for checking ... 1 1 1 1 1 2for sorting and then grouping (0,1,5) — (2,3,4) ... 0 1 3 4 7 7
•  » » 10 месяцев назад, # ^ | ← Rev. 11 →   0 There was a solution in my room which checked a[0]+a[4]+a[5]==a[2]+a[3]+a[1]. I hacked it using 1 6 7 9 10 11. Several other hacks are possible.
 » 10 месяцев назад, # |   +6 All right, go rated
 » 10 месяцев назад, # |   +3 What is the reason of this server break downs? Poor servers, DDOS or smth? Can anyone explain it?
 » 10 месяцев назад, # |   0 How to solve Div2-D (Div1-B) ?It'd be nice to give hints before the complete solution.
•  » » 10 месяцев назад, # ^ |   +4 Hint : Will the result contain a character more than once ?
•  » » » 10 месяцев назад, # ^ | ← Rev. 3 →   0 yep! you are right!
•  » » » » 10 месяцев назад, # ^ |   +1 How the initial strings look like?
•  » » » » » 10 месяцев назад, # ^ |   0 I was wrong, i thought ans for 3 aa bb cc would be aabbcc. but the ans is no.
•  » » » 10 месяцев назад, # ^ |   0 Thanks
•  » » 10 месяцев назад, # ^ |   0 implementation
•  » » 10 месяцев назад, # ^ |   +3 is there is a solution if a character occurs twice in a string?
•  » » » 10 месяцев назад, # ^ |   +8 no
•  » » » » 10 месяцев назад, # ^ |   0 sm1 hold me, captain obvious is striking so hard
•  » » 10 месяцев назад, # ^ |   0 solution will be a forest of linear trees
•  » » 10 месяцев назад, # ^ | ← Rev. 2 →   +3 Well i couldn't solve Div 2 D but here are some of the things that i had thought of during the contest. If someone has solved with similar assumptions then please help in how to construct a solution from here. final answer will contain each character once so length <=26 if any of the input string and all its sub strings are disjoint from the other strings or their substrings then we don't have to worry about it and can simply append it to the answer. (The hard part and from here im blank) I need to find a way such that an input string joins at the either of the ends of another string or merges in the middle. final answer will be this string along with the disjoint strings appended. Can anyone help me create a solution from here or if my assumptions are wrong then point em out please? Thanks :)
•  » » » 10 месяцев назад, # ^ |   0 Construct from strings graph symb -  > nextsymb. This graph must be:1) uncycled;2) from each vertex there must be at most one edge;3) to each vertex there must be at most one edge.So from that graph you must iterate over vertexes that have no one edge points to them and create answer.Example:abbccddaAnswer is NO since graph a->b->c->d->a is cycled. kaskadAnswer is NO since from a there are two edges to s and to d.
•  » » » » 10 месяцев назад, # ^ | ← Rev. 2 →   0 Thanks for this but i dont quite understand how the graph is being made. Can you please explain for this input 2 abc xyz Thanks! :') Update: I've understood thanks!
•  » » » 10 месяцев назад, # ^ | ← Rev. 2 →   +1 Here's how I did it (With the same assumptions as you did): - Put in all the strings in a set S. - If any string has a repeating character, print NO(since this character will have more counts than the entire string). - For every character c in the alphabet, do the following: Make a set of all strings that contain this letter, say T, and while the size of this set is larger than 1, pick two strings from this set, merge them, and insert result in the set S. (Remove the original strings from S and T) If it is not possible to merge any two strings, then print NO (because the final answer has any character appearing atmost once.) To merge any two strings, check the prefix and suffix from c's position in the two strings. - Finally, you have only disjoint strings remaining in the set S. Concatenate them lexicographically and do a final check for repeating characters.
•  » » » » 10 месяцев назад, # ^ |   0 suppose if the set is ab, ba then i can construct the string abba, in which all the substrings in the set occurs once and all occus exactly same amount of time. Also if it is kas and kad then kaskad is a good string right ?
•  » » » » » 10 месяцев назад, # ^ |   0 No..Because occurence of k is more than occurence of kas and kad.
•  » » » » 10 месяцев назад, # ^ |   0 Wonderful explanation !! Thanks a lot :)
 » 10 месяцев назад, # |   -8
 » 10 месяцев назад, # |   -9 Lagforces servers be like
 » 10 месяцев назад, # |   0 Я, конечно, все понимаю, но этот раунд просто обязан быть внерейтинговым
 » 10 месяцев назад, # |   +50 Let's run the system test, if i passed the D the round should be rated.
•  » » 10 месяцев назад, # ^ |   0 I wanna pass ABCD
 » 10 месяцев назад, # |   +8
•  » » 10 месяцев назад, # ^ |   +1 Situation of the last two contests in Codeforces
 » 10 месяцев назад, # |   0 Some of us have problem with the round being rated. Because if the server wasn't down, we could have submitted our code early. But as CF was down for approximately half an hour, we got huge penalties :( which will brutally decrease our rating. If we could submit codes just in time, our rating would not be this massacre. So please make the round unrated. :(
 » 10 месяцев назад, # |   +7 CF server trying return
 » 10 месяцев назад, # |   +1 Let's run the system test. For one I'd like to know if I messed up on div. 2 ABCD. For another, I really wanna upload my updated version for problem F just to see if I did it correctly lol Either rated or unrated, the system test shall run lol
 » 10 месяцев назад, # |   0 such garbage these last 2 contests were. hopefully this is going to be unrated
 » 10 месяцев назад, # | ← Rev. 2 →   0 I do not care if this contest is rated or unrated. I only wish discovery test case 4 for D.UPDATE: Got AC with this case.
•  » » 10 месяцев назад, # ^ |   0 Try: 2 ab ba
•  » » » 10 месяцев назад, # ^ |   0 omg. Thanks. sad ;/
 » 10 месяцев назад, # |   0 I don't know why but i cant see round #445 in the contest page. System Tests have still not started. Do they usually take this much time or are the setters trying to figure out whether to make the round rated or unrated and if rated then how
 » 10 месяцев назад, # |   0 Когда решил взломать 'A' :)
 » 10 месяцев назад, # |   0 How to solve DIV2 D ?
•  » » 10 месяцев назад, # ^ |   +3 Construct a directed forest as follows. Nodes are letters. If one letter right after another in one of the words, then there is an edge from the first letter to the second one. There must be as most one outgoing edge and one ingoing edge on every node, otherwise answer is NO.Tricky thing: some words have only one letter in it, one should care about that.Once you have a valid forest, just print the letters in the order given by the forest.
•  » » » 10 месяцев назад, # ^ | ← Rev. 2 →   0 Yeah, you also need to make sure there are no cycles; as an example, the answer for 2 ab ba is NOand the answer for1 aais also NO.
•  » » » » 10 месяцев назад, # ^ |   0 Indeed, I forgot to mention that as well.
 » 10 месяцев назад, # |   +40 Codeforces became one of the most searched today websites on websitedown.info!
 » 10 месяцев назад, # |   -10 it hurts when you expect a positive rating and the round ends being un-rated.
•  » » 10 месяцев назад, # ^ |   -11 i got a notif that its undated :( Please make it undated but not unrated ;_;On a more serious note, how to unregister my account? I don't wanna come here anymore...
•  » » » 10 месяцев назад, # ^ |   +2 Or you can just not visit the site, instead of unregistering the account altogether. As for receiving mails regarding contest announcements, you can just unsubscribe them. Is this idea that difficult to come up with?
•  » » » » 10 месяцев назад, # ^ |   0 Actually I had to make a choice : 1) write a lot of true and bad things about the situation, 2) show anger and protest subtly. Is this that difficult to see that yourself :)
 » 10 месяцев назад, # |   -10 Проверяйте систему перед контестом... Отношение к раунду не серьезное
•  » » 10 месяцев назад, # ^ |   0 Предотвратить такое практический не возможно. Ведь автор не виноват что Codeforces слетел.
 » 10 месяцев назад, # |   +88 My story on problem A: Thought one couldn't stay on one vertex twice. Got WA An announcement said something like "1->1->1 is invalid because of t_2 can't be equal to 1". Thought it meant "because you can't stay on one vertex twice". Never questioned my understanding, found that I couldn't pp, and gave up.
•  » » 10 месяцев назад, # ^ |   0 You could have seen in the explanation for example 1 they give 1 -> 1 -> 2 as a possible solution.
•  » » 10 месяцев назад, # ^ |   0 I misunderstood the statement and tried solving a slightly different problem-On visiting a vertex the second time, any integer between [last_visit_time, i) can be written on that vertex.
 » 10 месяцев назад, # |   +46 Rated round:Unrated round:
 » 10 месяцев назад, # |   0 Wut, noo, now I can't make round 446 :(
 » 10 месяцев назад, # | ← Rev. 2 →   +24 if(rank==good) cf="UNRATED"; else cf="RATED"; 
 » 10 месяцев назад, # |   +10 In Div1C I needed to calculate number of permutations p1, p2, ..., pn satisfying . On Oeis it said that this is equal to the number of permutations where all cycles have size less than or equal to K. I tried proving both these conditions are equivalent but found a Counter TestK=3,1 2 3 [10 6 9 7] 4 5 8 Does anyone know why these two set of permutations have equal size?
•  » » 10 месяцев назад, # ^ |   0 Think about it this way. For your condition tu hold, the value n must within the last K positions. And you can choose the following values in ways, where is length of the suffix starting in value n. Then you have to multiply by the number of good permutations of size . That is, . This is exactly the same as choosing a cycle for element n of size at most K, and then multiplying by the number of good permutations for the remaining elements.I'm not sure if I understood what you mean by counter test. It's true that the permutation you show should be counted as good for the problem statement, but it does not comply with the condition you mentioned.
 » 10 месяцев назад, # | ← Rev. 2 →   +12 although there where a lot of technical issues and despite that i spend more time reloading pages than the time i spend on reading problems, it was one of the greatest contests i ever participated in,thank you for your efforts it was totally worth it to participate even though it wasn't rated in the end.
 » 10 месяцев назад, # |   0 I have given up on the contest when there was more than an hour left and almost got to top 100. Suspicious.
 » 10 месяцев назад, # |   0 How many participants from this round will be chosen to the final?
 » 10 месяцев назад, # |   +15 Some Div.2 solutions using regular expressions (in Perl): A — 32278803, D — 32280926.