Algorithm of 11479 - Is this the easiest problem

Problem Description Link
Algorithm:

This is a geometric problem . you  can solve this problem easily . you can follow this stapes
       1.       At first you need three value for three sides (ie. a, b, c)
          N.B.: three sides can formed a triangle if and only if third side is greater than summation of  
             other two side   . where third side is largest value among three sides value .
             (i.e.:  5, 9, 6 where third side is 9).
 2.            if possible formed a triangle then you need to check
                ·  Equilateral  - All three sides of valid triangle are equal
·  Isosceles  - Exactly two of the sides of a valid triangle are equal.
image

Solution of 11479 - Is this the easiest problem

Problem Description
source:https://uva.onlinejudge.org/external/114/11479.html

A triangle is a geometric shape with three positive sides. However, any given three sides won’t necessarily form a triangle. The three sides must form a closed region. Triangles are categorized depending on the values of the sides of a valid triangle. In this problem you are required to determine the type of a triangle. 

Input 

The first line of input will contain a positive integer T < 20, where T denotes the number of test cases. Each of the next T lines will contain three 32 bit signed integer. 

image

Algorithm of 11462 - Age Sort

Problem Description link
Algorithm:
This problem is easy just read carefully . In this problem need only sort the value and print sorted  value.
but if you solve it by iterative way then may you can get Time Limit Exit .
So you need to use any faster sort algorithm also you can use priority queue to solve this problem easily .
image

Solution of 11462 - Age Sort

Problem Description
source:https://uva.onlinejudge.org/external/114/11462.html

You are given the ages (in years) of all people of a country with at least 1 year of age. You know that no individual in that country lives for 100 or more years. Now, you are given a very simple task of sorting all the ages in ascending order. 

Input 

There are multiple test cases in the input file. Each case starts with an integer n (0 < n ≤ 2000000), the total number of people. In the next line, there are n integers indicating the ages. Input is terminated with a case where n = 0. This case should not be processed. 

image

Algorithm of 11455 - Behold my quadrangle

Problem Description Link
Algorithm:
This is a simple problem just follow this technique
1. if four side are equal then it is called "square".
2. if any tow pair side are equal then it is called "rectangle"
3. if each side is smaller or equal sum of other three side then it is called "quadrangle".
4. otherwise "banana"

example.
 10 8 7 6 is a quadrangle because
      1. 10<=(8+7+6)
    2. 8<=(10+7+6)
    3. 7<=(10+8+6)
    4. 6<=(10+8+7)
 1 1 9 9 is rectangle because two pair are equal
    1.  1 == 1
    2.  9 == 9
image

Solution of 11455 - Behold my quadrangle

Problem Description
source: https://uva.onlinejudge.org/external/114/11455.html

Any square is a rectangle, any rectangle is a quadrangle, and any quadrangle is composed of four sides. But not all rectangles are squares, not all quadrangles are rectangles, and not all sets of four sides are quadrangles. We have the length of four sides. You have to determine if they can form a square. If not, determine if they can form a rectangle. If not, determine if they can form a quadrangle. 

Input 

The first line of the input contains an integer indicating the number of test cases. For each test case, there is a line with four positive integer numbers, between 0 and 230

image

Algorithm of 11428 - Cubes

Problem Description Link
Algorithm:

Given a positive integer N you will have to find two positive integers x and y such that:


This is a simple problem. You can just follow this technique
for this problem solution you need two loop
first loop(i) start from cubic root of N  and to sqrt of N
second loop(j) start from 1 to i
and check (i*i*i)-(j*j*j) =N or not
if equal then print i and j

Solution of 11428 - Cubes

Problem Descriptio
source:https://uva.onlinejudge.org/external/114/11428.html

Given a positive integer N you will have to find two positive integers x and y such that:
                                                               N = x3 − y3

Input 

The input file contains at most 100 lines of inputs. Each line contains a positive integer N (0 < N ≤ 10000). Input is terminated by a line containing a single zero. This line should not be processed. 
image

Solution of 11417 - GCD

Problem Description
source:https://uva.onlinejudge.org/external/114/11417.html

Given the value of N, you will have to find the value of G. The definition of G is given below:

Here GCD(i, j) means the greatest common divisor of integer i and integer j. For those who have trouble understanding summation notation, the meaning of G is given in the following code: 



G=0;
for(i=1;i<N;i++)
for(j=i+1;j<=N;j++)
{
G+=GCD(i,j);
}
/*Here GCD() is a function that finds
the greatest common divisor of the two
input numbers*/

Algorithm of 11401 - counter

Problem Description Link
Algorithm:
You are given n rods of length 1, 2…, n. You have to pick any 3 of them & build a triangle. How many distinct triangles can you make? Note that, two triangles will be considered different if they have at least 1 pair of arms with different length.
To solve this problem you can follow this technique.
if we have a triangle with sides a,b,c therefore this must be true a+b>c , a+c>b , b+c>a

if n = 3
 we have 3 sticks
 1 2 3
image