Friday, December 8, 2017

UVa problem solution 146 - ID Codes

problem link:

Discuss: in this problem we just have to check is there any permutation next to given string. for it there is STL next_permutation() in cpp that will return zero if there no permutation after given string or return the next permutation of string. so we can easily use this STL.

try your self before see the code


Thursday, November 30, 2017

UVa problem solution 102 - Ecological Bin Packing

problem link:

discuss: in this problem you have to combine the color as much it get minimum. there is six combination possibile,so do it lexographically order.


try your self before see the code


Tuesday, October 17, 2017

UVa problem solution 10189 - Minesweeper

problem link:

Discuss: in this problem you just have to simply check the adjacent square.if there is mine then just count it.for simplicity you can use function.then in loop you can print the sum.no need to store it string. use size_t to avoid presentation error.

try your self before see the code


Monday, October 16, 2017

UVa problem solution 489 - Hangman Judge

problem link:

Discuss: in this problem as you can count stroke only unique wrong guess you have to erase all duplicate element from guess string.you may can erase all duplicate element from string also as one correct guess for all same character.and this tricky part  that you can't short guess string using sorting method.and compare and follow the instruction of problem statement.


try yourself before see the code


Wednesday, October 4, 2017

UVa problem solution 119 - Greedy Gift Givers


problem link:


Discuss: In this problem you can easily use vector or structure to solve this problem.
and for presentation error you can use size_t.and there is no tricky part in this problem


try yourself before see the code



Tuesday, September 26, 2017

UVa problem solution 10945 - Mother bear


problem link:


Discuss: Just check each string palindrome or not.there is no tricky part in this programm

try your self before see the code


Monday, September 25, 2017