| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3611 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | Radewoosh | 3415 |
| 8 | Um_nik | 3376 |
| 9 | maroonrk | 3361 |
| 10 | XVIII | 3345 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 164 |
| 2 | adamant | 150 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 144 |
| 5 | errorgorn | 141 |
| 6 | cry | 139 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 9 | TheScrasse | 134 |
|
+36
0 |
|
+50
I am veryamazed by this contest. |
|
+44
|
|
+5
Nope, it's a joke from last year (organizers were debating whether or not to fill the balloons with helium, and someone suggested filling the gym with argon instead so that regular balloons would float) |
|
+3
Hey, they’re pretty good solutions! |
|
0
Sorry. Online teams will not receive shirts. |
|
+31
I like the cat in the announcement |
|
+8
Everyone can participate. Middle schoolers are eligible for prizes since they are precollege. |
|
+8
We'll try to live up to the expectations :-) |
|
+8
studying. |
|
+36
Gratitude is a wonderful feeling for both parties involved :-) Regarding this:
Here's a theory: could this have to do with the increase in cheating that seems to have been happening lately? Cheating is the ultimate form of disrespect and ingratitude, it makes sense that these same people would take all the amazing problems out there (available for free!) for granted. |
|
+9
Let $$$A=[1,2,3,1,5]$$$. If you set $$$A[4] := 4$$$ you get an answer of $$$5$$$. But the LIS of $$$A=[0,2,3,1,5]$$$ gives you an answer of $$$4$$$. |
|
+78
me when i see arul hii arul |
|
+14
Sorry for the wait! We've just uploaded the written solutions to Dropbox. |
|
+10
|
|
+18
The number of states in our model solution is exponential, but writing a DP to count the worst-case number of states gets us around $$$2 \cdot 10^5$$$. Code included here (which we also used to generate some of the tests): Code |
|
+22
One could even say the contest was LIT... |
|
+37
Thanks! We set it at 3 hours because we expected there to be many beginner teams that would have trouble working for a full 5 hours, but we'll see what feedback we get about this. |
|
+9
When will practice submissions be enabled? I'm not able to submit right now. |
|
+34
lunchbox hard carry orz |
|
+31
Looks like it should be fine, NAQ only starts 25 min after the round ends :) |
|
+63
I found this on google: link In short, you sweep through all possible lines through the origin. Each one divides the points into two sets, and you consider each of those two sets as a possible answer. |
|
+77
Carnegie Mellon (USA, North America) will be kobortor, 4fecta, and BucketPotato. |
|
0
I had the same issue, switching to |
|
+5
The author set $$$k \le 142\,023$$$ ($$$1\,4\,2023$$$) to make the checker work quickly, the $$$10^{18}$$$/redacted business was intended as a bit of a red herring. |
|
+42
orz flamestorm
|
|
+187
Thank you — I've had the same thing on my mind for a while now and I'm happy to see someone posting about this. My opinion: CF rounds are a privilege. Sponsors, authors, testers, and coordinators combined put in hundreds — or even thousands — of hours of work into creating every contest (not to mention the effort and money that goes into maintaining the CF website), and we get to enjoy the results of that labor for free. Sometimes authors make mistakes, this is inevitable for humans, but downvoting a round just for that reason is like throwing away a collection of gifts just because one was broken during shipping. It's a sign of ungratefulness. Participating in an imperfect round, in the worst case, maybe you lose a few hours of time and some internet points. That's no excuse for being ungrateful, especially considering how much effort everyone involved put into creating that contest. |
|
+87
My solution to A, which I grossly overcomplicated: Solution Let the substring be $$$s_1s_2s_3\ldots s_m$$$ of length $$$m$$$. We want to make the number of indices $$$2 \le i \le m$$$ where $$$s_i \neq s_{i - 1}$$$ zero (call these bad indices). In one move, we can reduce the number of these indices by at most $$$2$$$, since an operation will not change the number of bad indices within a substring. Also, a substring has at most two neighbors (to the left and the right) that it can merge with. Therefore, if there are $$$x$$$ bad indices, the minimum number of moves it needed to clear out all the bad indices is $$$\lceil \frac{x}{2} \rceil$$$. Let's consider the types of bad indices. We can split them into two types:
Note that if we have two bad indices of different types, we can use them to reduce the number of bad indices by $$$2$$$. For example:
The other cases can be shown to work in the same way. Also note that if we apply one of the permutations Using these two kinds of moves, we can do the following: while there is at least one bad index of both type 1 and 2, we can remove one of each in a single move. Eventually, there will only be $$$y$$$ bad indices of a single type. Suppose WLOG that this remaining type is type 1, and that the resulting string has the form Now, if we flip the latter half, we can keep removing two at a time until we get to zero. This solution is optimal for odd $$$x$$$, since it achieves $$$\lceil \frac{x}{2} \rceil$$$ operations (the minimum possible). However, for even $$$x$$$, it's possible that this solution will take $$$\frac{x}{2} + 1$$$ operations: which is worse than the $$$\frac{x}{2}$$$ minimum possible. How can we tell if $$$\frac{x}{2}$$$ is achievable? Note that we can also apply operations on strings of the form It turns out that not only is this a sufficient condition, it is also necessary. If you work out the cases, you'll find that any operations that removes $$$2$$$ bad indices does not change the value of $$$|t_1 - t_2| \equiv 0 \bmod 6$$$ (you only need to check $$$4$$$ cases where the first bad index is So, if $$$t_1 + t_2$$$ is odd, then the answer is $$$\lceil \frac{t_1 + t_2}{2} \rceil$$$. Otherwise, the answer will be $$$\frac{t_1 + t_2}{2}$$$ if $$$|t_1 - t_2| \equiv 0 \bmod 6$$$, and $$$\frac{t_1 + t_2}{2} + 1$$$ otherwise. Luckly the code is pretty short compared to the explanation :P |
|
+113
Here's my solution to G. I think it's somewhat similar to the editorial. It looks long and complicated, but I've tried to thoroughly explain the motivation behind it, the central idea is fairly straightforward, and I think all the steps are pretty intuitive. I hope it can help anyone confused by the main editorial. Motivation Pt. 1 First, notice that the problem doesn't change if we start with an empty grid and place down cells, where we are forced to place cells in grid spots marked For now, ignore the constraints on which cells need to be filled. Let's start by considering when $$$k = 2$$$. The most obvious solution would be something like this: If you play around with it a bit, you'll notice you can "twist" the path around, and that actually, any path from the bottom left to the top right works. This motivates looking at the diagonals which go from the top left to the bottom left (or more formally, sets of cells with the same value of $$$r - c$$$), since at each step going up or right, we move into a new diagonal (In this next picture, the distinct diagonals we're considering are marked with different letters). It's easy to show that there can be at most $$$k-1$$$ cells in one diagonal (otherwise, there would be a sequence of size $$$k$$$ going down and right). Motivation Pt. 2 A natural question to ask is, what's the maximum number of cells we can place down under this constraint? Well, notice that the number of cells in each diagonal is $$$1, 2, \ldots, n - 1, n, n - 1, \ldots, 2, 1$$$. So there are $$$2k-2$$$ diagonals where we can fill every cell (the diagonals with $$$\leq k - 1$$$ cells), and a remaining $$$2n - 1 - (2k - 2)$$$ diagonals where we can only place $$$k-1$$$ cells. Doing the algebra gives: $ If you think of this expression as the number of cells in 2 $$$n \times (k-1)$$$ rectangles, minus one $$$(k-1)\times(k-1)$$$ square, it's not hard to see that this is precisely equal to $$$n^2 - (n-(k-1))^2$$$: the number of cells we want to remain (if you want, you can do the algebra to convince yourself). So, the maximum number of cells we can place down is exactly equal to the number of cells we need to place down! So we know that in diagonals with $$$\leq k - 1$$$ cells, every single cell needs to be filled. Example with $$$n = 5, k = 4$$$: Let's call these forced cells. What about all the other cells? Well, we know that all the other diagonals must have exactly $$$k-1$$$ cells. Let's keep playing around with the problem, and try to find solutions for different $$$k$$$. If you try to construct some solutions, after a while, you'll notice that all the solutions you find are composed of $$$k-1$$$ disjoint paths going from the lower-left forced cells to the top-right forced cells. For example, with $$$n=5,k = 3$$$: Here, the forced cells are marked Let's try to show that this $$$k-1$$$ paths idea is necessary and sufficient for a solution. Proof sketch Necessary We can do this with a kind of induction. We start with the lower-left diagonal, and build up $$$k-1$$$ paths. Base case: let's look at the diagonal immediately adjacent to the last forced diagonal in the lower-left. Here's a picture for $$$n = 5, k = 4$$$: The cells we're interested in are marked with Induction step: if we have $$$k-1$$$ paths leading up to some diagonal, it is necessary to extend these $$$k-1$$$ paths into the next diagonal. This part's harder to make pictures for, so bear with me. Let's say we want to add a cell in the new diagonal such that it isn't adjacent to any cells in the previous diagonal. This is the only way to not extend the $$$k-1$$$ paths. Let's try and make the leftmost cell (we'll denote it $$$(r, c)$$$) in the diagonal not adjacent to any cells in the last diagonal. Then, there are 2 cases:
Notice that if neither of these conditions hold, then $$$(r, c)$$$ must be adjacent to the leftmost cell in the previous diagonal. OK, so we're forced to extend the leftmost path. What about the next one (the second-to-the-left cell in the new diagonal)? Similar reasoning will show that this case is also impossible, and extending the reasoning, that we are forced to extend all of the $$$k-1$$$ paths. So, the $$$k-1$$$ paths are necessary for the solution. Sufficient Suppose that we have $$$k-1$$$ paths going up and right. Let's try to construct a sequence of $$$k$$$ cells going strictly right and down. By the pigeonhole principle, there must be at least one path that has at least 2 of its cells in this sequence. But this is impossible: if there were two cells $$$(r_1, c_1), (r_2, c_2)$$$ in one of these paths such that $$$r_1 \lt r_2$$$ and $$$c_1 \lt c_2$$$, then it would be impossible to get from one of these cells to another going only right and up! So they couldn't possibly be a part of the same path. And so, if we have $$$k-1$$$ paths, it is impossible to construct a sequence of $$$k$$$ cells going strictly right and down. Alright! So now all we need is to implement it. Implementation Let's build our paths, starting from the rightmost one. For convenience, we'll put the starting points of our paths in the last forced diagonal in the lower right corner. For example, with $$$k = 4$$$, it would look like this ( It's not hard to see that any placement of $$$k-1$$$ cells in the first non-forced diagonal can be achieved by starting our paths like this. Now, let's build the actual paths. This is where the constraints on which cells we must place come in. Suppose that the endpoint of our path is currently at $$$(r, c)$$$. Let's look for points where we need to place down a cell (in other words, that are marked $$$s[i][j] = 0$$$ in the input), that are in the same row as our path and to the right of it. We extend our the path to the right to cover all these cells. Then, when there are none left, we move up to row $$$r-1$$$. Note that if some cell has already been covered by a previous path, we should ignore it. This greedy idea works because the paths are disjoint ~--- if we didn't go to the right to collect these cells, then some path starting to the left of the current path would have to cross over and collect them, and avoiding this happening can't make our solution worse. In this way, we greedily build our paths. At the end, if there is any cell that needs to be covered that we haven't covered, then our answer is Not quite. There's still a possibility that the paths intersect at the very top, and that we haven't actually placed down enough cells. There's an easy fix, though. Iterate through the diagonals from bottom-left to top-right. If there are less than $$$k-1$$$ cells in this diagonal, then we place down cells (iterating left to right) in empty spots that are adjacent to cells in the previous diagonal, until we get to $$$k-1$$$ cells. Notice that since there are exactly $$$k-1$$$ cells in the previous diagonal, there must be at least $$$k-1$$$ cells in this diagonal adjacent to a cell in the previous diagonal. So we can always place down enough. The proof that this preserves the paths is a bit harder to justify. Intuitively, if two paths ever intersect, then they must be mashed together into the leftmost part of the diagonal, and adding cells to the right gives the mashed together paths a new cell to move into. My AC code: 174160936 |
|
You could use a private group (create one under the GROUPS tab) to post. It would also allow you to choose who can see the blogs :) |
|
+8
You're right, that's my mistake. It will be fixed soon. |
|
+2
Actually, in the original version of the round, B and C were swapped. But feedback from testers suggested that their current placement would be better. |
|
+13
The main idea is the same, but the way you go about it is different: Your solution uses a The intended solution also finds all values of |
|
0
Sorry, the link has been fixed |
|
+11
Sorry about that. Try again? |
|
+26
Hi, the intended solution codes for D2 have now been posted (here and here). IMO, the implementation in both is very clean and easy, no optimizations needed. As I said in a different comment, the difficulty in this problem seems to lie on whether you want to painfully optimize a simple idea or think a little more to find a nicer solution. |
|
+35
Sorry to hear. What did you dislike about D? |
|
+29
You're right. Unfortunately none of the setters or testers came up with this idea :( |
|
+18
Sorry to hear :( Our correct intended solutions take some more thinking, but have clean and easy implementations (no optimizations needed). So I guess the difficulty of this task was in, do you want to optimize your code or think of a cleaner solution? |
|
+31
(copy-pasted from here) There is a $$$n \sqrt n$$$ two-pointers memory solution in D2 that we wanted to cut off. We decided it would be fine since all of the correct $$$O(n)$$$ memory solutions (from testers, authors, and the coordinator, including in Python and Java) use less than 1/6 of that memory. |
|
+49
Sorry for the trouble, there is a $$$n \sqrt n$$$ two-pointers memory solution in D2 that we wanted to cut off. We decided it would be fine since all of the correct $$$O(n)$$$ memory solutions (from testers, authors, and the coordinator, including in Python and Java) use less than 1/6 of that memory without any optimizations. As for the difficulty, there was originally a problem F, but testing suggested that up to E was hard enough. |
|
+65
Originally, the statement looked something like this (this is a very condensed version of it):
The flavor text was ultimately taken out since testers found it made the statement more confusing. |
|
+95
(sorry if this is a bit long/confusing, I'm not the most experienced at explaining) First off, imagine choosing some subset of the letters in $$$s$$$ that form $$$t$$$: for example if $$$s$$$ is Then you want to delete all the fluff. Here's one approach: first, you delete fluff from the end of the string until you come to useful letters. Then, you iterate past the useful letters, until you come to more fluff to delete. Repeat until all the fluff is gone. This may not always be optimal, for example if $$$s$$$ is When you're deleting fluff from the back, it takes $$$1$$$ operation to iterate past useful letters and $$$1$$$ operation to delete the fluff. When you delete fluff from the beginning, it takes $$$1$$$ operation to iterate past useful letters, but $$$2$$$ operations to delete fluff (you need to iterate forward then delete). Then, the optimal solution will look something like this: there is some prefix (possibly empty) of the string where you've deleted from the beginning, then some contiguous segment of useful letters you haven't iterated over, and finally, some suffix of the string where you've deleted from the end. If the prefix isn't empty, then it needs $$$2x+y+1$$$ operations, where $$$x$$$ is the number of fluff characters in the prefix, and $$$y$$$ is the number of useful characters. Otherwise it takes $$$0$$$ operations. Next, the contiguous segment of useful letters, this takes $$$0$$$ operations since you don't iterate over it at all. Finally, for the suffix, it takes $$$x+y$$$ operations. At least in my solution, the dp[3][N] was something like this: 0 for the prefix, 1 for the contiguous segment, and 2 for the suffix. The transitions were somewhat tedious to implement but fairly straightforward. |
|
+7
|
|
+48
|
|
+57
Maybe you can use 1508D - Swap Pass as an example. It looks like they use this: Where |
|
+56
My approach to F2 seems a bit different from the editorial's: Say $$$dp_i$$$ contains all values $$$(ind_j, v_j)$$$, sorted by $$$ind_j$$$, such that it is possible to get an increasing subsequence with an xor of $$$v_j$$$ and last element at index $$$ind_j$$$, using only elements in the array less than or equal to $$$i$$$. If there are multiple possible values for one $$$v_j$$$, only store the one with the minimum $$$ind_j$$$. To transition from $$$dp_{i - 1}$$$ to $$$dp_{i}$$$, first, add all elements already in $$$dp_{i-1}$$$ to $$$dp_i$$$. Then, for each $$$(ind_j, v_j)$$$ in $$$dp_{i-1}$$$, take the minimum index $$$k$$$ such that $$$a[k] = i$$$ and $$$k \gt ind_j$$$. Then, add $$$(k, v_j \oplus i)$$$ to $$$dp_i$$$ (if this $$$k$$$ does not exist, don't do anything). This can be done in linear time with two pointers if you store the occurrences of each $$$i$$$. Two important details:
My code: 132932565 |
|
+45
Just a heads up, there's a small error in the announcement:
Anyhow, looking forwards to this contest! |
|
On
Night_Lord →
Is it possible to get positive delta even if not solving a single problem?, 5 years ago
+14
New accounts get a boost in their rating changes for their first 6 contests. You can see Mike's blog here for more details. |
|
+26
The LCM might be very large and overflow, e.g. $$$lcm(99971, 99961, 99929, 99923, 99907) = 9969136729118531781864539$$$ will not fit a 64-bit integer. |
|
+45
Thanks for the problems! I could tell that the problemsetters put a great deal of effort into making this contest. |
|
+245
|
|
On
unt311 →
How to visit standings of a particular contest in a dense performance graph., 5 years ago
+12
You aren't alone; this seems to be a common issue. The way I usually get around it is double-clicking on the graph until it zooms in to the point where I can click on the box without a different one appearing. |
|
+10
This blog should answer your questions. |
|
+8
I believe problems A, B, C, and D1 had 3 pretests each. |
|
+90
PurpleCrayon is a skilled programmer, and I'm excited to see the tasks he and ijxjdjd have prepared. Good luck to all participants, and hopefully we can see more crayon rounds in the future! |
|
On
Failure12 →
I can solve problem in practise time from 800-1400 but i can not solve problem in the contest even easy problem. What should I do now???, 5 years ago
+6
I'm assuming that this stress is coming from the prospect of losing rating or getting a low rank on the scoreboard. It can be demoralizing to see everyone else solving difficult tasks while you're stuck on the first problem. I find it helpful to think of it this way— a contest you do poorly on shows you more clearly what you need to improve on, and provides you with problems to practice those skills. You can always regain rating in a later contest— for now, just try to solve problems and have fun. A single contest doesn't define your coding career. |
|
+5
Say you choose some value |
|
+5
This blog should help explain the calculations. |
|
On
gabrielwu →
Montgomery Blair Informatics Tournament 2021 Spring Round (Registration live!), 5 years ago
+88
looking forward to a contest where gyrating cats can participate |
|
+24
The most I've ever had was 124 submissions on a POJ suffix array problem... I can't really say I had fun debugging, but it did feel great when I finally got it accepted :) |
|
0
Thank you for the problems! |
|
+8
Thank you for the contest! |
|
+1
Thanks for the contest :) |
| Name |
|---|


