Monthly Archives: March 2016

UVA 12798 – Handball Solution

My code:

 

Simulation and Modelling

Here I will Share Single Channel Server Queuing System Details

Web Engineering

Will share the modular arithmetic solution here soon.

Artificial Intelligence

Will share something about this topic soon

Codeforces Solution : Theatre Square

Here to remember:

– Theatre square is rectangular shape n X m meters
–  Each flagstone is of the size a X a

What is the least number of flagstones needed to pave the Square ?

Condition:
-Cover of  more than Theatre area will be allowed but Theatre Square need to covered.
-Flagstones will not be broken.It must be a X a
-The sides of flagstones should be parallel to the sides of the square

So algorithm/Hints:

1. Input n,m,a
2. rowside=n/a;
3. coloumnside=m/a;
4. We don’t need point value so x=ceil(rowside),y=ceil(coloumnside)
5. pave the whole square with x*y;
why n/a or m/a : we need to find out this relation using some brain storming to apply the equation in code and we need some mathematics tricks for this

code:

 

 

 

UVA 12541-Birthdates Solutions

Took hints from here:
http://www.outsbook.com/uva/?page=latest_post&category=-1&id=12541
and https://github.com/morris821028/UVa/blob/master/volume125/12541%20-%20Birthdates.cpp
Code:

Some links for future use:
http://reza22cse.blogspot.com/2014/01/uva-12541-birthdates.html
https://github.com/dibery/UVa/blob/master/contest/vol125/12541.cpp
https://gist.github.com/I-See-You/e8066e0b3a2ffbf5430e
http://ajmarin.alwaysdata.net/codes/problems/1501/

UVA Solution 11547 – Automatic Answer

Editorial:
Actually I was facing the problem how can make the second digit from the left that named as tens column.

So I did this algorithm.

1.First made the steps for n
2. Then made the n divided by 10 and take only the pure value no fraction
3. Then made the pure value divided with 10 as we want to find out the 10th’s coloumns
4. Then for the negative I used the absolute value builtin function.

Reference:
https://saicheems.wordpress.com/2013/11/15/uva-11547-automatic-answer/

Code:

 

UVA solution 11455 – Behold my quadrangle

Editorial:
we need to read those :
https://en.wikipedia.org/wiki/Quadrilateral
https://www.mathsisfun.com/quadrilaterals.html

And one thing to be remebered that to be a quadrangle we have to follow this condition:
a+b+c+d=360
so a<=b+c+d  && b<=a+c+d && c<=b+c+d

and for square every side is same and for rectangle opposite side is same

 

strength=pain;