class DiffTask(Task): id = 'diff' tests = [ Test(id='01', time=1.0, score=5.0, dat=None, chk=None), Test(id='02', time=1.0, score=5.0, dat=None, chk=None), Test(id='03', time=1.0, score=5.0, dat=None, chk=None), Test(id='04', time=1.0, score=5.0, dat=None, chk=None), Test(id='05', time=1.0, score=5.0, dat=None, chk=None), Test(id='06', time=1.0, score=5.0, dat=None, chk=None), Test(id='07', time=1.0, score=5.0, dat=None, chk=None), Test(id='08', time=1.0, score=5.0, dat=None, chk=None), Test(id='09', time=1.0, score=5.0, dat=None, chk=None), Test(id='10', time=1.0, score=5.0, dat=None, chk=None), Test(id='11', time=1.0, score=5.0, dat=None, chk=None), Test(id='12', time=1.0, score=5.0, dat=None, chk=None), Test(id='13', time=1.0, score=5.0, dat=None, chk=None), Test(id='14', time=1.0, score=5.0, dat=None, chk=None), Test(id='15', time=1.0, score=5.0, dat=None, chk=None), Test(id='16', time=1.0, score=5.0, dat=None, chk=None), Test(id='17', time=1.0, score=5.0, dat=None, chk=None), Test(id='18', time=1.0, score=5.0, dat=None, chk=None), Test(id='19', time=1.0, score=5.0, dat=None, chk=None), Test(id='20', time=1.0, score=5.0, dat=None, chk=None), ] def load_dat(self, stream): N = self.read(stream, int) sequence = [] for k in range(N): sequence.append(self.read(stream, int)) return Dat(sequence=sequence) def load_chk(self, stream): return Chk(X=self.read(stream, int)) def save_dat(self, stream, dat): self.write(stream, len(dat.sequence)) for x in dat.sequence: self.write(stream, x) def load_sol(self, stream): X = self.read(stream, int) self.read(stream, None) return Sol(X=X)