### majk's blog

By majk, 3 months ago, ,

Hi!

On Jul/20/2019 18:35 (Moscow time) we will host Codeforces Global Round 4.

It is the fourth round of a new series of Codeforces Global Rounds supported by XTX Markets. The rounds are open for everybody, the rating will be updated for everybody.

You will be given 8 problems and 150 minutes to solve them. The scoring distribution will be 500-750-1250-1750-2000-(1500+1500)+3250+4000.

The prizes for this round:

• 30 best participants get a t-shirt.
• 20 t-shirts are randomly distributed among those with ranks between 31 and 500, inclusive.

The prizes for the 6-round series in 2019:

• In each round top-100 participants get points according to the table.
• The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest.
• The best 20 participants over the whole series get sweatshirts and place certificates.

The problems of this round were developed by me. I will be available on Discord to discuss the problems after the contest.

I would like to thank:

UPD: The round is finished. I hope you enjoyed the problems! I am very sorry about the issue on E.

UPD2: Editorial

UPD3: Congratulations to:

UPD4: The results after four rounds.

Announcement of Codeforces Global Round 4
Announcement of Codeforces Global Round 4

• +875

 » 3 months ago, # |   +293 What about Runtime_error_? He has feelings too
•  » » 3 months ago, # ^ |   +152 Runtime_error_ should be thanked for not participating in the contest
•  » » » 3 months ago, # ^ |   +15 RuntimeError will be sad if he isn't referred.
•  » » 3 months ago, # ^ |   +77
•  » » 3 months ago, # ^ |   +28 DoNtTellHimWhatToDo
•  » » 3 months ago, # ^ | ← Rev. 5 →   +30 Pretests_Passed, Hacked, SuccessfulHackingAttempt and FailedSystemTest can also hold sway the contest. And MemoryLimitExceeded, we should not forget. :)
•  » » » 3 months ago, # ^ | ← Rev. 2 →   +26 Thanks for 300iq, that we dont have.
 » 3 months ago, # |   +71 And, of course, Accepted_ as a welcome guest of any contest
•  » » 3 months ago, # ^ | ← Rev. 2 →   +61 Maybe should be Accepted?
 » 3 months ago, # |   +41 And, wish that wrong_answer stays away
•  » » 3 months ago, # ^ |   +39 That's _Wrong_Answer
•  » » » 3 months ago, # ^ |   +8 In fact, both of them.
•  » » » » 3 months ago, # ^ | ← Rev. 2 →   -26 I think I'll not be welcome ...
•  » » » » 3 months ago, # ^ |   +8 Add WrongAnswer to them..
 » 3 months ago, # |   +5 Sounds great!But hope for no reading comprehension problems....
 » 3 months ago, # |   +103 An old comment from the setter of the contest :) For those who don't want to clickDon't worry, red coders are able to set up contests with easy problems.flashback of my roundsOkay, some red coders.
•  » » 3 months ago, # ^ |   0 hope majk keeps his words of what he said earlier to me. hahah.
•  » » 3 months ago, # ^ |   +42 The one "for those who don't want to click" is good for me. I'm so lazy.
•  » » » 3 months ago, # ^ |   +18 You are as lazy as a lazy dynamic segment tree.
•  » » » » 3 months ago, # ^ |   +73 what up with your profile pic?
 » 3 months ago, # |   +21 Everyone keeps forgetting compile time error
•  » » 3 months ago, # ^ |   +273 Compile error on test 83 is my favourite verdict.
•  » » » 3 months ago, # ^ |   +13 Is that even possible???
•  » » » » 3 months ago, # ^ | ← Rev. 3 →   +103 Maybe if the testing is distributed among several judges ... constexpr const char * time = __TIME__; static_assert(time[6] != '0' || time[7] != '0'); int main() {} 
•  » » » » 3 months ago, # ^ |   +180 52856023 it failed compilation error on system test 44.
•  » » » 3 months ago, # ^ |   0 run time error at tc 107 is famous verdict of petr.
•  » » » 3 months ago, # ^ |   -8 WA on 168th test is better :D
•  » » » » 3 months ago, # ^ |   +1 solution skipped
•  » » » » » 3 months ago, # ^ |   0 ML
•  » » » 3 months ago, # ^ |   +53 Accepted on test 0
 » 3 months ago, # |   +20 Tourist is coming soon
•  » » 3 months ago, # ^ |   -21 tourist blesses me!
•  » » 3 months ago, # ^ |   0 seems like he will not come
 » 3 months ago, # |   -25 Global Round = div1 + div2 + div3 = div6
•  » » 3 months ago, # ^ |   +152 [Error] no match for 'operator+' (operand types are 'div.' and 'div.')
•  » » 3 months ago, # ^ |   +7 Global round = max(div1, div2, div3) = div1; for divisions we use max;
•  » » 3 months ago, # ^ |   +69 I think that div1 > div2 > div3. My estimation is that div1 + div2 + div3 = div0.9
•  » » 3 months ago, # ^ |   -191 Let's downvote Errichto to make his contribution lower than Radewoosh
•  » » » 3 months ago, # ^ |   +38 Let's downvote him to make his contribution lower than r_pi.
•  » » » » 3 months ago, # ^ |   -58 Why so many people don't like my comment
•  » » » 3 months ago, # ^ |   +37 Why would you want to make contribution of errichto less? I think his over all effort in helping the community is much higher than anyone else here.
 » 3 months ago, # |   0 8 problems and just 150 minutes is it enough????
•  » » 3 months ago, # ^ |   +12 Generally, educational rounds have 7 problems and 120 minutes of time. So comparatively it is enough.
•  » » » 3 months ago, # ^ |   +5 Are you compare the educational with global round ?? educational is for div2 and global round for all division
•  » » » » 3 months ago, # ^ | ← Rev. 3 →   +3 For div3 also... (you can check contest history)and for div1 users if you add 2-3 easy problems in contest, it doesn't change anything for them.Required time for contest depends more on difficulty level than number of questions.
•  » » » 3 months ago, # ^ | ← Rev. 4 →   +2 And also this round needs to test the abilities of people range from beginners to masters so it definitely needs to have enough time for all the people to solve the problems.
•  » » 3 months ago, # ^ |   +25 No, of course not. We need 300 minutes.
 » 3 months ago, # |   -27
 » 3 months ago, # |   +5 Btw, did anyone notice that majk is setting a global round and a local round these days?
 » 3 months ago, # |   -39 no MLE lel Seems TO BE COOOOOOOOOOOOOOOOOOL !!!
 » 3 months ago, # |   +21 Although we are Chinese,we still try to join in every Global Round.
•  » » 3 months ago, # ^ |   -18 But there isn't a "Codeforces Global Round 1" in your contest history.
•  » » » 3 months ago, # ^ |   +47 he didn’t say he did join, he just said he tries to join
•  » » 3 months ago, # ^ |   +23 Most rounds is a bit late for Chinese,hope the contest can be earlier,and we won't stay up late and feel sleepy the next day.
•  » » » 3 months ago, # ^ | ← Rev. 2 →   +14 I agree with your suggestion. I hope that in the future contests in Codeforces could start earlier, maybe 20:35 or 21:05 UTC+8 will work, so that we don't have to stay up very late and feel sleepy the next day.
•  » » » 3 months ago, # ^ |   -16 Most rounds are a bit early for people like me on the US west coast.
 » 3 months ago, # | ← Rev. 2 →   -13 So ,does the last line means ,i won't get TLE anyway?,thanks for that, tle sucks . Now i can freely code without worrying about time limit
 » 3 months ago, # |   +3
•  » » 3 months ago, # ^ |   0
•  » » » 3 months ago, # ^ |   +3 wrong_answer?NO!
•  » » » » 3 months ago, # ^ | ← Rev. 2 →   +14 hacked will be upset if none of you are talking about him.
•  » » » » » 3 months ago, # ^ |   +13 We need an account called RoundUnrated, the one noone wants to talk about
•  » » 3 months ago, # ^ |   +5 UPD?
•  » » 3 months ago, # ^ | ← Rev. 2 →   +6 so every body going to forget " system_test " ,because he is unrated ...(read last line of editorial. )
•  » » » 3 months ago, # ^ |   +8 Without your mention, I even didn't notice.
 » 3 months ago, # |   +10 Global round 3 is good go for global round 4
 » 3 months ago, # |   -6 Wish you a job promotion :-)
 » 3 months ago, # |   0 Thanks MikeMirzayanov also for updating and adding amazing features in CODEFORCES regularly.
 » 3 months ago, # |   +5 No one is talking about memory_limit_exceeded. That's sad
 » 3 months ago, # |   0 i hope that will be funny:)
 » 3 months ago, # |   +3 I hope that the meaning of all the problems are easy to understand.
•  » » 3 months ago, # ^ |   0 me too
•  » » 3 months ago, # ^ |   0 I Hope so too;)
 » 3 months ago, # |   -11 Feeling happy after seeing jeel_vaishnav in testers.
 » 3 months ago, # |   0 That types of Terms and Errors in the form of Codeforces profiles at the last was SO COOL man.
 » 3 months ago, # |   +130 It could be the last contest which is rated for Div.1, and the last big global round before IOI 2019 Azerbaijan. I hope everyone's good luck, as a participant of IOI 2019.
•  » » 3 months ago, # ^ |   -20 What is IOI brother?
•  » » » 3 months ago, # ^ |   -10 International olympiad in Informatics
•  » » » » 3 months ago, # ^ | ← Rev. 2 →   0 ok thanks.I will google it for more details.
•  » » » » » 3 months ago, # ^ |   +86 You will get a K-pop band
•  » » » » » » 3 months ago, # ^ |   +12 It's actually a K-pop group not a band.
•  » » » » » » » 3 months ago, # ^ |   +15 I have no experience in this subject, stefdasca would be better discussing this than me XD
•  » » » » 3 months ago, # ^ |   -11 zer miznh
•  » » 3 months ago, # ^ |   +8 Anybody prepare an IOI synchronized contest in Codeforces? That will be great.
•  » » 3 months ago, # ^ | ← Rev. 2 →   +26 I wish if there's something similar to this for the last rated round for Div1 before IOI2019.
 » 3 months ago, # |   +8 Hope this will not happen :3
