samudra_mitra's blog

By samudra_mitra, history, 11 months ago, In English

Hello Codeforces, this is my first blog and here I have given my solution of the complete CSES Graph Algorithms section. This is the github repo where I have pushed all the cpp files:

Counting Rooms

Thinking
Code

Labyrinth

Thinking
Code

Building Roads

Thinking
Code

Message Route

Thinking
Code

Building Teams

Thinking
Code

Round Trip

Thinking
Code

Monsters

Thinking
Code

Shortest Routes I

Thinking
Code

Shortest Routes II

Thinking
Code

High Score

Thinking
Code

Flight Discount

Thinking
Code

Cycle Finding

Thinking
Code

Flight Routes

Thinking
Code

Round Trip II

Thinking
Code

Course Schedule

Thinking
Code

Longest Flight Route

Thinking
Code

Game Routes

Thinking
Code

Investigation

Thinking
Code

Planet Queries I

Thinking
Code

Planet Queries II

Thinking
Code

Planet Cycles

Thinking
Code

Road Reparation

Thinking
Code

Road Construction

Thinking
Code

Flight Routes Check

Thinking
Code

Planets and Kingdoms

Thinking
Code

Giant Pizza

Thinking
Code

Coin Collector

Thinking
Code

Mail Delivery

Thinking
Code

De Bruijn Sequence

Thinking
Code

Teleporters Path

Thinking
Code

Hamiltonian Flights

Thinking
Code

Knight's Tour

Thinking
Code

Download Speed

Thinking
Code

Police Chase

Thinking
Code

School Dance

Thinking
Code

Distinct Routes

Thinking
Code

I hope that you will find these helpful, and will also find it in your hearts to forgive any mistake which might have crept in unknowingly. Also, any feedback is welcome.

Peace!!

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

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by samudra_mitra (previous revision, new revision, compare).

»
11 months ago, # |
  Vote: I like it +2 Vote: I do not like it

Sugoi! ^⁠_⁠^

»
11 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Thanks 。⁠◕⁠‿⁠◕⁠。

»
11 months ago, # |
  Vote: I like it +1 Vote: I do not like it

cool

»
10 months ago, # |
  Vote: I like it +1 Vote: I do not like it

Great job!

»
10 months ago, # |
Rev. 3   Vote: I like it +1 Vote: I do not like it

Nicely compiled, thanks

»
10 months ago, # |
Rev. 3   Vote: I like it +1 Vote: I do not like it

It is a helpful initiative,thanks. :)

»
9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Good job!, I found them very helpful in my learning of Graph algorithms. Can you please update it to detailed version, because I can't understand some of them fully.

Sorry for bad english :)

»
7 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Refer this video for easy implementation of round trip problem:-https://www.youtube.com/watch?v=KSEZ8BbIyHs&t=2s

»
4 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I think there's a mistake on building teams you said you used bfs but in the code you used dfs.

»
18 hours ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

In the problem Mail Delivery the stack part can be replaced with the following recursive code --

void dfs(int root){
	while(adj[root].size()){
		int m = adj[root].size();
		int it = *adj[root].begin();

		adj[root].erase(it);
		adj[it].erase(root);
		dfs(it);
	}

	path.pb(root);
}

The logic is the same as the stack method. Complete Code — https://ideone.com/FBA8MQ