Solution of 12578 - 10:6:2

Problem Description
source: https://uva.onlinejudge.org/external/125/12578.html

The national flag of Bangladesh is bottle green in color and rectangular in size with the length (L) to width ratio of 10:6. It bears a red circle on the background of green. It maintains the length (L) to radius ratio of 5:1 (If the length is 10 then width should be 6 and radius should be 2). The color in the background represents the greenery of Bangladesh while the red circle symbolizes the rising sun and the sacrifice of lives in our freedom fight. 

Input 

Algorithm of 12405 - Scarecrow

Problem Description Link
Algorithm:
This is a easy problem just you get a string
scan each character until length of string
if character is '.' then replace the next character by '#'  and
increase the counter value and set position=position+2;
some input/output:
image

Solution of 12405 - Scarecrow

Problem Description
source: https://uva.onlinejudge.org/external/124/12405.html

Taso owns a very long field. He plans to grow different types of crops in the upcoming growing season. The area, however, is full of crows and Taso fears that they might feed on most of the crops. For this reason, he has decided to place some scarecrows at different locations of the field. 

The field can be modeled as a 1×N grid. Some parts of the field are infertile and that means you cannot grow any crops on them. A scarecrow, when placed on a spot, covers the cell to its immediate left and right along with the cell it is on. 

Algorithm of 11933 - Splitting Numbers

Problem Description Link
Algorithm:

This is a simple problem the operation of splitting a binary number n into two numbers a(n), b(n) .
you need to convert decimal to binary format for a given number and from that binary format create two numbers
a(n) and b(n). To build first value a(n) need to choice 1st  1  ,3rd  1, 5th  1,..... so on same position of original binary format other position fii by the value 0.
To build second value b(n) need to choice 2nd  1  ,4th  1, 6th  1,..... so on same position of original binary format other position fill by the value 0.

for example
image

Solution of 11933 - Splitting Numbers

Problem Description
source:https://uva.onlinejudge.org/external/119/11933.html

We define the operation of splitting a binary number n into two numbers a(n), b(n) as follows. Let 0 ≤ i1 < i2 < . . . < ik be the indices of the bits (with the least significant bit having index 0) in n that are 1. Then the indices of the bits of a(n) that are 1 are i1, i3, i5, . . . and the indices of the bits of b(n) that are 1 are i2, i4, i6, . . .
For example, if n is 110110101 in binary then, again in binary, we have a = 010010001 and b = 100100100.


Solution of 11559 - Event Planning

Problelm description
source: http://uva.onlinejudge.org/external/115/11559.html

As you didn’t show up to the yearly general meeting of the Nordic Club of Pin Collectors, you were unanimously elected to organize this years excursion to Pin City. You are free to choose from a number of weekends this autumn, and have to find a suitable hotel to stay at, preferably as cheap as possible. You have some constraints: The total cost of the trip must be within budget, of course. All participants must stay at the same hotel, to avoid last years catastrophe, where some members got lost in the city, never being seen again.