Tip

Windows 开栈命令

-Wl,--stack=1000000000 //stack-size B

 

Linux 开栈命令

-ulimit -a
-ulimit -s size //stack-size KB

 

Linux 永久开栈

sudo gedit /etc/profile

在最后添加一句

-ulimit -s size

  

 

Gedit 配置

#!/bin/sh

name=$GEDIT_CURRENT_DOCUMENT_NAME
pre=`echo $name | cut -d. -f1`
suf=`echo $name | cut -d. -f2`

if [ $suf = "cpp" ]; then
	echo "Compiling...";
	g++ $name -o $pre -O2 -lm -std=c++11 &&	echo "Compiled Success!";
	gnome-terminal -x bash -c "./$pre; echo; echo 'Please Press Enter to continue';read"
elif [ $suf = "py" ]
then
	gnome-terminal -x bash -c "python3 $name"
fi

  

 

自己闲的用Python写的对拍模板

from random import *
from os import *
from time import *
from sys import *
from math import *
from decimal import *

Time = 1.0
Case = 2
Comp = True
Ord  = "-O2 -lm -std=c++11"

if(Comp):
	for i in range(1,Case+1):
		system("g++ "+str(i)+".cpp -o "+str(i)+" "+Ord)

T = 1
while(True):
	print(("%6d")%T,end="->    ")
#	system("./mkd > in.in")
	system("python3 mkd.py > in.in")
	flagT = False
	flagR = False
	flagW = False
	
	for i in range(1,Case+1):
		tt=time()
		if(system("./"+str(i)+" < in.in > "+str(i)+".out")):
			flagR = True
		tt=time()-tt
		print((str(i)+":"+"%.3f")%(tt),end="    ")
		if(tt>Time):
			flagT = True
	
	for i in range(2,Case+1):
		if(system("diff -b 1.out "+str(i)+".out")):
			flagW = True
	print("")
	T+=1
	
	if(flagT):
		print("Time Limits Error")
	if(flagR):
		print("Runtime Error")
	if(flagW):
		print("WrongAnswer")
	
	if(flagT or flagR or flagW):
		break
		
		
		
for i in range(1,Case+1):
	print(i,end=":")
	system("time ./"+str(i)+" "+"<in.in")
	

  

 

posted @ 2016-10-29 20:13  北北北北屿  阅读(525)  评论(2编辑  收藏  举报