| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3382 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 155 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 145 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | BledDest | 136 |
| 8 | adamant | 134 |
| 9 | maroonrk | 132 |
| 10 | cry | 130 |
|
+1
thanks for your help mate, is this a general strategy for applying operations type of problems? I seem to struggle with those a lot, especially when its a 2D array and you have to pick sub rectangles from it |
|
0
For real, it takes so much courage to say "balls" on the internet! /s |
|
+1
is it that Spoiler each row and column sum modulo 3 doesn't change either, so the modulo 3 of each corresponding row and column of both arrays must be the same? |
|
0
AI generated banner lmao |
|
+1
Handle the edge case where result is 0. Which is pretty simple. Since you always have (n-2) signs, therefore theres always a 2 digit number(including 01-09) present in your calculation. The problem reduces to finding this 2 digit number then applying the following algorithm: Let i be the starting position of the 2 digit number. For each character from 0..i-1 and i+2..n, add if digit is not 1 otherwise multiply it and finally add the 2 digit number. Now to find that 2 digit number: You can iterate through all possible 2 digit numbers and add them to vector and sort it. Then among lowest 2 digit numbers that have the same digit in 1's place, pick the one that gives you the lowest result. You need to do this because sometimes picking the minimal number is not optimal, like 22 gives better result than 21 in one of the test cases. I couldn't come up with a better method to pick the minimum number so I kinda brute forced it. The time complexity is O(nlogn). (Picking optimal 2 digit number through sorting) Sorry if my description is kinda convoluted I am still learning |
|
0
For D you dont even need to keep track of the average of all rows, only the row with the highest number of #s. |
|
0
Cloudfare forces, jokes aside it was a really good contest for me. I am not that good but I xould solve upto E! And I guess F would have required a solution with priority queue, but I was too slow to implement it. |
|
0
thanks I got it. |
|
0
I think I have a far simpler answer that does require any integer conversions and works purely with strings, thus it can be used for very very large numbers: Basically, for any number to be right, 4 conditions must be met:
Please let me know if there's any holes in my logic. |
|
0
can you please elaborate on the last point, I couldnt understand |
|
0
Bro could you tell me how to figure our the solution for B? It seems so random to me |
|
0
Really shameful, I couldn't solve anything after A |
|
0
Ok so I was working on this problem for a while and I think this is why your solution works: you calculate the minimum steps required to paint all the nodes from red_start, as red doesnt depend on blue. you also calculate the minimum steps required to travel all the nodes from blue. if red has a better start, blue simply goes to red and then follows its path, therefore: ans = (min_steps_red) + dist_ab; if blue has a better start, then red and blue should try to meet each other on their path, if dist_ab is even, they can syncronize perfectly otherwise, blue stays one step behind. ans = (min_steps_blue + dist_ab % 2) + dist_ab; You calculate your answer from the minimum of the two above approaches. |
|
0
You can implement it two ways: if you want to use the formula, get the maximum distance by simply using BFS/DFS. Otherwise, to implement everything from scratch, here's what you do: Do a DFS from the node that returns the maximum depth from a node, for each node add twice the depth of each neighbor to a sum, as well as keep track of the maximum depth among each neighbor, then simply subtract the maximum depth from the sum. I did it like this. Sorry if my implementation is a bit naive, I am still new to graphs and trees |
|
0
the 2nd number B must be the smallest number not divisible by A, not the smallest number not equal to A. Because then B can divide those numbers that A can't. |
|
0
Can anybody let me know what is wrong with my logic in Problem C: My observation, for any array of size n, you can convert the entire array to any element that is not at the last position. So the answer must be the highest element in the sub array of size n-1, that excludes the last element. What is wrong with my observation? for example pick an array [a, b, c, d, e, f]: with the given operations, you can convert all elements to a, b, c, d and e, but not f. therefore the answer is the highest among a b c d & e. Edit: nvm I got it |
| Name |
|---|


