My own solutions to the CSES Problem Set
My account on CSES: https://cses.fi/user/15196
Feel free to ask (by creating issues) if you don't understand my solutions.
Solutions to CSES Problem Set
My own solutions to the CSES Problem Set
My account on CSES: https://cses.fi/user/15196
Feel free to ask (by creating issues) if you don't understand my solutions.
Hi,
I am trying to figure out why a BFS + DFS is done for "Distinct routes".
I kind of have a sense, but not clear.
For example the graph is like this
1 2
1 3
3 2
2 4
4 5
Here the paths are 1 2 4 5/1 3 5.
However in a different examplee going at the same level (like between 3 and 2) cann cause problems. For example if we traverse from 1 to 3 and then 3 to 2 and figure out a way. It can mean that we cannot take the path from 1 to 3 again (the teleporter is used). So in some cases
we need to traverse in the same level, or in some cases we cannot.
How do we distinguish?
1 2
1 6
1 8
8 2
8 7
7 9
2 9
2 6
6 9
Here if we take 1 2 6 9 as first path then 1 8 2 9 or 1 8 7 9 is the other path. But this is wrong as
there are 3 paths possible 1 2 9 1 6 9 1 87 9
Any thoughts??
a) Why cannot we simply do DFS from the root node?
The solutions are not viewable
Can you please elaborate on the code. I'm not getting what the for loop does.
Thanks in advance.
Hi,
Can you point me the algorithm and its explanation used in this code. I basically tried with KMP but the program encountered TLE. Figured out that the no of patterns (and thereby its pre-processing) is more than the text itself.
Please let me know.
Sincerely,
Suds
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.