| # | 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 |
|
+9
Having done a bit of CP myself before moving to other software development, I'm aware that some people in CP don't care about memory leaks, and while I explicitly said that in many cases this is not a serious problem, I did state that in problems where multiple segment trees need to be created, such as problems with multiple queries: A memory leak can cause a MLE, or even worse, an "unexpected" RTE. (Probably some |
|
-6
I had an opportunity to have an interview with the author of this post, and this is what I found out: Basically, there are no such thing as "bird tree", even among official Vietnamese documents. The implementation of using pointers, while having appeared in a few Vietnamese competitions, is still really non-standard in Vietnam, so these students thought they have discovered something original. And they claimed: "Khóa em gọi mọi thứ là chim", meaning that their class calls every discovery "bird". In the few lines below, they even claim to know something about "Drug Distribution DP" (Quy hoạch động chia ma túy). TL;DR: You don't need to worry about finding sources for the "Bird Tree", the name is some made-up term by the author and his classmates. |
|
+34
Your implementation of the Dynamic Segment Tree has a problem: Memory leak. You allocated children using but never While in many cases this is not a serious problem, as only one instance of the segment tree is needed and all of its memory is automatically freed after program termination, the memory leak can cause a MLE or RTE for problems where multiple segment trees are used (such as problems with multiple queries,...) To fix this problem, in your |
|
+60
This is a new trick, if any of you are interested. Developed by me and hackerphobia. Go to the compiler's include folder, follow the header files until you find the implementation for Spoiler What you want to do is to make it return the same memory address for every allocation. To achieve this, allocate a big Allocate This makes your friend's laptop's compiled code strangely corrupts all the data in STL containers ( Deallocate Ok, so next time your friend solves any problem, his code will be mostly messed up, and he'll freak out because of failing to code even the simplest BFS (which commonly uses a The good thing about this trick is, every change is made into the HEADER files, and nothing is visible in his code/template, therefore making it impossible to debug, UNLESS he is a compiler expert. |
|
0
It can help you to pass some problems, provided that your compiler is good and your judge does not have a compile time limit. However, for the sieve problem, the difference is only significant when MaxN >= 1e8, which will often crash the compiler, or if it doesn't, result in an executable too large that linking will fail. For some other problems where MaxN = 1e4 and you found a O(n^2) solution with O(n) space complexity however, this trick may help you a lot. |
|
+8
1. This trick works in C++14, and needs neither a wrapper class nor a wrapper function:Code You can check the assembly here. Starting from line 106, many 2. This trick may be useful for MaxN <= 1e5, but not higher.Although compile-time evaluation may theoretically make it possible to compute the Sieve for up to MaxN = 1e9, |
|
On
jainpavbhaji →
Code getting AC when submitted in C++17 but gives WA when submitted in C++14, 6 years ago
+20
Your code C++14 submission uses LCM(int, int) and passes 2 long long arguments. Integer overflow may cause the WA verdict. Your C++17 submission uses std::LCM(long long, long long), a template instantiation of std::LCM, which is only available since C++17. The built-in LCM function accepts two long long arguments, which does not cause integer overflow. UPD: AC submission. Replacing
with
fixes the problem in C++14. |
|
+1
It's back now again. |
| Name |
|---|


