Sunday, August 27, 2017

UVa problem solution 11286 - Conformity

problem link:



Discuss: In this problem you can simply use array inside map.that will be work done.
no more tricky part in this problem


try yourself before see the code



Sunday, August 13, 2017

UVa problem 10611 - The Playboy Chimp

problem link:


Discuss: just simply handle query. no tricky part in this problem.

try yourself before see the code


Friday, August 11, 2017

UVa problem solution 10165 - Stone Game

problem link:

Discuss: Just simply do xor of all pile. if it is non zero then jack is win otherwise jill

try your self before see the code



UVa problem 12996 - Ultimate Mango Challenge

problem link:

Discuss: this is problem like mango.if you are here then just use khata and pen.


don't see code


UVa problem solution 10110 - Light, more light

problem link:

Discuss: it is simple problem. if the number of divisor is odd then light is on otherwise off. you can determine it with perfect number if it is perfect square number then light off other wise on.


try yourself before see the code


UVa problem solution 10360 - Rat Attack

problem link:

Discuss: in this problem you have calculate all the position value. which is possible near to bomb.for that you can determine the maximum and minimum range from given output by adding and subtracting with the point.then add size to every grid. and obviously largest grid value will give the largest rat.

try your self before see the code


UVa problem 374 - Big Mod

problem link:

Discuss: in this problem you have to careful about big number.for big number you can divide the number and can simply solve the problem recursively.


try your self before see the code


UVa problem solution 11360 - Have Fun with Matrices

problem link:


Discuss: in this problem you just do work with 2D array. to see the input not use string to take input instead you can use "%1d" specifier.then when do transpose matrix you know what is transpose matrix just exchange the variable [i][j] and [j][i].when you do column exchange you can do it with one loop.just exchange the [i][column1] and [i][coulmn2].when do row exchange you can do same thing just [row1][i] and [row2][i] variable exchange.  when you increment and dic you can use modular '%'. it will work. after all it is just a easy problem..


try your self before see the code



Sunday, August 6, 2017

UVa problem solution 10226 - Hardwood Species

problem link:

Discuss: IN this problem you can work with map.just simply take input with map.don't worry about ordering because map is ordered string set.take input string if the length of string is zero then you can stop take input. then just iterate map for sum the second element then in next iterator print the first string of map then percentage the coverage of second element of map. then just print that.


try your self before see the code



UVa problem solution 573 - The Snail

problem link:


Discuss: this is just simple logic problem.just continue a while loop.and check weather it is greater then the height or less then zero. if if not then decrease fatiage factor from every day climbing then increase day.   Be aware of using floating point.


try yourself before see the code


Wednesday, August 2, 2017

UVa problem solution 10179 - Irreducable Basic Fractions

problem link

Discuss: in this problem you can assign n as result.then find the divisor of n. and subtract from the result. you will find the desired result

try yourself before see the code



UVa problem solution 11466 - Largest Prime Divisor

problem link:

Discuss: just find prime factor and replace maximum prime factor with largest one and if there is only one prime factor then print -1 otherwise print the largest one


try yourself before see the code