timonknigge / tcr Goto Github PK
View Code? Open in Web Editor NEWTeam Code Reference for programming contests
Team Code Reference for programming contests
What about changing
for(size_t i=0; i<v.size(); ++i) v[i] = i;
to
iota(v.begin(), v.end(), 0);
?
For example here:
https://github.com/TimonKnigge/TCR/blob/master/snippets/datastructures/unionfind.cpp#L5
The HLD code claims 'vvi &graph; // graph can be graph or childs only
', but this is not the case. Take the following 7 vertex graph:
1 3
1 4
2 3
2 4
If we store this graph bidirectionally (a \in E[b] <=> b \in E[a]), the hld dfs will loop infinitely. I thought about changing the if-condition here into d[v]<0
, but then the LCA query 2,4 does not terminate.
And extensions, as e.g. used in https://projecteuler.net/problem=606
std::insert
doesn't overwrite, while we need this to update an existing index to a better value.
Just using m[x]
works, but is much slower.
https://github.com/TimonKnigge/TCR/blob/master/snippets/datastructures/increasing_function.cpp#L12
You might want to apply the fix in jaehyunp/stanfordacm#1 (and jaehyunp/stanfordacm#3, for that sake).
There was also some fix jaehyunp/stanfordacm@71f999b that later got reverted, I don't know what's up with that.
(I wouldn't be surprised if the simplex still got stuck in loops because of broken loop detection and precision stuff, but so far I haven't been hit by it when using Stanford's simplex.)
For starters, the 'ACT HERE' isn't executed for the biconnected component that the root of the visit call is in. (try e.g. the four-cycle as input.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.