•  » » 3 months ago, # ^ |   0 That's bad.
 » 3 months ago, # | ← Rev. 5 →   0 have a good contes :)
•  » » 3 months ago, # ^ |   0 like
•  » » 3 months ago, # ^ |   -36 What's the meaning of "contes"? I have never learnt a word called "contes".
 » 3 months ago, # |   -114 ████████████████████████████████████████████████████████████████████████████████████ ██████████████████████████████████████████████████████████████████████████████████████ ███████████████████████████▓▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓╬╬╬╬╬╬▓███████████████████████ ███████████████████████████▓███████▓▓╬╬╬╬╬╬╬╬╬╬╬╬▓███▓▓▓▓█▓╬╬╬▓███████████████████████ ███████████████████████████████▓█████▓▓╬╬╬╬╬╬╬╬▓███▓╬╬╬╬╬╬╬▓╬╬▓███████████████████████ ████████████████████████████▓▓▓▓╬╬▓█████╬╬╬╬╬╬███▓╬╬╬╬╬╬╬╬╬╬╬╬╬███████████████████████ ███████████████████████████▓▓▓▓╬╬╬╬╬╬▓██╬╬╬╬╬╬▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓███████████████████████ ████████████████████████████▓▓▓╬╬╬╬╬╬╬▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓███████████████████████ ███████████████████████████▓█▓███████▓▓███▓╬╬╬╬╬╬▓███████▓╬╬╬╬▓███████████████████████ ████████████████████████████████████████▓█▓╬╬╬╬╬▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬███████████████████████ ███████████████████████████▓▓▓▓▓▓▓╬╬▓▓▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓███████████████████████ ████████████████████████████▓▓▓╬╬╬╬▓▓▓▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓███████████████████████ ███████████████████████████▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓███████████████████████ █████████████████████████████▓▓▓▓▓▓▓▓█▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓███████████████████████ █████████████████████████████▓▓▓▓▓▓▓██▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████████████████████ █████████████████████████████▓▓▓▓▓████▓▓▓█▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████████████████████ ████████████████████████████▓█▓▓▓▓██▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████████████████████ ████████████████████████████▓▓███▓▓▓▓▓▓▓██▓╬╬╬╬╬╬╬╬╬╬╬╬█▓╬▓╬╬▓████████████████████████ █████████████████████████████▓███▓▓▓▓▓▓▓▓████▓▓╬╬╬╬╬╬╬█▓╬╬╬╬╬▓████████████████████████ █████████████████████████████▓▓█▓███▓▓▓████╬▓█▓▓╬╬╬▓▓█▓╬╬╬╬╬╬█████████████████████████ ██████████████████████████████▓██▓███████▓╬╬╬▓▓╬▓▓██▓╬╬╬╬╬╬╬▓█████████████████████████ ███████████████████████████████▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬██████████████████████████ ███████████████████████████████▓▓██▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓██████████████████████████ ████████████████████████████████▓▓▓█████▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓███████████████████████████ █████████████████████████████████▓▓▓█▓▓▓▓▓███▓╬╬╬╬╬╬╬╬╬╬╬▓████████████████████████████ ██████████████████████████████████▓▓▓█▓▓▓╬▓██╬╬╬╬╬╬╬╬╬╬╬▓█████████████████████████████ ███████████████████████████████████▓▓█▓▓▓▓███▓╬╬╬╬╬╬╬╬╬▓██████████████████████████████ ██████████████████████████████████████▓▓▓███▓▓╬╬╬╬╬╬╬╬████████████████████████████████ ███████████████████████████████████████▓▓▓██▓▓╬╬╬╬╬╬▓█████████████████████████████████ ██████████████████████████████████████████████████████████████████████████████████████ ██***********************************Reza*****************************************██ ██████████████████████████████████████████████████████████████████████████████████████
 » 3 months ago, # |   -23 i hope i become yellow after this
 » 3 months ago, # |   +21 hope i will_reach_red one day
 » 3 months ago, # |   +18 Did anyone notice 'alice' and 'bob' in the blog tags? Be ready for some good game theory problems.
•  » » 3 months ago, # ^ | ← Rev. 2 →   +64 :3 Meanwhile, the problem will be like: ***Alice and Bob are walking on a 2d coordinate system...... [Hard Geometry]
•  » » » 3 months ago, # ^ |   +46 They start the game by drawing convex polygon in which the area of it doesn't exceed X squared units and is at least Y squared units, if a player can't draw a convex polygon without crossing an already drawn convex he loses, determine the winning player if both played optimally.
•  » » » » 3 months ago, # ^ | ← Rev. 3 →   +65 This problem is really easy. Solution: SolutionIf the original arena is less than Y, the 2nd player wins. Otherwise the 1st player wins. Just draw a rectangle (or any symmetrical shape) in the middle of the board. One side must be as long as the side of the coordinate system (so it split the coordinate system in 2 sides). The other side can be as low as required. Now the coordinate system is split to 2 equal sides, so the first player just need to copy the second players move ...
•  » » » » » 3 months ago, # ^ |   +8 Interesting, someone could make various problems by tweaking its details.
•  » » » » » » 3 months ago, # ^ |   0 By the way, Alice and Bob love graphs more than 2D plane xD
 » 3 months ago, # | ← Rev. 4 →   0 majk come back with a contest after Good Bye 2018
 » 3 months ago, # |   0 Hope I will be either green-coder or white2302 . I don't want to be grey anymore.
 » 3 months ago, # |   0 Why no one has made an account with a nickname "Idleness_limit_exceeded"? :c
