Exemplo n.º 1
0
 def fetch_problems(self):
     query = '''
         SELECT contest_id, p_index, name, type, rating, tags, start_time
         FROM problem
     '''
     res = self.conn.execute(query).fetchall()
     if res is None: return None
     return [(cf.Problem(*r[:6]), r[6]) for r in res]
Exemplo n.º 2
0
 def _unsquish_tags(problem):
     args, tags = problem[:-1], json.loads(problem[-1])
     return cf.Problem(*args, tags)