<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> class QueueNode ( object ) : <EOL> def __init__ ( self , val ) : <EOL> self . val = val <EOL> self . q = [ val ] <EOL> def __cmp__ ( self , other ) : <EOL> return self . val - other . val <EOL> def __repr__ ( self ) : <EOL> return repr ( self . val ) <EOL> def next ( self ) : <EOL> self . q . pop ( <NUM_LIT:0> ) <EOL> self . val = self . q [ <NUM_LIT:0> ] <EOL> class Solution : <EOL> def kthPrimeNumber ( self , k ) : <EOL> """<STR_LIT>""" <EOL> import heapq <EOL> h1 = QueueNode ( <NUM_LIT:3> ) <EOL> h2 = QueueNode ( <NUM_LIT:5> ) <EOL> h3 = QueueNode ( <NUM_LIT:7> ) <EOL> heap = [ h1 , h2 , h3 ] <EOL> heapq . heapify ( heap ) <EOL> for cnt in xrange ( k - <NUM_LIT:1> ) : <EOL> h = heapq . heappop ( heap ) <EOL> if h == h1 : <EOL> h1 . q . append ( h1 . val * <NUM_LIT:3> ) <EOL> h2 . q . append ( h1 . val * <NUM_LIT:5> ) <EOL> h3 . q . append ( h1 . val * <NUM_LIT:7> ) <EOL> elif h == h2 : <EOL> h2 . q . append ( h2 . val * <NUM_LIT:5> ) <EOL> h3 . q . append ( h2 . val * <NUM_LIT:7> ) <EOL> else : <EOL> h3 . q . append ( h3 . val * <NUM_LIT:7> ) <EOL> h . next ( ) <EOL> heapq . heappush ( heap , h ) <EOL> return heapq . heappop ( heap ) . val <EOL> def kthPrimeNumber_error ( self , k ) : <EOL> """<STR_LIT>""" <EOL> import heapq <EOL> h1 = QueueNode ( <NUM_LIT:3> ) <EOL> h2 = QueueNode ( <NUM_LIT:5> ) <EOL> h3 = QueueNode ( <NUM_LIT:7> ) <EOL> heap = [ h1 , h2 , h3 ] <EOL> heapq . heapify ( heap ) <EOL> for cnt in xrange ( k - <NUM_LIT:1> ) : <EOL> h = heapq . heappop ( heap ) <EOL> if h == h1 : <EOL> for i in [ <NUM_LIT:3> , <NUM_LIT:5> , <NUM_LIT:7> ] : <EOL> h1 . q . append ( i * h1 . val ) <EOL> h1 . next ( ) <EOL> heapq . heappush ( heap , h1 ) <EOL> elif h == h2 : <EOL> for i in [ <NUM_LIT:5> , <NUM_LIT:7> ] : <EOL> h2 . q . append ( i * h2 . val ) <EOL> h2 . next ( ) <EOL> heapq . heappush ( heap , h2 ) <EOL> else : <EOL> for i in [ <NUM_LIT:7> ] : <EOL> h3 . q . append ( i * h3 . val ) <EOL> h3 . next ( ) <EOL> heapq . heappush ( heap , h3 ) <EOL> return heapq . heappop ( heap ) . val <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> assert Solution ( ) . kthPrimeNumber ( <NUM_LIT> ) == <NUM_LIT> </s>
