comparison problem.py @ 77:69eadc60f4e2

Memory limit is now applied to the RSS when os.wait4 is available
author Oleg Oshmyan <chortos@inbox.lv>
date Thu, 13 Jan 2011 19:47:35 +0200
parents 0e5ae28e0b2b
children 06356af50bf9
comparison
equal deleted inserted replaced
76:0e5ae28e0b2b 77:69eadc60f4e2
1 #! /usr/bin/env python 1 #! /usr/bin/env python
2 # Copyright (c) 2010 Chortos-2 <chortos@inbox.lv> 2 # Copyright (c) 2010-2011 Chortos-2 <chortos@inbox.lv>
3 3
4 from __future__ import division, with_statement 4 from __future__ import division, with_statement
5 5
6 try: 6 try:
7 from compat import * 7 from compat import *
141 granted = case(lambda: (say('%7.3f%s s, ' % (case.time_stopped - case.time_started, case.time_limit_string), end=''), sys.stdout.flush())) 141 granted = case(lambda: (say('%7.3f%s s, ' % (case.time_stopped - case.time_started, case.time_limit_string), end=''), sys.stdout.flush()))
142 except testcases.CanceledByUser: 142 except testcases.CanceledByUser:
143 verdict = 'canceled by the user' 143 verdict = 'canceled by the user'
144 except testcases.TimeLimitExceeded: 144 except testcases.TimeLimitExceeded:
145 verdict = 'time limit exceeded' 145 verdict = 'time limit exceeded'
146 except testcases.MemoryLimitExceeded:
147 verdict = 'memory limit exceeded'
146 except testcases.WrongAnswer: 148 except testcases.WrongAnswer:
147 e = sys.exc_info()[1] 149 e = sys.exc_info()[1]
148 if e.comment: 150 if e.comment:
149 verdict = 'wrong answer (%s)' % e.comment 151 verdict = 'wrong answer (%s)' % e.comment
150 else: 152 else: