| # | User | Rating |
|---|---|---|
| 1 | jiangly | 3810 |
| 2 | Benq | 3676 |
| 3 | Kevin114514 | 3655 |
| 4 | maroonrk | 3463 |
| 5 | strapple | 3447 |
| 6 | Um_nik | 3387 |
| 7 | heuristica | 3322 |
| 8 | turmax | 3317 |
| 9 | tourist | 3307 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 156 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | Um_nik | 143 |
| 5 | Errichto | 139 |
| 6 | adamant | 137 |
| 7 | AmShZ | 135 |
| 8 | maroonrk | 133 |
| 9 | BledDest | 132 |
| 10 | qwexd | 129 |
|
0
Extending from your idea, if we can upload an additional file |
|
0
Doesn't the code for floor(logb(x)) cause an infinite loop? |
|
+5
Times New Roman |
|
0
Another problem: INC 2022 C — Powers of Two |
|
On
cooldudeperfect →
In yesterday's Div2-C "upper_bound" gets accepted but "lower_bound" gives wrong answer, 3 years ago
+1
Why would you expect both submissions to receive the same verdict when |
|
+3
Try finding the diameter and centroid in the following tree: Spoiler |
|
0
Add |
|
+7
Similar to the power of two version but you can't use the bitwise operation here. You can also replace |
|
0
You shouldn't compare floating-point values using the I resubmit your WA 13 C++17 (64) solution and get AC by turning on excess precision, but I wouldn't recommend relying on this method to get AC though. |
|
0
I don't know why your code compiles on clang. If you look at your submission, your code generates warning about non-const comparator:
|
|
0
These are const member functions, which are not allowed to:
You can find more explanations here. Comparator used in STL algorithms/containers is expected to be const member functions because it does not make sense to modify values inside a comparator. |
|
0
Use this comparator: |
|
0
Adding either of |
|
+4
Is there any advantage in using |
|
On
randomrandom1810 →
An interesting problem that was asked in online hiring test of salesforce., 4 years ago
-6
How to handle the cycle in the DP when adding digit $$$0$$$ repeatedly? |
|
0
Don't give them ideas!!! |
|
+5
Array index out of bounds. |
|
0
Is it faster? |
|
0
I don't think you can write the comparator this way. If you update the value of More detailed explanation here. I added my code with assertions: |
|
0
Thanks for the reply!
This is what initially confuses me because the value of
So that is why it doesn't work on C++11 (the ternary operator method works well though). |
|
0
How does this work? Shouldn't the value of |
|
+1
Consider the simpler version of the problem: Given an array $$$A$$$ of $$$N$$$ integers, you need to find $$$K$$$-th maximum sum subsequence of fixed size $$$L \leq N$$$. For example, if $$$A = [9, 6, 4, 2, -1, -3]$$$, these are the subsequences of size $$$L = 3$$$ sorted by their sum: Subsequences
Among all $$$\binom{N}{L}$$$ subsequences, the $$$3$$$-rd subsequence is $$$[9, 4, 2]$$$. This simpler version of the problem can be solved using Fracturing Search. By inserting $$$N$$$ $$$0$$$'s into $$$A$$$, I was trying to reduce the original problem into the simpler version. Now, we are trying to find the $$$K$$$-th maximum sum subsequence of fixed size $$$N$$$ from the new array $$$A$$$ (new length is $$$2N$$$). Using the previous example, $$$A$$$ would now become $$$[9, 6, 4, 2, \underbrace{0, 0, 0, 0, 0, 0}_{N}, -1, -3]$$$ and these would be its length $$$N$$$ subsequences: Subsequences
However, this approach is apparently wrong because we would end up with a total of $$$\binom{2N}{N}$$$ subsequences instead of $$$2^N$$$ subsequences. If we insist on solving the original problem using Fracturing Search, we would have to run $$$N$$$ separate fracturing searches simultaneously for each $$$1 \leq L \leq N$$$ and maintain it using something like Segment Tree. |
|
+18
I think this can be solved using Fracturing Search. To handle the different sizes of each possible subset, we can insert $$$n$$$ $$$0$$$'s into the array. Thus, on your example, $$$(8, 4, 2), (8, 4), (8, 2)$$$ can be seen as $$$(8, 4, 2), (8, 4, 0), (8, 2, 0)$$$. CMIIW. |
|
+1
You can solve it using Digit DP. |
|
+18
His CE 148547473 is suspicious. The code fails to compile because there is unknown keyword |
|
+1
I added small changes to your solution and got Accepted. 147993909 |
|
On
abc_fx →
Western Countries are Manipulating Anti-Russian Sentiments and Betraying Ukraine?, 5 years ago
+10
Don't keep updating your blog with small changes every few minutes just to force it to stay on the recent actions. You only added a single newline on your latest revision... |
|
0
I'm using Windows and |
|
0
|
|
0
The huge pictures in 2A slow down the loading of the page. The coordinates and sizes of the example triangles are not that large and there are extra space that could have been cropped out. |
|
-8
Alternative |
|
+13
ISTP |
|
+30
If OP uses the same password on different websites, the attacker might be able to access the other accounts by getting the password of OP's Codeforces account. Moreover, the OP has his email shown to public on his profile. |
|
0
You misread the problem. You need to assign the value $$$a_{l+k+i}$$$ to $$$a_{l+i}$$$, not the other way around. |
|
+3
In the solution of 2D/1B: $$$[x\le a_i\le y]$$$ What is the name of this square bracket expression? It seems to me that $$$[\text{true}] = 1$$$ and $$$[\text{false}] = 0$$$. Edit: Iverson bracket |
|
0
IMO "dynamic segment tree" is more suitable because we dynamically allocate memory for the segment tree. Whereas "implicit segment tree" might cause confusion as there is another term implicit graph, which is not anything close to this segment tree we are talking about. |
|
+3
Your solutions only works if |
|
-29
I think it is because of Microsoft Visual C++. |
|
+11
You will have to wait. |
|
On
-is-this-fft- →
Self-deception: maybe why you're still grey after practicing every day, 5 years ago
+64
Um_nik is now worth $$$1$$$ cyan. |
|
+5
But the inner for loop is not reset on every iteration of the outer for loop (the pointer |
|
0
I try implementing the RMQ BIT (queries and updates in $$$O(\log N)$$$) though I am not sure if my implementation is fully correct. I have tried it on the following problems and it seems to be working fine.
|
|
0
Could you explain how? From what I've read from cp-algorithms, we can only do the update if the new value is not greater than the current value. |
|
0
For minimum query on prefix, is it possible to perform updates using arbitrary values? |
|
On
rinku11 →
Rearrange positive and negative numbers in O(n) time and O(1) extra space in an array and also you have to have to maintain order of appearance of positive and negetive number ., 5 years ago
0
My idea is to use stable sorting algorithm to sort the given integers based on their signedness. Thus, the array $$$[2, -2, 1]$$$ can be seen as $$$[+, -, +]$$$ or $$$[1, 0, 1]$$$. |
|
On
rinku11 →
Rearrange positive and negative numbers in O(n) time and O(1) extra space in an array and also you have to have to maintain order of appearance of positive and negetive number ., 5 years ago
0
I guess you are looking for stable sort. I don't think it is possible to solve the problem in $$$O(n)$$$ time and $$$O(1)$$$ space unless there are some specific constraints. CMIIW |
|
+25
I think the other person was trying to accuse you of cheating if you didn't help him on the other problems. |
|
0
Can 131830101 be hacked? I didn't stop the |
|
+24
|
|
0
It is possible but you will have to maintain the |
|
On
pranshukas →
Sublime Text is Taking too much time to Compile. Please Help Fixing it !, 5 years ago
0
MSI Dragon Center |
|
0
Note the title of the blog. |
|
0
Could you post the old editorial page without the edits? There were several helpful (at least for me) discussions about GCD and solution of 1549D - Integers Have Friends without segment tree and sparse table. |
|
0
How can using |
|
+58
|
|
0
Correct answer is 45, while your code outputs 48. |
|
0
I found someone else's solution using greedy for problem D. |
|
-18
Ignore. |
|
0
Does anyone know where I can find more about this? |
|
+47
Open Telegram (joke). |
|
0
You don't actually need to store the distances in a separate array and then sort it later. You can keep track of the current minimum distance and update it accordingly. You also don't have to check whether you picked the same portal twice as the cost from $$$(1, 1)$$$ to $$$(n, m)$$$ without using any portal will be strictly cheaper. |
|
0
The explanation counts the sheep starting from $$$1$$$ ($$$x_1, x_2, \dots$$$), while the code counts the sheep starting from $$$0$$$ (the variable |
|
+1
In problem E:
Shouldn't $$$m = \lceil\frac{k}{2}\rceil$$$? |
|
+1
You don't need to check for that case because going from $$$(1, 1)$$$ to $$$(n, m)$$$ without using any portal will be strictly cheaper than using the same portal twice. |
|
+5
The code |
|
+3
|
|
0
I changed |
|
0
For each vertice $$$v$$$ in the tree, calculate the absolute difference between the value of $$$v$$$ and the values of $$$v$$$'s predecessor and successor. Predecessor of $$$v$$$ is the vertice with the largest value smaller than the value of $$$v$$$ and successor of $$$v$$$ is the vertice with the least value larger than the value of $$$v$$$. |
|
+6
If $$$k = n \cdot n$$$, isn't it the same as the bruteforce bubble sort approach? |
|
0
Can you give some numbers on how much faster WSL is (compared to CMD) on your local environment? |
|
0
Hi. Could you implement the following features? Thanks in advance.
|
|
+3
Imagine you need to fill a sequence of integers of size $$$10$$$ using only $$$1$$$, $$$2$$$, or $$$3$$$ so that the sequence is non-decreasing. As they are non-decreasing, all $$$1$$$'s have to appear in front of all $$$2$$$'s and so on, so we don't need to care about the order of these integers and we need only the number of occurences of each $$$1$$$, $$$2$$$, and $$$3$$$. Thus, we need to find number of solution of: $$$count_1 + count_2 + count_3 = 10$$$, with $$$count_0, count_1, count_2 \geq 0$$$. |
|
0
Thank you. Apparently the link to the contest page is located on the top of the Overview page. |
|
0
How do I register and participate? I opened the Contests page but there are only previous contests there. |
|
+3
Oops, I forgot that it is for 2020 only. |
|
-7
I think there is a bug. My highest rating increase is +151 but your website shows +101, which is my second highest rating increase. Also, my peak is 1791 while your website says 1789. UPD: There is no bug. |
|
+3
|
|
On
pranshukas →
Sublime Text is Taking too much time to Compile. Please Help Fixing it !, 6 years ago
0
Does this shorten compilation time? |
|
On
pranshukas →
Sublime Text is Taking too much time to Compile. Please Help Fixing it !, 6 years ago
0
In my laptop, there is a pre-installed app that could switch my laptop between performance/battery mode (not the one from Windows Settings/Control Panel). Compiling a hello world program (with |
|
0
I precompute the lowest prime factor for each $$$a_i$$$ (similiar to Sieve of Eratosthenes), then factorization can be done in $$$O(log_{a_i})$$$ by repeatedly dividing $$$a_i$$$ by its lowest prime factor (I think drayc's method is faster though). 103630714 ( |
|
+36
Custom invocation. |
|
0
Solve backtracking problems, especially those with lengthy implementation. |
|
+9
|
|
+6
rainboy writes everything in C. |
|
+1
|
|
+10
I think he is talking about div1B. |
|
0
I wrote my solution here. |
|
+1
|
|
0
I think reports could be implemented similiar to Recent actions tab. When a submission is reported, it would be displayed publicly in the Recent reports tab (sorted by the number of reports) and anyone will be able to check the reported submission. Similiar to contribution, a submission reported by higher rated users should also receive higher number of reports. Other features could be added to further improve the accuracy of reported submissions, e.g. 10 contest participations. |
|
0
Could you predict my rating? Thanks in advance. |
|
+20
Custom invocation. |
|
+6
|
|
+2
To precompile the header: To use the precompiled header: To check if gcc actually used the precompiled header: Make sure to compile your code with the same flags used to precompile the header. |
|
+8
|
|
0
Okay I was wrong. Thanks for pointing out. |
|
0
NVM |
|
Thanks for sharing. This can actually help during hacking phase. |
|
0
In problem D1 and D2 of Codeforces Round 671 (Div. 2). |
|
+2
What is pretest 6 for div-2 D? |
|
0
Can you share the problem and your submission? Since I learnt about And if anyone knows about cases where |
| Name |
|---|


