codeforces/621C_flowers.py
def calculate(self):
        """ Main calcualtion function of the class """

        self.pr = []
        for i in range(self.n):
            self.pr.append(1 - self.prob(self.numa[i], self.numb[i], self.p))

        result = 0
        prev = self.pr[-1]
        for p in self.pr:
            result += (1 - p*prev)
            prev = p

        return str(result*2000)
 Main calcualtion function of the class 
Main calcualtion function of the class
Main calcualtion function of the class
def calculate(self):
        self.pr = []
        for i in range(self.n):
            self.pr.append(1 - self.prob(self.numa[i], self.numb[i], self.p))
        result = 0
        prev = self.pr[-1]
        for p in self.pr:
            result += (1 - p*prev)
            prev = p
        return str(result*2000)
def calculate ( self ) : self . pr = [ ] for i in range ( self . n ) : self . pr . append ( 1 - self . prob ( self . numa [ i ] , self . numb [ i ] , self . p ) ) result = 0 prev = self . pr [ - 1 ] for p in self . pr : result += ( 1 - p * prev ) prev = p return str ( result * 2000 )
Main calcualtion function of the class
Main calcualtion function of the class
""" Main calcualtion function of the class """
self