Hello CF community! I have previously asked my doubts regarding the specific problem on my blog but turns out I was getting downvoted. So, I thought there must be something I was doing wrong. I am writing this to know how to ask one's doubt regarding specific problems and their approaches? Are there some guidelines or other threads where I should ask my doubts? Any help is appreciated. Thank you
You should follow how to ask guidelines from stackoverflow. If you are not following them this will usually result in a poor question that will be hard to understand or answer. Also you have to show your progress. If you have some error have your tried running code on your machine with the same input? If on the same input your code produces result A and codeforces your code produces results B what have you done to investigate why it happens? If you write a good question and show your progress I don't think that you will get downvoted.
Please help me find the bug in this part of the code for the problem : https://mirror.codeforces.com/contest/1843/problem/E
In the following code segment , I was trying to fill up an array with distinct values so after every cin I used to check if the same element had occured previously . When I submitted my code without commenting this out it was givng wrong answer verdict and when I commented it out then it got accepted. Instead of wrong answer if TLE would have come then it would be more acceptable . Please help me understand what is the problem with the below code segment .
struct segment { int l; int r; };
struct segment temp; arr=(struct segment *)malloc((m+2)*sizeof(struct segment));