yesbutno1685's blog

By yesbutno1685, history, 4 years ago, In English

I have a question on this question: https://mirror.codeforces.com/problemset/problem/1409/E

I am getting a TLE on test five (or when n hits its maximum value). My code gives the correct answer, given infinite amount of time, I just need help on figuring out why it TLEs.

From my knowledge, all I do is binary search and do a linear scan, so that's about nlgn time. However, when I submit it, it does not run in time, so I suspect that there is something that I am not catching. I've tried for a long time and still could not figure out why my code is TLE-ing.

I hope you guys can help me out

Thanks in advance!

code (in java): https://mirror.codeforces.com/contest/1409/submission/93014244

Code

Full text and comments »

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

By yesbutno1685, history, 4 years ago, In English

I was working on this USACO problem: http://usaco.org/index.php?page=viewproblem2&cpid=898, when I realized that I would need to use a BIT(Binary Indexed Tree) and find the number of values that are less than a certain value x.

I was wondering how to find the number of numbers that are below x using a binary indexed tree. I searched online and couldn't get a good answer. The closest I got to a "decent" answer was a stack-overflow with a promising title, but then the only response was not really helpful.

I hope the people here can provided some useful and helpful responses to help me out with this problem.

Thanks in advance.

Full text and comments »

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

By yesbutno1685, history, 4 years ago, In English

Hello everyone!

I often find it very frustrating when there is one testcase that gets a wrong answer and you have no idea why. Is there a strategy among coders as to how to deal with edge cases?

Thanks in advance

Full text and comments »

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

By yesbutno1685, history, 4 years ago, In English

As you all know, the school year is starting (at least that is so in America), so I wonder if it is possible to make more contests on the weekend instead of always hosting them on the weekdays. This will help many people take more contests, improve faster, and just have more fun, while not having their school schedule disrupted.

I really hope you guys look into this because if you do, I believe that this would be a change for the better.

Full text and comments »

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

By yesbutno1685, history, 4 years ago, In English

Problem statement: https://mirror.codeforces.com/contest/924/problem/B

My submission (Using binary search approach): https://mirror.codeforces.com/contest/924/submission/89608314

My submission (Using two-pointers approach):https://mirror.codeforces.com/contest/924/submission/89602356

In this problem, I came up with two approaches which seem asynchronous to the editorial's solution. One using binary search and the other using the two pointers technique. However, both of my implementations WA-ed on testcase 14 with the same exact answer. I suspect that I am either doing something wrong with my logic and implementation or it is just some sort of annoying precision kind of error. (eg, rounding wrong, not precise enough, off by like 10^-8).

I would appreciate it if anyone would point out my error, or give me a hint. I spent a long time reading through the editorial many times, but still can't find my error.

Thank's in advance!

Full text and comments »

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

By yesbutno1685, history, 4 years ago, In English

I've noticed that throughout Codeforces, many people are downvoted my many people because of no apparent reason. I would like to know the justifications of these downvotes.

Ex 1. In a post by a user asking for a push in the right direction regarding improving and getting started, I noticed that people started downvoting it. I personally think that asking that was a perfectly valid question, though the rest of Codeforces might not agree.

Ex 2. In a recent post by me, that I deleted, I simply wanted to share my thought process of how I solve the latest codeforces round problems A + B. I know that my solutions weren't the best, but I don't believe that they deserve a downvote.

Now, to get to the main point of this post. What causes you guys to downvote and why? I would like to know for the reference of me and other users because I still don't understand why posts get downvoted all the time, even though I can see the effort that the user put in to contribute to this community. Personally, I believe that all of these downvotes are completely un-warranted. Some people just want to share their ideas, or ask questions. Isn't that what this whole platform is all about?

Full text and comments »

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