Skip to main content

Posts

Showing posts from March 25, 2018

SRM 732 Round 1

I woke up early today for SRM ( 7 AM ) . I solved 2 problems DIV-2 Easy and Medium. DIV-2 easy is just an implementation problem.  Problem Statement of DIV-2 easy      You found a deck of slightly non-traditional playing cards. Each card has a value and a suit. The value of each card is a positive integer, and the suit is a lowercase English letter ('a'-'z'). We will use (v, s) to denote a card with value v and suit s. You want to know whether the deck is perfect. A perfect deck has two properties: All cards in the deck are distinct. (I.e., no two cards share both value and suit.) For any two cards (v1, s1) and (v2, s2) in the deck, the deck also contains the cards (v1, s2) and (v2, s1). You are given the following data:

1185. Wall Timus Online Judge

The problem states that, A greedy king wants to build a wall around his castle with minimum cost and wall should not come closer to the castle than a certain distance. Given N Cartesian 2D points and minimum distance between castle and wall is  L .  To solve the problem , At first I build a convex hull using the points .  The wall should be L distance from castle . So, we need another 4 * acos(0.0) * L length ( Summing up all round length of each point of the convex hull ) .  Problem ::  Wall