•  » » 3 months ago, # ^ |   0 maybe the contest doesnt have interactive problems xd
 » 3 months ago, # |   +6 How Global Round's rating distribution executes? Do Div1 and Div2 contestants get seperate rating? How likely Div2 contestants increase rating? Thanks!
 » 3 months ago, # | ← Rev. 4 →   +18 TimeLimitExceed and TimeLimitExceeded will be sad if they shrink to TLE
 » 3 months ago, # |   +52 I think TLE is abbreviation for --> tourist limit exceed please don't gimme negative feedback I am just joking
•  » » 3 months ago, # ^ |   +48 And MLE is for majk limit exceed (only joking :D)
 » 3 months ago, # |   +8 an AK-king wxhtxdy
 » 3 months ago, # |   -51 Why arsijo again?
•  » » 3 months ago, # ^ |   +12 why not ? because of just one mistake he did before ? i'm afraid for you ;
 » 3 months ago, # |   0 Should I do it? I am new in programming.
•  » » 3 months ago, # ^ | ← Rev. 3 →   -20 [DELETED]
•  » » » 3 months ago, # ^ |   +1 Why would you post this?
•  » » » » 3 months ago, # ^ |   +5 Maybe because Round #575 will be a div3 round? They just come off as rude though.
•  » » 3 months ago, # ^ |   -8 you can do some contests generally -- pratice more. There're so many basic problems for newbies, such as Div2A/B
 » 3 months ago, # |   +2 Everything is gonna be Okay
 » 3 months ago, # | ← Rev. 3 →   +31 madhav_1999 will become master today! — Prokhar
•  » » 3 months ago, # ^ |   +19 yashvardhan29 will become Foobar Elite today!
 » 3 months ago, # |   -28 Could you please postpone the contest 15 minute later ?
 » 3 months ago, # |   +4 And hopefully the round won't become Unrated.
 » 3 months ago, # |   +22 Is there a page with current standings?
 » 3 months ago, # | ← Rev. 2 →   +1 I hope that the contest will be good,funny and interesting like the announcement .
 » 3 months ago, # |   0 gl hf
 » 3 months ago, # |   +5 i have to stay up latei look like the panda in my photo
 » 3 months ago, # |   +3 When this "prior to round" happen????? Only 15 minutes left......
•  » » 3 months ago, # ^ |   +2 Added now.
 » 3 months ago, # |   -10 speedforces strikes again again
•  » » 3 months ago, # ^ |   +110 Now that the round is over, I feel I should comment on that. We considered both D and E to be tricky problems, even some very good testers had problems with them. Perhaps C and D turned out to be a bit easier that anticipaded.F on the other hand, was a different beast. I originally proposed a completely different problem — with in my opinion a cute observation. However, it was geometry and testers almost went on a riot because of the implementation difficulty. About $10$ days before the contest I came up with the problem that is now $F1$, but the testers saw it as too easy, even easier than D or E — and the gap between $F$ and $G$ was afwul.So I realised then that we can increase $m$ and it adds to the problem. Suddenly, it was too difficult and it was the gap between E and F that was brutal. With the contest fast approaching and the tester's ranks dwindling, we realised that the safest way to mitigate was to split F. Some small gap still remained though, but I'd say that the ratio of ACs on adjacent problems around $4$ is fine (after all, it has to reduce from couple thousand to only a few in around $6$ problems). Please try to understand that it is sometimes quite difficult to judge the difficulty based on a small sample of testers. Additionally, if you find out two days before contest it is going to be speedforces, the best solution is typically to keep it that way rather than to perform some ninja fixes.
 » 3 months ago, # | ← Rev. 2 →   0 What happened just now? My rank changed from 900+ to 400+ and to 900+ again... Got it.
•  » » 3 months ago, # ^ |   -22 arsijo curse
 » 3 months ago, # |   +35 i am suffering subsequence string phobia.
 » 3 months ago, # |   +5 " The round is still rated. " ?????? What the f**k ??????
•  » » 3 months ago, # ^ |   +34 My friend locked his problem E but he can't change his code after rejudged and already lost his rating
•  » » » 3 months ago, # ^ |   +42 You seem to care a lot about your friend! I think HE can ask organizers to make it unrated just for him.
•  » » 3 months ago, # ^ |   +5 Why unrated after rejudged? I can't understand.
•  » » 3 months ago, # ^ |   -23 The round is always UNRATED or at the edge of UNRATED if arsijo is the coordinator.
 » 3 months ago, # |   +15 How to solve G?
