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

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

Hi!

On May/02/2021 17:35 (Moscow time), we will host Codeforces Global Round 14.

This is the second round of the 2021 series of Codeforces Global Rounds. The rounds are open and rated for everybody.

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 2021:

  • 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 all series get sweatshirts and place certificates.

Thanks to XTX, which in 2021 supported the global rounds initiative!

All problems were written and prepared by me FieryPhoenix and dragonslayerintraining.

Huge thank you to everyone who made this round possible:

You will have 3 hours to solve 9 problems. Scientific studies have shown irrefutable evidence that upvoting this blog and participating in this round will lead to longevity and happiness. GLHF!

UPD: The scoring distribution is 500 — 1000 — 1500 — 2000 — 2750 — 3250 — 3500 — 4250 — 5000

UPD: Editorial is here!

UPD: Congratulations to the winners!!

  1. Radewoosh
  2. ksun48
  3. Um_nik
  4. Benq
  5. yhx-12243
  6. tourist
  7. duality
  8. jiangly
  9. LJC00118
  10. NotaMotuaQAQ
  • Проголосовать: нравится
  • +1595
  • Проголосовать: не нравится

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

Is it rated?

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

For anyone wondering what GLHF (in the last line) means — Good Luck, Have Fun!

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

ugh i cant make good meme : (

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

PurpleCrayon orz!

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

Scientific studies have shown Global Round are usually hard, but I will participate for longevity and happiness.

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

As I tester of this round people are giving me downvotes.

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

As a tester, there's a reason this round is a Global Round (cf's flagship contest). The statements are natural and concise, the problems are elegant, and I hope you have a great round!

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

sto PurpleCrayon orz

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

Relatable >_<
original meme

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

Can we expect to have subtask?

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

omg, a round prepared by the Americans with Chinese names

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

Global Rounds always provides a very good opportunity to boost up your rating... Excited!!!!

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

As a tester, unfortunately, I don't have any witty joke to write in this message.

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

Can't we participate from m1.codeforces.com or m2 or m3? I couldn't find this contest on any of these versions of codeforces.

UPD: Its added. Thanks.

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

Nice

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

Omg 5000 points for a problem. Focus on the last problem, problem I with 5000 points, that's enough. :D

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

Contest time is really bad

Why aren't contests more late or earlier (for example 15:35 or 21:35)

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

Are the two contest authors related?

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

What is ORZ, I've seen it in many comments.

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

Me, a football lover coder today

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

This round has extremely strong pretests.

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

First contest in isolation! I hope I have the energy to compete. #COVID_coders

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

Scientific studies have shown irrefutable evidence that upvoting this blog and participating in this round will lead to longevity and happiness

1000 people : wow we will upvote!

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

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

PurpleCrayon orz!!!!!!

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

wer retin chains ?

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

Is it only me who can't do anything for 1 hour before the contest and keep switching between different tabs until it starts?

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

There is a long queue, about 4 pages show only "running". Would that affect the round?

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

My first Global Round,nervous.

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

My rating after this global round going down like Wheeeeeeeeee

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

I upvoted the blog and participated. I guess the scientific studies and their evidences for longevity and happiness are wrong :(

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

I wonder if D is that easy felt like a normal C

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

D is not even close to 2000 score

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

lol, how to do well in global round? Weirdly I perform badly whenever I participate in global round(somewhat not bad in other Div. 1 + Div. 2 round).

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

Once again C was much tougher than D to me

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

How to solve E? I can only come up with $$$O(n^4)$$$ $$$dp[i][j] =$$$ ways to turn on $$$i$$$ computers with $$$j$$$ operations used

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

    And it can pass the pretest.

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

    Note that there cannot be more than one consecutive light that turns on automatically. So, our final answer will have some segments of $$$1$$$'s (lights that are turned on manually) separated by exactly one $$$0$$$ (lights that are turned on automatically). We need to find the number of ways to make such an arrangement.

    Let's take this one step at a time.

    In how many ways can we turn all the lights on manually?

    You can only choose one starting light in a segment of n lights, then at each step you can either go left or go right. For better visualisation, consider n points coloured red. Pick a starting point and colour it blue. In each step, you can move from a blue point to an adjacent red point.

    Number of ways to do this = $$$(L + R)! / (L! * R!)$$$ , where L is the number of steps to the left of the starting point that one can take, and similarly, R is to the right.

    To meet the constraints, we will be precomputing these answers till $$$n$$$.

    Now, coming to the main solution.

    Let $$$dp[i][j]$$$ = number of ways we can arrange the first $$$i$$$ lights such that the $$$i$$$ $$$th$$$ light is manually turned on and a total of $$$j$$$ lights were turned on automatically among the first $$$i$$$ lights.

    Let $$$k...i$$$ be the last segment of $$$1$$$'s. This means that at position $$$k-1$$$ we will have a $$$0$$$ and at position $$$k-2$$$ there will be a $$$1$$$. If there are exactly $$$j$$$ $$$zeros$$$ in the segment $$$1...i$$$ then there are exactly $$$j - 1$$$ $$$0$$$s in the segment $$$1...k-2$$$.

    Let's define an operation, as we turning a light manually on (or placing a $$$1$$$). So in the segment $$$1...k-2$$$ we have to place $$$k - 2 - (j - 1)$$$ ones, and in the segment $$$k...i$$$ we have to place all $$$i - k + 1$$$ ones. This is similar to the question we answered above for placing all ones. We have to tell the number of permutations of $$$(L + R)$$$ items, in which the order of the $$$L$$$ items and $$$R$$$ items are fixed.

    Therefore, the ans for $$$dp[i][j] = dp[k - 1][j - 1] * nCr((k - 2 - (j - 1)) + (i - k + 1), (i - k + 1)) * ways$$$ $$$to$$$ $$$arrange$$$ $$$(i - k + 1)$$$ $$$ones$$$

    PS: I know it's a little too verbose. But hope you can understand the solution.

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

    You can simply let computer $$$i$$$ in $$$dp[i][j]$$$ be turned on automatically.

    so you just have to enumerate the last automatically turned on computer before computer $$$i$$$ for $$$dp[i][j]$$$

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

How to solve D?

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

How to solve B and C ?

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

how to solve problem D?

  • »
    »
    6 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +5 Проголосовать: не нравится
    • Remove all the already matching pairs as they do not affect the overall answer.

    • Now, check if number of left socks = number of right socks, then the answer is simply the number of left socks (this happens because we have already removed matching socks and hence we can just change the color of socks from any one leg to match it with the other leg)

    • Now, we know that we have to transfer some socks from one leg to the other.

      • Observation: It is always better to transfer socks which form a pair.
      • Example: Consider we have Left: 2 2 1 3 Right: 4 5 Now, we know that we have to transfer one sock from Left to Right, and it will be best if we transfer sock 2 from left to right, as it then forms a pair with the one sock 2 which would remain in left.
    • Now, after transferring greedily, we again remove the matching pairs of socks in left and right. Now, if the remaining number of socks in left and right are same, then the answer is simply number of transfers we made + number of left socks (we change the color to match the right socks as we already have removed the pairs). If the number of socks are still not the same, then we can simply transfer any socks from the pile having greater number of socks to the other and then change the colour of the remaining socks. In this case, the answer becomes the number of transfers we made earlier(greedily) + greater pile size.

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

How to solve E ???

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

Lets hope the pretests for F are strong :)

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

how to solve problem no D?

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

How to solve F orz... I try to merge two nodes $$$u$$$ and $$$v$$$ which $$$a[u] + a[v]$$$ is maximum.

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

    As long as initially $$$\sum_i a[i] \geq (n-1) x$$$ and the graph is connected, there is always a road you can build, no matter which roads you build and in which order. This means you can discard all edges but some $$$n-1$$$ that form a tree.

    Then, start doing arbitrary possible operations. Maintain in every component the values $$$a[j]$$$ for the components $$$j$$$ of children of the component, and in a priority queue the maximum current value $$$a[i] + a[j]$$$ over pairs (component $$$i$$$, component of child of $$$i$$$).

    Complexity is $$$\mathcal{O}(n \log^2 n)$$$ with small-to-large merges.

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

Did anyone get an FFT solution to pass for E? I'm having a rough time getting my code faster than 5 seconds sadly...

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

    what is the FFT solution?

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

      So we're going to work with ranges of computers that are off. Let $$$dp[k, t, end]$$$ be the number of ways to turn on a segment of length $$$k$$$ when toggling exactly $$$t$$$ computers, with $$$end = 1$$$ if the left end of the segment is the end of the whole array and $$$0$$$ otherwise (the only time both ends are the ends of the array is when $$$k = n$$$, which we case out). We assume that the right end of the segment is always adjacent to a computer that is already on Then our transition is

      $$$\displaystyle dp[k, t, end] = \sum_{i=0}^{k-1} \sum_{j=0}^{t - 1} \binom{t - 1}{j} dp[i, j, end] \cdot dp[k - 1 - i, t - 1 - j, 0]. $$$

      Basically, we are choosing to toggle the $$$i+1$$$th computer, splitting our segment into two. The lengths of these segments are $$$i$$$ and $$$k - 1 - i$$$ respectively, and we allocate these segments $$$j$$$ and $$$t - 1 - j$$$ toggles respectively. Then, for the remaining $$$t - 1$$$ toggles that we have, we choose $$$j$$$ of them to use on the left size, and $$$t - 1 - j$$$ of them on the right side. We can rewrite this as

      $$$\displaystyle dp[k, t, end] = \sum_{i=0}^{k-1} \sum_{t_L + t_R = t - 1} (t-1)! \frac{dp[i, t_L, end]}{t_L!} \cdot \frac{dp[k - 1 - i, t_R, 0]}{t_R!}, $$$

      which we can optimize to a convolution as follows: let $$$dp[k, end]$$$ be a polynomial in $$$x$$$, where the coefficient of $$$x^t$$$ is the value of $$$\displaystyle \frac{dp[k, t, end]}{t!}$$$ (our old DP). Let's fix some $$$k$$$ and $$$end$$$. Let $$$p(i)$$$ be the polynomial

      $$$p(i) = dp[i, end] \cdot dp[k - 1 - i, 0],$$$

      and let $p(i)[t]$ denote the coefficient of $$$x^t$$$ in $$$p(i)$$$. Then, we make a new polynomial $$$q(i)$$$ (I know my naming is getting egregious), with

      $$$ q(i)[t] = p(i)[t] \cdot t!, $$$

      i.e. we multiply the coefficient of $$$x^t$$$ in $$$p$$$ by $$$t!$$$. Then, we let $$$r$$$ be the polynomial

      $$$\displaystyle r = x \sum_{i=0}^{k-1} q(i). $$$

      Then, the coefficient of $$$x^t$$$ in $$$dp[k, end]$$$ is exactly

      $$$\displaystyle \frac{r[t]}{t!}. $$$

      The overall runtime is $$$O(n^3 \log n)$$$. I think there's a way to further optimize this by doing some 2D convolution, but I don't really know how to do anything like that (or if it's even possible). The idea for all of this is based on generating functions, but I'm not very well versed with those either, so maybe some trick from those can be useful here.

      Here's my code: 114957402. It runs in about $$$5.5s$$$ locally, and with some annoying optimizations I've gotten it a bit further down, but not by much.

      update: I got it to pass (114970160) with some optimizations + pragmas

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

    No need for FFT. You work with segments of manually toggled computers, with single automatically toggled ones in between. Then DP states are (first $$$i$$$ computers toggled, the last one is automatic or right endpoint of a segment, number of manually toggled computers up to computer $$$i$$$), and there are just $$$O(N^3)$$$ state transitions.

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

    You can solve this task without FFT.

    We can see on array as blocks set of consecutive computers.

    Let write the 1st DP f[len][cnt] — answer for on first len computers, where cnt computers we turned on themselves. Calculating DP looks like f[len + bs + 1][cnt + bs] += f[len][cnt] * fullblock[bs] * C[cnt + bs][bs], where fullblock[bs] — number of permutations for turned on by hand bs computers among bs computers.

    For fullblock[bs] we need in the 2nd DP. dp[len][last_pos][flag] — number of permutations with len computers, there is computer with index len stay in position last_pos, flag = 0 when position of index len — 1 stay to the left of last_pos

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

Phoenix Played with all of us

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

shitiest ABCD. also the scoring distribution was bullshit. 2000 fucking points for D :\

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

I wonder that if there is a contest without graph theory problems......

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

hmm how F checker works?

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

How to solve E ?

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

    I used dp to find all the possible combinations of switches that we manually turn on. For example, X_XXXX_XX_X, XX_X_X are some valid sequences. The gaps represent switches that automatically are on. It is easy to see that the size on contiguos gaps will be atmost 1.

    Now, for each such combination we've to find the number of permutations to fill the X's. To do that I used 2 more states, {position, continuos X's till pos, number of skips}. I use skips to calculate how many were manually ONed before the contiguos Xs until pos.

    Now another important thing to note is that, The number of permutations to arrange r numbers such that theres no gap between them is 2^(r-1). (Try to prove it)

    After that we just have to use some more combinatorics to combine 2 contiguous segments of X's in our dp. There will only be 2 transitions, pos->pos+1 and pos->pos+2 (skip->skip+1). Rest of the details should be clear in my code

    Submission

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

I am getting Memory Limit Exceeded using multisets in problem D. Please have a look at my code: https://codeforces.me/contest/1515/submission/114956539

Why using map instead of multiset do not give this error?

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

mgmggmgm greedies and observations go brr

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

WA on pretest 3 on problem D again and again.

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

Pending System Testing for everyone?

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

Passed samples of problem E just before the end of the contest, submitted it and got a MEMORY_LIMIT_EXCEEDED on test 1. And there's not enough time to fix it. :(

The retribution of bad habits comes.

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

rainboy orz.

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

There is something called greedy algorithms, Problem D was based on ultra greedy Algorithm.

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

A to D seemed doable but still I was only able to get A correct, looking forward to editorials to understand the missing cases.

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

Idea for E?

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

The setters wanted to emphasize "Problem C uses constructive algorithms" (Some other problems also have two same tags)

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

A-D weren't very pretty problems but weren't too bad either. I liked E though.

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

In case you're curious about B: it should be obvious that since the sides of triangles are $$$1$$$ and $$$\sqrt{2}$$$, the side of the resulting square has to be $$$a+\sqrt{2}b$$$. Then, the area is $$$N/2 = a^2+2b^2+\sqrt{8}ab$$$, but since $$$a,b$$$ are rational, $$$\sqrt{8}ab$$$ can be a rational number only if $$$ab = 0$$$. That means $$$N/2 = a^2$$$ or $$$N/2 = 2b^2$$$.

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

Thank you setters for a very shitty round. Enjoyed every inch of it. Please dont make such shit problems in the future

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

Wow, such a balanced contest

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

link to solution.

Can someone tell me why this code is failing even for the first pretest for problem C. It is running fine in my local.

Any help would be very very much appreciated. Thanks in advance.

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

I'm in love with my solution to I, so I'll share it in case it's different from the model solution:

Ofc. let's sort the diamonds by the order we we'll pick them, the leftmost item is the first to pick. Let's define $$$f(x)$$$ as the maximum integer $$$k$$$, such that $$$2^k \leq x$$$.

Let's build the segment tree on the sequence of diamonds and for each query of the third type let's run dfs on it. Ofc. in leaves we can normally consider the diamonds, but it would be too slow, so we are looking for a speedup. Let's split into two smaller segments each time when $$$f(size~of~our~backpack)$$$ will decrease somewhere in it. If it won't change, then let's do something smart to skip the whole segment in $$$O(1)$$$.

When will it decrease? It'll happen for sure if in the segment that we currently are is some diamond with weight $$$w$$$, such that $$$f(w) = f(size~of~our~backpack)$$$ and $$$w \leq size~of~our~backpack$$$. It will happen also if the sum of the weights of all diamonds with $$$f(weight) \lt f(size~of~our~backpack)$$$ is at least $$$size~of~our~backpack$$$. In these two cases let's just solve the segments recursively. If neither of the conditions hold, we know that we'll simply take all the diamonds with $$$f(weight) \lt f(size~of~our~backpack)$$$.

Final observation: $$$f(size~of~our~backpack)$$$ will decrease at most $$$\log$$$ times and for each time it decreases we we'll do only $$$O(\log(n))$$$ splits, so the complexity for each query will be $$$O(\log^2)$$$. Let's then build $$$O(\log)$$$ segment trees. Each of them will keep the minimum weight of a diamond with $$$f(weight) = id~of~tree$$$ and the sum of weights and values of diamonds with $$$f(weight) \leq id~of~tree$$$. We can modify these values in $$$O(\log^2)$$$ per query and the query about finding the score also can be done in $$$O(\log^2)$$$ then.

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

Thanks for the contest! The problems I read were all pretty nice. I'm a bit salty that I failed E and didn't think of working on F instead but that's part of the CP experience :)

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

WTH is wrong with this solution for B??? Input can't exceed 1e9, what am I missing and why does it fail test 5?

code

EDIT: Fuck me, I'm dumb.

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

fuck u motherfuckers, it was the most bullshit global contest ever. please dont let this son of the bitches make contest, MIKE.

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

(╥﹏╥)

Pics-Art-05-03-12-20-01

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

When you fix the bug(1 char bug)in your code 15 seconds before the contest end and then your internet decides to load the page very slowly and you miss submitting the problem by 1 second.(It turns out it took me less than a minute to ac in upsolving :( now I will lose rating instead of becoming IGM)The bug was that I used variable xx instead of x at place

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

no brain me solving question A by shuffling the array multiple times codeforces: we wont let u cry this time, Accepted

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

To not keep you waiting, the ratings updated preliminarily. In a few hours, I will remove cheaters and update the ratings again!

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

tfw OEIS doesn't work

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

Why system testing is happening again?

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

Today's global was the coolest of all that I handed in. Thank you very much FieryPhoenix ! I will wait for more competitions from you

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

Great contest! (and thanks for the IGM)

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

https://codeforces.me/contest/1515/submission/114966463 why does this give tle on b problem? plz explain its sqrt(n) only.

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

somebody please explain why i am getting wrong answer in test 3 in D here's my submission https://codeforces.me/contest/1515/submission/114967116

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

114951091 Don't know why getting Wrong Answer. Can somebody find a testcase which gives wrong answer to the code.

How the answer in following test case is 3 and not 4

10 6 4

4 5 3 5 8 5 5 10 10 4

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

can anyone kindly explain why greedily adding the 2 smallest values in the array not work in c.

like if we have [2,4,7,9,10] and if we want 3 block just add the smallest 2 and replace, by this we get [6,7,9,10] and then again do the same thing, thus getting [13,9,10] the max difference is 4 which is okay, if we were to do any further operation we would have done that to 9,10

but this gives WA, can anyone suggest a counter example

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

someone please explain why i am getting wrong answer in test 4 in D . my submission: 114958100

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

Commenting this again because did not get any response in the previous comment.

Solution

Can someone explain why this solution for problem C is failing even for the first pretest. It works fine in my local machine.

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

Здравствуйте. Может кто подскажет почему такое.

По итогам Global Round 14 почему-то неправильно пересчитан мой график. В нем показывает, что я занял 3747 место и -80 к рейтингу, тогда как в самой таблице у меня вполне неплохое по моим меркам 1307 место. Где-то здесь баг — либо все-таки какая-то моя задача упала на системном тестировании, либо в отображении графика какой-то перекос.

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

Got this message from System

Attention!

Your solution 114875501 for the problem 1515B significantly coincides with solutions nmp/114873698, calabashgirl/114875308, bnkalya1502/114875501, sleeping_samurai/114904548. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.me/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

First of all , I do not even know who the above mentioned people are , neither did I used any online compiler . Although I agree that the above codes are similar but this is probably a coincidence because for an easy problem like this (given that there were 10K+ participants) , there are a limited types of implementations possible .

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

False Accusation of cheating in Codeforces Global Round 14. Got this message today. MikeMirzayanov

Attention!

Your solution 114904088 for the problem 1515B significantly coincides with solutions shart23/114880136, ThakurSaab/114904088. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://codeforces.me/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked.

My Submission: 114904088 ......His Submission: 114880136 Problem B was quiet straight forward, and there are not much ways you can write the code for this problem if you try the same approach. In this case, me and tem_shett happened to use same approach for this problem. This is just a mere coincidence, and is quiet shocking for me becasue my solution has never been skipped or hacked before. Will this be rectified or I have to lose +43 for this contest ?. PS — I had a doubt, why am I the only one between the two of us who is penalized.

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

When will t-shirt winners be announced?

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

Congratulations to t-shirt winners!

List place Contest Rank Name
1 1515 1 Radewoosh
2 1515 2 ksun48
3 1515 3 Um_nik
4 1515 4 Benq
5 1515 5 yhx-12243
6 1515 6 tourist
7 1515 7 duality
8 1515 8 jiangly
9 1515 9 LJC00118
10 1515 10 NotaMotuaQAQ
11 1515 11 tatyam
12 1515 12 Golovanov399
13 1515 13 LayCurse
14 1515 14 Elegia
15 1515 15 Maksim1744
16 1515 16 _h_
17 1515 17 maroonrk
18 1515 18 244mhq
19 1515 19 ehnryx
20 1515 20 nocriz
21 1515 21 receed
22 1515 22 never_giveup
23 1515 23 nantf
24 1515 24 hitonanode
25 1515 25 heno239
26 1515 26 Ormlis
27 1515 27 natsugiri
28 1515 28 dlalswp25
29 1515 29 Isonan
30 1515 30 gisp_zjz
57 1515 57 zhoukangyang
90 1515 90 atomicenergy
95 1515 95 kiyotaka
102 1515 102 dorijanlendvaj
124 1515 124 Kaey
131 1515 131 FoodSheep
169 1515 169 Andycipation
186 1515 186 natofp
195 1515 195 YeongTree
223 1515 223 N.N_2004
228 1515 227 01191020csl
255 1515 255 yuto1115
260 1515 260 __23333
262 1515 262 aa2985759
311 1515 311 njupt_lyy
322 1515 322 lucasr
323 1515 323 momohara
337 1515 337 Lidox1145143344
362 1515 362 Emilan
479 1515 479 _su1sen