Tags » Graphs

UVA-852: Deciding victory in Go

The Problem

Given a certain Go board position; decide the number of points of each player.

Source: UVA-852: Deciding victory in Go

My Solution

I do floodfill returning the number of dots (‘.’). 275 more words

UVA Solutions

UVA-11953: Battleships

The Problem

Ships in battleship game can vary in size from 1 x 1 to 1 x N/2 and can be placed both vertically and horizontally. 317 more words

UVA Solutions

UVA-11094: Continents

The Problem

Maps are given as M x N tables, filled with at most two different letters denoting land and water regions. A continent is a set of connected land regions which is completely surrounded by water regions or the end of map. 280 more words

UVA Solutions

UVA-11906: Knight in War Grid

The Problem

Given a grid as large as 100 x 100 which has some squares with water, and a knight who can move M squares horizontally and N squares vertically, or M squares vertically and N squares horizontally in a single move (0 <= M, N 0), count the number of odd and even marked squares that the knight can reach if he starts from square (0,0). 456 more words

UVA Solutions

Leverage and Markets Peak?

It was an interesting week in respect of leverage, when one recalls that the 1998 market swoon was accompanied by the LTCM “black-box” collapse, leveraged at 5 times and the 2007/09 market rout which saw the demise of Lehman Bros bank, leveraged 30 X. 201 more words

Investment

UVA-12442: Forwarding Emails

The Problem

Martians get those sorts of emails too, but they have an innovative way of dealing with them. Instead of just forwarding them willy-nilly, or not at all, they each pick one other person they know to email those things to every time – … 247 more words

UVA Solutions

UVA-10926: How many dependencies?

The Problem

In this problem you will need to find out which task has the most number of dependencies. A task A depends on another task… 310 more words

UVA