•  » » 3 months ago, # ^ | ← Rev. 3 →   +18 Actually, I didn't get pretest passed in this problem, but I have an idea. Solution 1 You can replace the problem to a new problem as follows by using euler tour method: Initially, there is an array $a =${$a_1, a_2, ..., a_N$} and $b =${$b_1, b_2, ..., b_N$}. Query type 1: Add $a_l$, $a_{l+1}$, $a_{l+2}$, ..., $a{r}$ by $x$. Query type 2: Get the maximum value among {$|a_l| * |b_l|, |a_{l+1} * b_{l+1}|, ..., |a_r * b_r|$}. To solve this new problem, you can use sqrt decomposition by query. Let's think about to solve from query $1$ to $B$ with $O(N + B^2 log B)$ complexity. You can divide at most $2 * B + 2$ subsegments, that the value of $a_i$ that increased in add query is the same in subsegment. Add query: Just add $x$ in proper subsegments. Complexity $O(B)$ for each query. Get-maximum query: Use Convex-Hull Trick and binary search. The convex-hull can calculate with precount. Complexity: $O(N)$ for precount, $O(B log B)$ for each query. Since you should process $B$ queries, The total complexity that takes to calculate all answer in query [$1, B$] is $O(N + B^{2}logB)$. So, how to solve in not only query $[1, B]$, but also $[B + 1, 2B]$, $[2B + 1, 3B]$, $[3B + 1, 4B]$, and so on? You can find the value of $a_i$ when query $B, 2B, 3B, 4B, ...,$ has just finished, by using cumulative sum method. Since the value of $b_i$ does not change, you can also solve in query $[B + 1, 2B]$ and so on, as same as query $[1, B]$. If the backet size $B$ is nearly $\frac{B^{0.5}}{log_{2}B}$, the total complexity will be $O(B^{1.5} * sqrt(log_{2}B))$. Solution 2 Since the constraints is $n \leq 200,000$, $q \leq 100,000$ and the time limit is 5sec, since the process is very light, I think that even straight-forward brute force $O(NQ)$ which is very very very very fast may pass.
•  » » » 3 months ago, # ^ |   +5 Solution 2: https://codeforces.com/contest/1178/submission/57419391. He did again?
 » 3 months ago, # |   0 How to solve E?
•  » » 3 months ago, # ^ |   +25 If you consider two first and two last characters of the string, you are able to find one in first two and one in last two that match. Add them to your palindrome.
•  » » 3 months ago, # ^ |   0 Hint: Since no two characters are adjacent, and there are only 3 characters in the alphabet, there exists a character in the first two characters of the string that equals a character in the last two characters of the string.
•  » » 3 months ago, # ^ |   0 Since no consecutive letters are the same, you can make any even-length palindrome into a longer odd-length palindrome. So let's fix the middle of the palindrome, how about s[n/2]. Then you can show that from the midpoint, you never have to go more than two spaces to the left, or two spaces to the right to find two letters that are the same.So at worst, it will take 4 spaces to add 2 letters to your palindrome.Be careful of n=4 case (may need to try other midpoint).
 » 3 months ago, # |   0 How to solve E
 » 3 months ago, # | ← Rev. 4 →   +65 E's solution is cute, although the problem is a little contrived.EDIT: The key is pigeonhole principle. Take the last two and first two letters, there must be two letters that are equal (and not adjacent, since no two adjacent are the same). Take these two and recurse. If there are fewer than four characters, just take any one.
•  » » 3 months ago, # ^ |   0 Can you share your cute solution :)
•  » » 3 months ago, # ^ |   0 really kyot solutioni overcomplicated the problem :\
•  » » 3 months ago, # ^ |   +31 Am I the only one to try solving problem without that "no repeated letters" thing for 15-20 minutes before realizing that problem is totally different?
•  » » » 3 months ago, # ^ |   0 Just scroll down, I solved it without knowing that.
•  » » » » 3 months ago, # ^ |   0 How? And can you prove your solution?
•  » » » » » 3 months ago, # ^ |   +7 I can't prove it, but it makes sense.My solution optimizes the $O(N^2)$ dp solution using next and before arrays and limiting the search on the first point the answer reaches the needed length.
 » 3 months ago, # |   0 Good tasks, thanks)
 » 3 months ago, # |   +19 My girl friend is beautiful, smart, kind, rich, humourous and never blame anything on me!I consider her a perfect girl friend.Unfortunately, I discover that SHE is actually a man. That's my point on the checker of the problem E.
•  » » 3 months ago, # ^ |   +52 Does that make me gay? Oh, man :(
•  » » 3 months ago, # ^ |   +5 you guy are so funny, hahaha
 » 3 months ago, # |   +23 Not so many Pretest :(
•  » » 3 months ago, # ^ |   0 How do you see this? Is it a browser extension?
•  » » » 3 months ago, # ^ |   0 m2.codeforces.com
•  » » » 3 months ago, # ^ |   0 No. Just using http://m2.codeforces.com/ :)
•  » » » » 3 months ago, # ^ |   0 Good to know, thanks :)
•  » » 3 months ago, # ^ |   0 But they are strong! :)
 » 3 months ago, # | ← Rev. 3 →   +82 We had an issue with the problem E. The rejudge changed ~10 AC submission to WA in pretests. Since only ~10 people were involved in this issue, we do not see a reason to make this round unrated. If you have another opinion, you are welcome to share it.
