ycperson's blog

By ycperson, history, 3 days ago, In English

I was doing this problem: https://codeforces.me/contest/1730/problem/B and I have submitted 3 versions of binary searching on the answer and all of them are failing on test case 3 (wrong answer 36th numbers differ — expected: '40759558.0000000', found: '40759600.0000000', error = '0.0000010') -- all of them produce the same "wrong" answer.

I might be missing something stupidly obvious here but I am actually losing my mind right now. Could someone take a look at what could be going wrong?

In case you do not want to read the problem statement itself:

  • Given a bunch of functions of the form f(x) = |x — x_i| + t_i and if we define a new function g(x) as being the max across all the functions at x, we want to find the x value that minimizes g(x).

Submissions:

https://codeforces.me/contest/1730/submission/292825262 (binary searching on the position since the time function is convex) https://codeforces.me/contest/1730/submission/292826727 (binary searching on the time since it is monotonic)

Scroll to the bottom for the actual code. Thanks in advance.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By ycperson, history, 8 days ago, In English

This might seem like a bit of an exaggeration but I genuinely mean it when I say WTF ... In today's div3 contest, I could have been rank ~500 or so but instead have finished at ~1500 ranking. Why? Because in solving E, my solution was entirely correct except for the fact that I returned a char from one of my template functions instead of an int....

This is heartbreaking especially since that could have pushed me to expert. It's a hard pill to swallow, but I suppose I need to be even more diligent in checking the basic stuff about the implementation before questioning the correctness of more substantial details whenever I am debugging.

This is also a heads-up to people reading this -- do not suffer from this BS like I have smh.

Full text and comments »

  • Vote: I like it
  • -18
  • Vote: I do not like it

By ycperson, history, 4 weeks ago, In English

This is just some advice I've accumulated from my experience with cp thus far:

(1) Stop worrying about rating. If you're like me, perhaps you care about rating and contest performance a lot and take individual losses quite harshly. In fact, you may even act them into existence by worrying or anticipating that you will underperform in real contests. I have this experience where, even though I perform quite well during practice on my own and virtual contests and I know I'm able to solve hard problems, I choke when it comes to the real contest. This is usually due to the pressure I put on myself to redeem myself for recent losses and/or making a big deal out of taking a little too much time on a single problem in a contest.

(2) Actively push when you are solving problems. Just because you may not intuitively come up with a solution to a problem upon reading it does not mean you can not solve it. You have to push yourself to the point of feeling unnatural -- conjecture, guess and prove or disprove, make observations, do not be afraid of spending time understanding various examples, etc.

(3) Strong emotions never help -- both positive and negative. Of course, it is pleasurable to solve a hard problem after a good while of thinking and struggle, but the positives are just as intense as the negatives. If you allow yourself to attach your self-worth to your contest success, you will feel quite miserable. This is not to suggest not caring about contest performance -- by all means, keep practicing and trying to improve, but stop taking particular contest failures and failed attempts to solve problems so personally. Be as objective about the process as possible. Don't chalk up every success as being personally driven and allow every failure to seem like an incredible injustice done against you.

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it

By ycperson, history, 4 weeks ago, In English

I have genuinely hit rock bottom in terms of mentality and keeping it the f**k together during contests. I'm literally writing this during contest time because I don't even care to further try. My last 7 or so contests have gone so dogs**t that I genuinely can not even bring myself to try any longer. And it's not even because of a lack of practice -- I have done over 100 CSES problems, > 200 USACO Bronze and Silver problems, and 300+ on codeforces. Yet still, I manage to s**t the f**king bed during every real contest lately. While, on the other hand, I perform perfectly fine in virtual contests (expert level).

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it

By ycperson, history, 2 months ago, In English

I have been considering the concept I've tried over the last 2 days of the Daily Blog, and I've reached the conclusion that it is sort of unnecessary. I will continue to work on CP everyday of course, and for those of you who may be interested in seeing my daily progress overtime, I have been keeping a spreadsheet of problems and notes on them for many months now. I will make it publicly viewable if/when the time is right, but for now, I feel I need to work without the pressure of posting everyday and just work on my own without this nuisance (for a lack of better wording).

I just want to state that the purpose of my last few blogs was to say that sufficient work can still propel you to significant heights in CP, and I still intend to show that to the best of my ability, but of course it will take time and the work must be done in relative silence.

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it

By ycperson, history, 2 months ago, In English

I was able to get in some practice from the Div 3 contest today. Not a terrible performance by me, but I should have done better. I didn't give enough time to think about E and immediately moved to G. I was on the brink of implementing G completely in time but could not. I need to stop wasting time thinking about random stuff while I think about single problems. I also need to give a bit more time thinking about each problem before choosing to move to another one.

Problems:

https://codeforces.me/contest/2014/problem/A

https://codeforces.me/contest/2014/problem/B

https://codeforces.me/contest/2014/problem/C

https://codeforces.me/contest/2014/problem/D

https://codeforces.me/contest/2014/problem/G

Full text and comments »

  • Vote: I like it
  • -1
  • Vote: I do not like it

By ycperson, history, 2 months ago, In English

I was able to get in a somewhat suboptimal amount of practice today. I did the Div 2 contest but struggled a bit due to problem C (which was actually my first interactive), but other than that, I only did 1 problem. I intend to do more practice than that each day and will try to make as much time as possible for CP practice since I am a university freshman right now as well, which gives a bit less leeway timewise.

With that out of the way though, the problems from today demonstrate that I require greater mathematical thinking involved in my solution process rather than just relying on intuitive ideas and proof by AC.

Today's problems:

https://codeforces.me/contest/2013/problem/A

https://codeforces.me/contest/2013/problem/B

https://codeforces.me/contest/2013/problem/C

https://codeforces.me/contest/1951/problem/C

Full text and comments »

  • Vote: I like it
  • -3
  • Vote: I do not like it

By ycperson, history, 2 months ago, In English

Recently, I have been posting a lot of comments on others' posts regarding feeling that aptitude and IQ are necessary for reaching substantial heights in CP. I disagree, and there are probably more than enough examples in support of my position on codeforces and other CP platforms. Nonetheless, since I am trying to improve at CP myself, I intend to post every day from now on to provide an update on my progress in order to keep a literal complete record of my progress starting from specialist. I can guarantee you that I do not have any sort of great natural aptitude, so this should be interesting to see over time. I have been doing CP for just under a year at this point in time, so this daily record is simply a digital tracking of the progress I intend to make anyways. It is intended to encourage those that are discouraged by their own struggles -- to see that work actually does matter. If you do enough, you can reach significant heights still -- it just may take a bit longer than other people.

This will also provide me a bit of accountability for making some movement every single day, which I have been doing for almost 2 months at the moment anyways.

Full text and comments »

  • Vote: I like it
  • -11
  • Vote: I do not like it

By ycperson, history, 3 months ago, In English

I was doing this problem https://codeforces.me/contest/1822/problem/G1 recently, and I was comparing my code to the editorial implementation and I kept getting TLE again and again, trying to make the code more and more similar to the implementation given. The ultimate thing that allowed AC was changing the static array "a" to a vector of size n as in the implementation. Anyone know why the vector performs better? Because I thought static arrays were faster if anything.

My AC submission: https://codeforces.me/contest/1822/submission/280480288

My submission just before that (using static array a): https://codeforces.me/contest/1822/submission/280480106

(Just scroll down to the main function at the very bottom -- there is a bunch of template stuff above it not for the problem).

Thank you in advance for any help.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it