Saturday, January 27, 2018

UVa problem soultion 1112 - Mice and Maze

problem link:

Discuss: in this problem you can simply use dijksta and solve it.  jut loop through 1 to n and call dijkstra every time.if distant of exit node is less or equal then timer then make count increase. there is no tricky part in this problem.


try yourself , before see the code


Friday, January 26, 2018

UVa problem solution 10986 - Sending email

problem link:

Discuss: in this problem you can simply use dijksta algorithm.if you know the algorithm then this problem just direct implementation of that algroithm. there is no tricky part in this problem

try yourself, before see the code


UVa problem solution 10305 - Ordering Tasks

problem link:

Discuss: you can solve this problem using modified dfs or bfs. we call dfs for every adjacent vertices first.then push every vertex to stack. then just print stack.there is no tricky part in this problem.

try yourself, before see the code


Thursday, January 18, 2018

UVa problem solution 352 - The Seasonal War

problem link:


Discuss: in this problem you to have to find how many disjoint eagle is there.so you can simply use dfs or bfs to solve this problem.when you get a eagle sign and not visited increment count and send it to bfs or dfs function. it will make visited all joint eagle.

try yourself, before see the code


Tuesday, January 16, 2018

UVa problem solution 871 - Counting Cells in a Blob

problem link:

Discuss:this is simple graph problem.you can use bfs to solve.just count how much node visited in a call of bfs function and store it in maximum.you can use getline to take input.and push it to your 2d string and if string is empty just break input.there is no tricky part in this problem

try yourself,before see the code


UVa problem solution 572 - Oil Deposits

problem link:

Discuss: this is simple graph. if you know the fundamental algorithm of graph i mean bfs or dfs then it's pretty easy for you. when you found a node with '@' and it is not visited then just sent the index value to bfs function and increment the answer and in bfs function mark every connected node with it visited. your work done.


try yourself before see the code


Sunday, January 14, 2018

UVa problem solution 10004 - Bicoloring

problem link:

Discuss: if you know bfs algorithm then this problem is fun for you. just do bfs nothing more to do.just first take a color array as like visiting array. convert all number to zero.then in while loop if the color is zero and adjacent node color is then assign it with 2 else 1. and if two adjacent node color same then just break the loop.

try yourself before see the code



UVa problem solution 11470 - Square Sums

problem link:

Discuss: if you know the 2D. then the problem may pretty for you. how i did it first calculate all corner index value.then just increase the value of i and j. and you may trouble how to choose the corner point as it change then use them and analyse  ara[i][j], ara[j][n-1-i], ara[n-1-i][n-1-j], ara[n-1-j][i]  first traverse till n/2 and second loop traverse till n-1-i; examine it . it traverse all the square of the grid. then just print it..


try yourself, before see the code



Friday, January 5, 2018

UVa problem solution 12243 - Flowers Flourish from France

problem link:

Discuss: this is simple implementation problem.you can solve it with just one loop.

try yourself before see the code



UVa problem solution 12527 - Different Digits

problem link:


Discuss: this is simple implementation problem.you can use a bool array to check repeat number.as the range is not so big so you can check every integer individually.

try yourself, before see the code



Thursday, January 4, 2018

UVa problem solution 12592 - Slogan Learning of Princess

problem link:

Discuss: this is simple implementation problem.you can do it with map as well as structure.be careful when taking input. you can use 'getline(cin,string_name)'. and also be careful enough memory declare when use structure else there is run time error.

try yourself,before see the code


UVa problem solution 10812 - Beat the Spread!

problem link:


Discuss: just do the class eight problem.no tricky part in this problem.

try yourself,before see the code


Wednesday, January 3, 2018

UVa problem solution 11988 - Broken Keyboard (a.k.a. Beiju Text)

problem link:

Discuss: this is simple list implementation problem.if you know list then you can it without any trouble. just input the line in a string and then if  '[' in string then change the iterator of string in begin and if you found ']' then change the iterator of string in end.  and else just insert the element in the list.

try your self before see the code



UVa problem solution 10258 - Contest Scoreboard

problem link:

Discuss: though it's a implementation problem.i think pupil coder at least think for some time how to implement. however, you can solve the problem using nested structure.just take input and store in structure and then sort the structure.you can use bubble sort. there is no tricky part in this problem


try yourself,before see the code