•  » » 3 months ago, # ^ |   +216 You can make the contest unrated for these 10 participants.
•  » » 3 months ago, # ^ | ← Rev. 2 →   +13 Well, After 1.5 hour I noticed that my ac submission has wa. It's kinda unfair.
 » 3 months ago, # |   +28 Thanks to Pretest XD
•  » » 3 months ago, # ^ |   0 I saw you hacked A. Can you tell me please what was the hack for it ?
•  » » » 3 months ago, # ^ | ← Rev. 3 →   0 3 20 10 15 following solution can be hacked with this test: (https://codeforces.com/contest/1178/submission/57392107)
•  » » » 3 months ago, # ^ |   0 5 5 3 3 3 1 That would have hacked me because I misread the problem and thought that you can capture the 1 to have a total coalition size of 6, which would enable you to capture the 3s.
•  » » » » 3 months ago, # ^ |   +5 Many people misread problem A. ;_;
 » 3 months ago, # |   +8 first four problems were not THAT hard as in previous contests
 » 3 months ago, # |   0 pretests too strong barely 10 hacks total
 » 3 months ago, # |   +175 Oh, nice problem G, I've seen very similar things only a million times and it always ensured me at least one hour of fun coding and debugging, so happy to be given another chance.
•  » » 3 months ago, # ^ | ← Rev. 2 →   -10 Isn't problem F nice as well? Or I guess all the fun with it was too short for you to feel the excitement?
 » 3 months ago, # | ← Rev. 2 →   +13 I would like to thank: Greedy and constructive_algorithms for filling the problemset.
 » 3 months ago, # |   0 Hard div.2(A) problem ever:)
 » 3 months ago, # |   +3 In Problem A, for testcase: 2 6 2 shouldn't the answer be 1 1 as the question mentions "If Alice's party has enough people to create a coalition on her own, she can invite no parties." i got an "unsuccessful hacking verdict" defender's output was: 2 1 2
•  » » 3 months ago, # ^ |   +10 2 1 2 is also correct. You don't have to minimize number of parties.
•  » » » 3 months ago, # ^ |   0 Yes but as i said the question mentions "If Alice's party has enough people to create a coalition on her own, she can invite no parties."
•  » » » » 3 months ago, # ^ | ← Rev. 2 →   +20 "She can invite no parties", not "she cannot invite parties".
•  » » » » » 3 months ago, # ^ |   +10 To be fair, I understand the confusion now. English is ambiguous sometimes.
•  » » » » » 3 months ago, # ^ |   +8 oh damn. need to take english lessons now...
•  » » 3 months ago, # ^ |   0 I feel that mate. I got that twice
•  » » 3 months ago, # ^ |   0 Both outputs are correct. Multiple solutions possible.
•  » » 3 months ago, # ^ |   0 That's a good point, my solution also gives "2 1 2" but it passed system test... Maybe the intended meaning of "she can invite no parties" is "it is allowed that she doesn't invite any parties".
 » 3 months ago, # | ← Rev. 2 →   +8 no two consecutive characters are the same FML, I solved E for general stringsUPD: got TLE
•  » » 3 months ago, # ^ |   +3 Take this one: aabbcc
•  » » » 3 months ago, # ^ |   0 Answer is IMPOSSIBLE
•  » » » » 3 months ago, # ^ |   0 Fine... I forgot this impossible thing.
•  » » 3 months ago, # ^ |   0 please enlighten us with the solution!
•  » » » 3 months ago, # ^ |   0 I explained it here.
•  » » » » 3 months ago, # ^ |   +3 The link seems to be not correct.
 » 3 months ago, # |   +6 Just little FYI from a noob coder if anyone doesn't know already..."str = str + xyz" takes waayyyyyy too much time compared to "str.push_back(xyz)"... got to learn that the hard way today :(Well at least learned something :D
•  » » 3 months ago, # ^ |   +22 You can also do the following: str += xyzstr += something in strings is much faster than str = str + something for C++
•  » » » 3 months ago, # ^ |   +9 Well, += just adds to the end of the string (I assume that it just push_backs), while str = str + xyz has to copy the whole string, then append, and then save that value in the original variable.
•  » » » 3 months ago, # ^ |   0 Thanks! Noted.
•  » » 3 months ago, # ^ |   +19 Another noob coder here... took me three TLEs to realize the thing.
 » 3 months ago, # |   +2 Imo score distribution wasn't good enough (maybe it's just for me). I spent 1:30 for B, 0:15 for C and 0:30 for D.
 » 3 months ago, # |   +30 Just look at this submission: 57419391Brute force wins again!
•  » » 3 months ago, # ^ |   +60 It should fail on systests. The time is about 7s in the worst case.
•  » » » 3 months ago, # ^ |   +26 But it passed! You actually win!
•  » » » » 3 months ago, # ^ |   0 Long live brute force! (doge
•  » » » » 3 months ago, # ^ |   +55 The systests were too weak. Now it's hacked.
•  » » » » » 3 months ago, # ^ |   +36 Was it hacked before the end of the contest? Because my understanding was that uphacking doesn't change official standings
•  » » » » » » 3 months ago, # ^ |   +18 No. Although the standings changed, maybe the original standings which is used for rating calculation will not change.
•  » » » » » » » 3 months ago, # ^ |   +41
•  » » » » » » » » 3 months ago, # ^ |   +22
•  » » » 3 months ago, # ^ |   +13 It passed!
•  » » » 3 months ago, # ^ |   +59 They should hire you as a tester.
 » 3 months ago, # |   +8 Every time I finished the code dugging, the game had just ended. What a pity！
