C# 클래스 Round3_2013.Problem4.WheelBruteForce

파일 보기 프로젝트 열기: eric7237cire/CodeJam

공개 메소드들

메소드 설명
E_bruteForce ( bool gondalas, int i, int j, int k, int N ) : Utils.math.BigFraction

The expected money we get while filling out the interval [i, j) so that the last filled gondola is at position (i+k) is:

P_bruteForce ( bool gondalas, int i, int j ) : Utils.math.BigFraction

so first let’s look at P(i, j), the probability that j-th gondola will stay empty while we fill up all gondolas from the interval [i, j) assuming each coming person approaches some gondola in inteval [i, j] (note that j is included here)

P_bruteForce ( bool gondalas, int i, int j, int k ) : Utils.math.BigFraction

The probability that gondola j stays empty while we fill interval [i, j) and that gondola at position (i+k) is filled last is P(i, j, k) and can be computed as:

getE_wheelFast ( bool a, int i, int j, int holeCount, int N ) : Utils.Fraction
simulateForWheelFast ( bool gondolas, IList permOrder, int N = 300 ) : int
simulatePermutation ( bool gondolas, IList permOrder, int secondToLastToFill = -1, int N = 300 ) : int

simulatePermutationExpectedValue ( bool gondolas, IList permOrder, int secondToLastToFill, int N ) : int

메소드 상세

E_bruteForce() 공개 정적인 메소드

The expected money we get while filling out the interval [i, j) so that the last filled gondola is at position (i+k) is:
public static E_bruteForce ( bool gondalas, int i, int j, int k, int N ) : Utils.math.BigFraction
gondalas bool
i int
j int
k int
N int
리턴 Utils.math.BigFraction

P_bruteForce() 공개 정적인 메소드

so first let’s look at P(i, j), the probability that j-th gondola will stay empty while we fill up all gondolas from the interval [i, j) assuming each coming person approaches some gondola in inteval [i, j] (note that j is included here)
public static P_bruteForce ( bool gondalas, int i, int j ) : Utils.math.BigFraction
gondalas bool
i int
j int
리턴 Utils.math.BigFraction

P_bruteForce() 공개 정적인 메소드

The probability that gondola j stays empty while we fill interval [i, j) and that gondola at position (i+k) is filled last is P(i, j, k) and can be computed as:
public static P_bruteForce ( bool gondalas, int i, int j, int k ) : Utils.math.BigFraction
gondalas bool True if filled, false if empty
i int
j int
k int
리턴 Utils.math.BigFraction

getE_wheelFast() 공개 정적인 메소드

public static getE_wheelFast ( bool a, int i, int j, int holeCount, int N ) : Utils.Fraction
a bool
i int
j int
holeCount int
N int
리턴 Utils.Fraction

simulateForWheelFast() 공개 정적인 메소드

public static simulateForWheelFast ( bool gondolas, IList permOrder, int N = 300 ) : int
gondolas bool
permOrder IList
N int
리턴 int

simulatePermutation() 공개 정적인 메소드

public static simulatePermutation ( bool gondolas, IList permOrder, int secondToLastToFill = -1, int N = 300 ) : int
gondolas bool
permOrder IList
secondToLastToFill int
N int
리턴 int

simulatePermutationExpectedValue() 공개 정적인 메소드

public static simulatePermutationExpectedValue ( bool gondolas, IList permOrder, int secondToLastToFill, int N ) : int
gondolas bool
permOrder IList
secondToLastToFill int
N int
리턴 int