aboutsummaryrefslogtreecommitdiff
path: root/boca-1.5.0/doc/problemexamples/problemtemplate/run/cpp
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-08-22 14:39:03 +0000
committercassiopc <cassiopc@gmail.com>2012-08-22 14:39:03 +0000
commitfc7990c62d85fdebef4a438a1fbc9d69a3710d55 (patch)
treeba6e1a305b0e63fbeb719e1a682c8e5e578b726e /boca-1.5.0/doc/problemexamples/problemtemplate/run/cpp
parent059e2fdcf0cef7e3594a66e21b3fd682ac736856 (diff)
downloadboca-fc7990c62d85fdebef4a438a1fbc9d69a3710d55.tar.gz
boca-fc7990c62d85fdebef4a438a1fbc9d69a3710d55.zip
small bug fixes, inclusion of file size limit configurable
Diffstat (limited to 'boca-1.5.0/doc/problemexamples/problemtemplate/run/cpp')
-rwxr-xr-xboca-1.5.0/doc/problemexamples/problemtemplate/run/cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/boca-1.5.0/doc/problemexamples/problemtemplate/run/cpp b/boca-1.5.0/doc/problemexamples/problemtemplate/run/cpp
index e5c7620..b46e5f9 100755
--- a/boca-1.5.0/doc/problemexamples/problemtemplate/run/cpp
+++ b/boca-1.5.0/doc/problemexamples/problemtemplate/run/cpp
@@ -15,14 +15,15 @@
# // You should have received a copy of the GNU General Public License
# // along with this program. If not, see <http://www.gnu.org/licenses/>.
# ////////////////////////////////////////////////////////////////////////////////
-#Last modified: 21/july/2012 by cassio@ime.usp.br
+#Last modified: 22/aug/2012 by cassio@ime.usp.br
#
# parameters are:
# $1 exe_file
# $2 input_file
# $3 timelimit (limit to run all the repetitions, by default only one repetition)
# $4 number_of_repetitions_to_run (optional, can be used for better tuning the timelimit)
-# $5 maximum allowed memory (in KBytes)
+# $5 maximum allowed memory (in MBytes)
+# $6 maximum allowed output size (in KBytes)
#
# the output of the submission should be directed to the standard output
#
@@ -66,11 +67,11 @@ if [ "$1" == "" -o "$2" == "" -o "$3" == "" ]; then
exit 43
fi
if [ ! -x "$1" ]; then
- echo "$1 not found or it's not executable"
+ echo "$1 not found (or is not in the current dir) or it's not executable"
exit 44
fi
if [ ! -r "$2" ]; then
- echo "$2 not found or it's not readable"
+ echo "$2 not found (or is not in the current dir) or it's not readable"
exit 45
fi
if [ ! -x $sf ]; then
@@ -98,6 +99,12 @@ if [ "$5" != "" ]; then
maxm=${5}000
fi
fi
+maxf=1024
+if [ "$6" != "" ]; then
+ if [ "$6" -gt "0" ]; then
+ maxf=${6}
+ fi
+fi
cp "$2" stdin0 2>/dev/null
cp "$1" run.exe 2>/dev/null
@@ -110,7 +117,7 @@ fi
cdir=`pwd`
echo "Current directory is $cdir -- chrooting on it" >&2
-$sf -F10 -r$nruns -n1 -R$cdir -C. -U$bocau -G$bocag -ostdout0 -estderr0 -d$maxm -m$maxm -t$time -T$ttime -istdin0 ./run.exe
+$sf -F10 -f$maxf -r$nruns -n1 -R$cdir -C. -U$bocau -G$bocag -ostdout0 -estderr0 -d$maxm -m$maxm -t$time -T$ttime -istdin0 ./run.exe
ret=$?
if [ $ret -gt 10 ]; then
ret=0