#NEWLINE# @ api . cache . memoize ( ) #NEWLINE# def get_score_progression( tid = None , uid = None , category = None ) : #NEWLINE# #INDENT# '\n    Finds the score and time after each correct submission of a team or user.\n    NOTE: this is slower than get_score. Do not use this for getting current score.\n\n    Args:\n        tid: the tid of the user\n        uid: the uid of the user\n        category: category filter\n    Returns:\n        A list of dictionaries containing score and time\n    ' #NEWLINE# correct_submissions = api . problem . get_submissions ( uid = uid , tid = tid , category = category , correctness = True ) #NEWLINE# result = [ ] #NEWLINE# score = 0 #NEWLINE# problems_counted = set ( ) #NEWLINE# for submission in sorted ( correct_submissions , key = ( lambda sub : sub [ 'timestamp' ] ) ) : #NEWLINE# #INDENT# if ( submission [ 'pid' ] not in problems_counted ) : #NEWLINE# #INDENT# score += api . problem . get_problem ( pid = submission [ 'pid' ] ) [ 'score' ] #NEWLINE# problems_counted . add ( submission [ 'pid' ] ) #NEWLINE# #UNINDENT# result . append ( { #NEWLINE# #INDENT# 'score' : score , #NEWLINE# 'time' : int ( submission [ 'timestamp' ] . timestamp ( ) ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return result