•  » » 3 months ago, # ^ |   0 I hope that I will find the bug more quickly next time.
•  » » » 3 months ago, # ^ |   +28 You can optimize your wish by hoping to not make a bug next time
 » 3 months ago, # |   0 I only now noticed abs in G. Can't even read :(
 » 3 months ago, # |   -11 What is the reason for the low constraint at problem D? It could be solved even with $10^6$ limit
•  » » 3 months ago, # ^ |   +40 That would be a huge spoiler to the solution (what number of edges can be linear to the number of vertexes).
•  » » » 3 months ago, # ^ |   +33 Exactly. Also, the time complexity wasn't supposed to be critical in this problem.
•  » » 3 months ago, # ^ |   +18 I guess the $10^3$ is for people to easily test if their solution is correct in $O(n^2)$ time, coz it's not easy to prove that it works.
•  » » 3 months ago, # ^ |   +87 How can I output my graph with $10^{12}$ edges in that case?
•  » » » 3 months ago, # ^ |   +8 Nohow? You'll get TLE in that case. And it's your problem, not autors
•  » » » 3 months ago, # ^ |   +17 fast io
•  » » » » 3 months ago, # ^ |   +3 maybe super fast io
•  » » » 3 months ago, # ^ |   +66 You should try bitsets, I heard they're pretty fast
•  » » 3 months ago, # ^ |   +7 So that users like me can go wrong , and find primes( degrees) using Goldbach conj. and stuck there.
 » 3 months ago, # |   0 In problem E, will there ever be a case where answer is IMPOSSIBLE?
•  » » 3 months ago, # ^ |   +4 No.
•  » » 3 months ago, # ^ |   +3 SpoilerNo, you will always be able to generate a subsequence. Since if you try to find a character from the first two characters and last two characters of the string and reduce the string to str[2:-2] everytime, you will see that you have to choose one character which is equal in 4 characters (two from the beginning and two from the end).Since there are only 3 possible characters such that no two of them are consecutive and 4 possible places to choose from, there will always be a character which you can include two times from a group of 4 characters. Hence you will always be able to make the string.
 » 3 months ago, # |   +19 I think some people just guested problem C after seing samples
•  » » 3 months ago, # ^ |   +7 Right. No idea why it's true xd.
•  » » » 3 months ago, # ^ |   +3 Call the vertical segment white if it's white from the left/black from the right. Note that if segment is white then all others in the same row also white. Same for horizontal
•  » » » 3 months ago, # ^ |   +1 4 choices for top-left square. Two choices for the rest along the top and the left. Only 1 choice for the remaining squares. i.e. if you choose the top row and the left column every other square is forced to be a single orientation.
 » 3 months ago, # |   +28 Problem C has best samples ever
•  » » 3 months ago, # ^ |   +30 It would have been better if only one test case w=2 and h=2 was given. Then most of them who solved it just by test case would have to think of proof(including me lol).
 » 3 months ago, # |   +3 E has got three greedy tags and two string tags...
 » 3 months ago, # |   +82 It it just me, or prob.A's statement is TOO HARD to read? (you can check my submissions)I'm not familiar with the Parliamentary System in some western countries :(
 » 3 months ago, # |   +1 ovvo
 » 3 months ago, # |   0 sourabh54singh pls tell the solution
 » 3 months ago, # | ← Rev. 2 →   +19 In D, If n is prime, then the answer is a circular graph. Otherwise, create a circular graph at first and then create extra edges by connecting nodes with degree 2 to make the number of edges a prime number.Is this the only solution?
 » 3 months ago, # |   +18 Problem G can be solved using sqrt decomposition. In the contest I chose a bad block size and didn't get AC. I'm so done right now.
•  » » 3 months ago, # ^ | ← Rev. 3 →   +10 Using dfs order we can turn G in to the following range query problems:Given 2n number a[1], a[2], a[3], ..., a[n] and b[1], b[2], b[3], ..., b[n]. You have to query max(abs(a[i])*b[i]) for some l<=i<=r and add a positive number x to a[l], a[l+1], ..., a[r]. Note that b[i] is set from the begining.Now for each i from 1 to n, let w[i] be the sum of x added to a[i], then you have a graph of at most 2 lines representing the value of abs(a[i]+w[i])*b[i]. To get the answer for some query, just get max of all (a[i]+w[i])*b[i].To update and query fast, split the array in to blocks of size S. For each block you can represent the lines using a Lichao tree or using CHT. I "upsolved" using CHT, but maybe Lichao tree will work as well. For each update query, simply update all the elements from the left most and right most block, and rebuild the two blocks, for all the blocks in between, keep an array w[] to know the elements in the blocks have been added by how much, this take O(Slog(S)+N/S). For each get query, you can just do the same, get the elements from left most and right most block, query each of the inbetween block in O(log(S)), so this take O(S+N/S*log(S)). Also this approach can be used even if you want to add negative number to a[].Honestly I didn't think this would pass, and I hoped that it gets TLE. But it works, and I chose the wrong S, so I got TLE in the contest. This disappointed me very much on top of the also very dumb mistake I got in F2. Still the problems are very good. Codeforces rules are very punishing, so something like this is to be expected.
•  » » » 3 months ago, # ^ |   0 For anyone interested in implementing this approach, S=100, 200, 300, even 400 will get AC. Just don't be bad like me and use 500 or something.
•  » » » » 3 months ago, # ^ |   +1 Yeah, that sucks. I tried hard to cut the solutions with extra log factor — we had two such solutions and they all needed around 8 seconds on some cases.On the other side of the road, there was Java that also needed to pass.
•  » » » » 3 months ago, # ^ |   0 Needs more coke spilling
 » 3 months ago, # | ← Rev. 2 →   -41 I was able to complete 4 questions in this challenge. I usually use ideone for compilation of my code . My code was copied by newbi/57387826, sos_123/57387881 . I was removed from this contest.This is quite unfair and strict actions should be taken against these contestants
•  » » 3 months ago, # ^ |   0 How did they copy your code?
•  » » » 3 months ago, # ^ |   -13 I was using ideone an online compiler . The code was copied from there
•  » » 3 months ago, # ^ | ← Rev. 2 →   +22 As stated in codeforces rules about third party code unintentional leakage is also a violation so be careful next time.
•  » » » 3 months ago, # ^ |   -21 Is there no way complain or some action can be taken against these guys.
•  » » 3 months ago, # ^ |   0 I checked the submissions you mentioned. Both of them submitted the code before you.
•  » » » 3 months ago, # ^ |   -6 I didn't register for the competition so I had a late penality of 10 minutes . I had compiled it way before submitting it . You can look in both of their profiles lots of there submissions are skipped .
•  » » » » 3 months ago, # ^ |   0 Yes, I have seen it. Their all solutions are skipped in all contests.
 » 3 months ago, # | ← Rev. 2 →   +68 Could anyone explain why my submissions still at Pretest Passed? I solved 3 problems but my rating has been counted as 0 problems.
 » 3 months ago, # |   +80 majk:Also majk:
•  » » 3 months ago, # ^ | ← Rev. 2 →   +29 Well ...
 » 3 months ago, # |   +26 When t-shirt winners will announced?
•  » » 3 months ago, # ^ |   +23 We are still investigating the issue. We will post the winners after we get the official results of the round.
 » 3 months ago, # |   -8 Thanks checker for good check.
 » 3 months ago, # | ← Rev. 4 →   -7 what is wrong in this solution of problem E.
 » 3 months ago, # |   0 Can anyone prove this statement, for every n such that there is a prime between n and 3n/2?
•  » » 3 months ago, # ^ |   0 https://en.m.wikipedia.org/wiki/Bertrand%27s_postulate — Here in "Generalisations" you can find statement that there exists a prime between 2n and 3n. There is also link to proof: http://www.m-hikari.com/ijcms-password/ijcms-password13-16-2006/elbachraouiIJCMS13-16-2006.pdf
•  » » » 3 months ago, # ^ |   0 thanks!!
»
3 months ago, # |
+100

T-shirt winners!

We used these files to find the winners.

randgen.cpp
get_ranklist.py
List place Contest Rank Name
1 1178 1 ainta
3 1178 3 tzuyu_chou
4 1178 4 LHiC
5 1178 5 Benq
6 1178 6 Reyna
7 1178 7 maroonrk
8 1178 8 nhho
9 1178 9 mnbvmar
10 1178 10 yfzcsc
11 1178 11 isaf27
12 1178 12 MrDindows
13 1178 13 scott_wu
14 1178 14 Vn_nV
15 1178 15 Swistakk
16 1178 16 DmitryGrigorev
17 1178 17 stO
18 1178 18 gepardo
19 1178 19 E869120
20 1178 20 dreamoon_love_AA
21 1178 21 Marcin_smu
22 1178 22 krijgertje
23 1178 23 Egor
24 1178 24 Elegia.Inferno
25 1178 25 amethyst0
26 1178 26 kmjp
27 1178 26 G.Z.V.O.D.E.N
28 1178 28 aid
29 1178 29 dlalswp25
30 1178 30 oxytocyna
36 1178 35 sevenkplus
56 1178 56 Roundgod
76 1178 76 atoiz
110 1178 110 juckter
147 1178 147 tabasz
159 1178 159 asokol
174 1178 174 PinkRabbit
184 1178 184 Anachor
189 1178 189 MarcotheFool
255 1178 255 Zayin
256 1178 256 sorry_marymarine
284 1178 284 I_love_Tima
313 1178 313 Ferume
314 1178 314 Mikaeel
377 1178 377 3.14roca
401 1178 401 mghzs1997
403 1178 403 Kerim.K
449 1178 449 MonkeyKing
472 1178 471 ivanilos
 » 3 months ago, # |   0
•  » » 3 months ago, # ^ |   +18
•  » » 3 months ago, # ^ |   +5
•  » » » 3 months ago, # ^ |   +5
 » 3 months ago, # |   +10