Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plot points faster #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

harry7557558
Copy link

Improve the time complexity of +plot points from $O(N^2\log(N))$ (according to comment) to $O(N)$.

Speed comparison of +plot points Xyene d zhouzixiang2004 with the bot running on my local machine:
Before: 7.15s
After: 5.74s
Iterating through the DB without doing anything (continue at line 202): 5.50s

Seems like DMOJ doesn't consider a partial AC as a solved problem in point calculation. Update the code to match DMOJ's result. The solved problem count by the code still deviates from the site's problem count for users like Xyene and I still don't know why.

Another change is eliminating the "linear interpolation" error in graph plotting.

Before:

After:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant