TopcoderArchive
Archive
Algorithm problem

CavernExplorer

Problem statement, definition, constraints, and public examples.

Problem Statement

A snowman was reported to be seen in one of the caverns in The Himalayas. Unfortunately, people can't exactly point the cavern, so you need to explore all of them until you'll find the snowman (or, at least, some evidence of his existence).

The ith element of time gives you the time you need to check whether the snowman lives in the ith cavern. The ith element of probability represents the probability the snowman lives in the ith cavern. Return the minimal expected time you'll need to spend to find the snowman's location.

Definition

Class:
CavernExplorer
Method:
findSnowman
Parameters:
int[], int[]
Returns:
double
Method signature:
double findSnowman(int[] probability, int[] time)
(be sure your method is public)

Constraints

    Examples

      No public sample cases were explicitly marked for this problem in the original data.

      Back to all problems