Saturday, July 29, 2017

UVa problem solution 10684 - The jackpot

problem link:


Discuss: sum all score if the sum less then zero then set sum zero not when only single score is zero.


try yourself before see the code


UVa problem solution 10008 - What's Cryptanalysis?

problem link:

Discuss: in this problem you can use map for repeat the alphabet then copy the second element in the vector then sort it and erase all duplicate element in array. then check vector element with second element of map. if match then print the map element..


try your self before see the code



Friday, July 28, 2017

UVa problem solution 294 - Divisors

problem link:


Discuss: find the divisor of all number then compare it with previous if it is greater then  previous one then replace with maximum and store the number


try yourself before see the code

Thursday, July 27, 2017

UVa problem solution 583 - Prime Factors

problem link:


Discuss: Just find all prime factor. you may have to face trouble with x but give time it's easy present


try your self before see the code


Wednesday, July 26, 2017

UVa problem solution 11827 - Maximum GCD

problem link:


Discuss: in this problem you can take input as string.then convert it to number and push into a vector. and then run a nested loop and send every pair in gcd function. you can euclid algorithm it is efficient to find gcd. and compare return value with previous one if it is greater than that then replace the maximum value.


try your self before see the code



UVa problem solution 12465 - The Turanga Leela Problem

problem link:


Discuss: find the difference between two number.then loop as do prime.


try your self  before see the code



Uva problem solution 13109 Elephants

Discuss: in this problem just sort the weight and then add until weight less or equal maximum weight.
in increase the value of cnt



Friday, July 21, 2017

Uva problem solution 10924 - Prime Words

Problem link:

Discuss: In this problem sum the value of all letter then just check the sum is prime or not..there is no tricky part in this problem


try your self before see the code


Uva problem solution 11677 - Alarm Clock

problem linK

Discuss: In this problem you subtract h1 from h2 and m1 from m2.if the min is negative that means the hours round so add 60 with min and decrease the value of hours by one. and if hours is negative that means day also round so add 24 with hour.then just simply calculate the min.


try your self before see the code



Uva problem solution 10474 - Where is the Marble?

Problem link:

Discuss: you can take input in array or vector and sort that.after sort you can search the query.you can do it with linear or binary search or others there is no problem with time limit.  be aware of test case number it's some time makes trouble.


try yourself before see the code



Uva problem solution 11942 - Lumberjack Sequencing

problem linK:

Discuss: just simply check the array twice. if any of them are ordered then print ordered.otherwise print unordered.

try yourself before see the code



Thursday, July 20, 2017

Uva problem solution 11455 - Behold my quadrangle

problem linK:


Discuss:For Square All sides are equal. For Rectangle Opposite Sides are equal. In this problem opposite sides may be any of two from a,b,c,d such as a b or a c . For Quadrangle sum of all three sides are greater than rest of one side 
tyr yoursefl before see the code

 

Uva problem solution 11577 - Letter Frequency

problem link:


Discuss: in this problem if you simply use map then you'll get result. first search for second value for large number of time. then run another loop to match the value. if the value matched then just print the first element of the map.


try yourself before see the code



Sunday, July 16, 2017

Uva problem solution 10490 - Mr. Azad and his Son!!!!!

problem link:


Discuss: In this problem you have to use mathematical fact. if (2 power k − 1) is prime number then the number is perfect. or to check prime number you have to use the number n not the number generate by formula.


try yourself before see the code


Tuesday, July 11, 2017

Uva problem solution 11349 - Symmetric Matrix

problem link:

Discuss: in this problem you have to check weather a element less then zero or mat[i][j] and mat[n-1-i][n-1-j]  is not equal. if this happen then this matrix is non symmetric else it is symmetric matrix




Uva problem solution 541 - Error Correction

problem link :

Discuss: in this problem you just calculate the sum of row if it not even the increase flag.after it you calculate column as one disorder found twice you also found an odd in column summation also.then increase value of cnt. if flag and cnt one then change the bit.if  both zero then it's ok otherwise corrupt.


try yourself before see the code



Monday, July 10, 2017

Uva problem solution 11520 - Fill the Square

problem link:


Discuss: In this problem you just simply start the loop from 65 and check the [i][j] th element's with adjacent element.if the adjacent element don't match then simply assign [i][j] element to the loop value.


try yourself before see the code



Saturday, July 8, 2017

Uva problem solution 10038 - Jolly Jumpers

problem link:

Discuss:
In this problem you have to first find the difference of successive element.and check is there all digit between 1 to n-1. to do so you can take a bool type array. find difference and check weather the number less then n and bool is true.if bool is true then make it false.if not then it's not jolly.


try yourself  before see the code


Uva problem solution 575 - Skew Binary

problem link:


Discuss:

In this problem you just have to applied simple decimal based conversion system. As the number can big enough you should use string to take input.


try yourself   before see the code


uva problem solution 10469 - To Carry or not to Carry


problem link:

Discuss:  In this problem we just have to do binary AND operation between two digit.and then we get desired value.

try yourself before see the code.