Algorithm of 12608 - Garbage Collection

Problem Description Link
Algorithm
This is a simple problem this problem you can solve easily . To solve this problem you must remember 3 conditions.
Garbage truck is collecting garbage on its route starting at the dump and collecting garbage from pick up points in order (closest first). Garbage truck returns to the dump and empties its contents if it either
  1. is full or
  2. cannot load the garbage at the current point because it will put the load over the weight limit (the truck driver has no way of knowing the weight of the garbage at a particular pick up point until the truck reaches that point) or
  3. there are no more pick up points left

12608 - Garbage Collection

Problem Descriptin
source:https://uva.onlinejudge.org/external/126/12608.html



Garbage truck is collecting garbage on its route starting at the dump and collecting garbage from pick up points in order (closest first). Garbage truck returns to the dump and empties its contents if it either 
  1. is full or 
  2.  cannnot load the garbage at the current point because it will put the load over the weight limit (the truck driver has no way of knowing the weight of the garbage at a particular pick up point until the truck reaches that point) or 
  3. there are no more pick up points left 

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.


Algorithm of 11407 - Squares

Problem Description Link
Algorithm:

This is a simple problem  to solve this problem you can pre generate the number of minimum terms for all integer from 1 to 10000 and get input and check from array how many  term needed and print the value.
Process:
 For any positive integer N , N = a1$\scriptstyle \wedge$2 + a2$\scriptstyle \wedge$2 +...+ an$\scriptstyle \wedge$2 that is, any positive integer can be represented as sum of squares of other numbers.
For example you know minimum term of 1,2,3,4 and based on this value calculate others  5 to 10000 value term
1
2
3
1
2
3
4
2
1
2
1                    2                        3              4                              5              6              7                              8              9              10
For 5
S=sqrt(5)=2
Way    22+12=5 so 2 term
And  12+22=5 so 2 term
Min value=2
So

Solution of 11407 - Squares

Problem Description
source: http://uva.onlinejudge.org/external/114/11407.html

For any positive integer N, N = a 2 1 + a 2 2 + . . . + a 2 n that is, any positive integer can be represented as sum of squares of other numbers. Your task is to print the smallest ‘n’ such that N = a 2 1 + a 2 2 + . . . + a 2 n.

Input

The first line of the input will contain an integer ‘t’ which indicates the number of test cases to follow. Each test case will contain a single integer ‘N’ (1 ≤ N ≤ 10000) on a line by itself. 

image