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

constant factor speedup (vector -> array) #280

Merged

Conversation

lrvideckis
Copy link
Contributor

No description provided.

@lrvideckis
Copy link
Contributor Author

lrvideckis commented Dec 1, 2024

problem https://codeforces.com/contest/718/problem/C , problem is seg tree of matrixes, and it's well known having many small vectors is slow

current Matrix code: https://codeforces.com/contest/718/submission/294132074 4702 ms
using array instead of matrix: https://codeforces.com/contest/718/submission/294132337 593 ms

@simonlindholm
Copy link
Member

Huh, I was sure the compiler would be able to optimize this. Makes sense though.

@simonlindholm simonlindholm merged commit 0f8a6aa into kth-competitive-programming:main Dec 1, 2024
1 check passed
nanoblob-jpeg pushed a commit to nanoblob-jpeg/catlicku that referenced this pull request Dec 23, 2024
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.

2 participants