Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

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

Автор majk, 7 лет назад, перевод, По-русски

Всем привет!

В 20.07.2019 18:35 (Московское время) состоится Codeforces Global Round 4.

Это четвертый раунд из серии Codeforces Global Rounds, которая проводится при поддержке XTX Markets. В раундах могут участвовать все, рейтинг тоже будет пересчитан для всех.

У вас будет 150 минут на решение 8 задач. Разбалловка 500-750-1250-1750-2000-(1500+1500)+3250+4000.

Призы в этом раунде:

  • 30 лучших участников получат футболки.
  • 20 футболок будут разыграны случайным образом среди участников с 31-го по 500-е место.

Призы в серии из 6 раундов в 2019 году:

  • За каждый раунд лучшим 100 участникам начисляются баллы согласно таблице.
  • Итоговый результат участника равны сумме баллов для четырех лучших выступлений этого участника.
  • Лучшие 20 участников по итоговым результатам получают толстовки и сертификаты с указанием места.

Задачи раунда разработаны мной.

Я хочу поблагодарить:

UPD: Раунд закончен. Надеюсь, что вам задачи понравились! Прошу прощения за проблему с задачей Е.

UPD2: Разбор

UPD3: Поздравляем:

  1. ainta
  2. Radewoosh
  3. tzuyu_chou
  4. LHiC
  5. Benq

UPD4: Результаты после четырех раундов.

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

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

What about _kernel_? He has feelings too

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

And, of course, Accepted_ as a welcome guest of any contest

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

And, wish that wrong_answer stays away

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

Sounds great!But hope for no reading comprehension problems....

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

An old comment from the setter of the contest :)

For those who don't want to click
»
7 лет назад, скрыть # |
 
Проголосовать: нравится +20 Проголосовать: не нравится

Tourist is coming soon

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

Global Round = div1 + div2 + div3 = div6

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

8 problems and just 150 minutes is it enough????

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

Btw, did anyone notice that majk is setting a global round and a local round these days?

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

Although we are Chinese,we still try to join in every Global Round.

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

Global round 3 is good go for global round 4

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

Wish you a job promotion :-)

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

Thanks MikeMirzayanov also for updating and adding amazing features in CODEFORCES regularly.

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

No one is talking about Memory_Limit_Exceeded. That's sad

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

i hope that will be funny:)

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

I hope that the meaning of all the problems are easy to understand.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +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.

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

Hope this will not happen :3

kkkkk

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

have a good contes :)

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

i hope i become yellow after this

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

What about UKE,OLE,_Wrong_Answer_

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

hope i InvincibleMario one day

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

Did anyone notice 'alice' and 'bob' in the blog tags? Be ready for some good game theory problems.

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

majk come back with a contest after Good Bye 2018

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

Hope I will be either retired.coder.1 or WHITE2302 . I don't want to be grey anymore.

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

Why no one has made an account with a nickname "Idleness_limit_exceeded"? :c

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

How Global Round's rating distribution executes? Do Div1 and Div2 contestants get seperate rating? How likely Div2 contestants increase rating? Thanks!

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

TimeLimitExceed and timelimitexceeded will be sad if they shrink to TLE

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

I think TLE is abbreviation for --> tourist limit exceed please don't gimme negative feedback I am just joking

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

an AK-king EvenImage

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

Why arsijo again?

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

У вас тех полетел

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

Should I do it? I am new in programming.

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

Everything is gonna be Okay

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

madhav_1999 will become master today! — Prokhar

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

Could you please postpone the contest 15 minute later ?

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

And hopefully the round won't become Unrated.

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

Is there a page with current standings?

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

I hope that the contest will be good,funny and interesting like the announcement .

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

gl hf

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

i have to stay up late

i look like the panda in my photo

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

When this "prior to round" happen????? Only 15 minutes left......

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

speedforces strikes again again

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +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.

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

What happened just now? My rank changed from 900+ to 400+ and to 900+ again...

[Edit] Got it.

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

Спасибо за хороший раунд) Нет, он хороший не потому что у меня получилось решать задачи, потому что задачи были интересными) Побольше бы таких раундов

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

i am suffering subsequence string phobia.

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

" The round is still rated. " ?????? What the f**k ??????

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

How to solve G?

  • »
    »
    7 лет назад, скрыть # ^ |
    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.
»
7 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve E?

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +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.

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 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.

  • »
    »
    7 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 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).

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

How to solve E

»
7 лет назад, скрыть # |
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.

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

Good tasks, thanks)

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +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.

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

Not so many Pretest :(

»
7 лет назад, скрыть # |
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.

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

Thanks to Pretest XD

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

first four problems were not THAT hard as in previous contests

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

pretests too strong barely 10 hacks total

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +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.

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

I would like to thank:

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +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

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

no two consecutive characters are the same

FML, I solved E for general strings

UPD: got TLE

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +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

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +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.

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

Just look at this submission: 57419391

Brute force wins again!

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

Every time I finished the code dugging, the game had just ended. What a pity!

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

I only now noticed abs in G. Can't even read :(

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

What is the reason for the low constraint at problem D? It could be solved even with $$$10^6$$$ limit

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

In problem E, will there ever be a case where answer is IMPOSSIBLE?

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

    No.

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

I think some people just guested problem C after seing samples

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

Problem C has best samples ever

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

E has got three greedy tags and two string tags...

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +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 :(

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

ovvo

»
7 лет назад, скрыть # |
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?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +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.

  • »
    »
    7 лет назад, скрыть # ^ |
    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.

»
7 лет назад, скрыть # |
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

»
7 лет назад, скрыть # |
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.

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

majk:

Also majk:

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

When t-shirt winners will announced?

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

Thanks checker for good check.

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

MikeMirzayanov, это теги в задаче G. Наверное надо пофиксить.

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

what is wrong in this solution of problem E.

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

Can anyone prove this statement, for every n such that there is a prime between n and 3n/2?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +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
2 1178 2 Radewoosh
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 DearMargaret
15 1178 15 Swistakk
16 1178 16 DmitryGrigorev
17 1178 17 webmaster
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
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 tribute_to_Ukraine_2022
36 1178 35 sevenkplus
56 1178 56 Roundgod
76 1178 76 atoiz
110 1178 110 Ari
147 1178 147 tabasz
159 1178 159 asokol
169 1178 169 mohamad
174 1178 174 PinkRabbitAFO
184 1178 184 Anachor
189 1178 189 MarcotheFool
255 1178 255 Zayin
256 1178 256 rotavirus
284 1178 284 AlenAbeshov
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