Saturday, June 24, 2017

uva problem solution 913 - Joana and the Odd Numbers

problem link:

Discuss: In this you just you have to simply calculate (((n*(n+2)/2)*3)-6)

try yourself before see the code


Wednesday, June 14, 2017

uva problem solution 543 - Goldbach's Conjecture

problem link:

Discuss:   In this problem you can generate all prime.then compare the smallest problem if it is prime then subtract it from number then compare it with prime number if it is prime number then print both of them or if it is not then increase the value of i;

try yourself before see the code.


uva problem solution 10235 - Simply Emirp

problem link:

Discuss: in this problem you just have to check weather a number is prime or not.you have do it with square root. and then reverse the number and do check again prime number criteria. if it fulfill then it is empri number and obvisouly it should be not equal to previous number. if it is then it is prime


try yourself before see the code



Thursday, June 8, 2017

uva problem solution 11417 - GCD


problem link:

Discuss: in this problem how to find gcd then do the code as in the statement.


try yourself before see the code


uva problem solution 10170 - The Hotel with Infinite Rooms

problem link:

Discuss: In this problem you can use while loop.substitute s from d while d greater then 0.and increase s with one in every loop then print s-1 the number of team members on this day


try yourself before see the code



uva problem solution 1585 - Score

problem link:

Discuss: in this problem you can use for loop for count 0 and a variable to count the position value of 0.if there is sequence of 0's then increase the value of position variable and add it with sum.if it is not 0 then make the value of position variable 1.

try yourself before see the code


uva problem solution 12531 - Hours and Minutes

problem link:

Discuss: in this problem just look at input if the angle is divided by 6 which is angle for every min has a repeated angle.so we just need to check the angle determine weather it has a repeated angle or not.


try yourself before see the code



Wednesday, June 7, 2017

uva problem soltuion 11849 - CD

problem link:

Discuss: In this problem you can easily do with map.you can also do it by for loop. here i am using map.in at just simply increment the number which duplicate.

try yourself before see the code



Tuesday, June 6, 2017

uva problem solution 10935 - Throwing cards away I

problem link:


Discuss: in this problem you have to print first element from queue and pop second element and then push it again in queue. and print the last element.

if you know queue then it's simple problem for you.clear queue using while loop


try yourself before see the code


Monday, June 5, 2017

uva problem solution 494 - Kindergarten Counting Game


problem link:

Discuss : In this problem you can check str[i] th element in range a to z or A to Z
if it is then make word increment and flag=0 if str[i] th element not in the range then make flag again 1.

 try yourself before see the code


Thursday, June 1, 2017

Uva problem solution 11743 - Credit Check


problem link

Discuss: This is just easy applied problem.You can take input using %1d specifier or using char string.then easily calculate the value and check last digit using remainder.

try yourself before see the code