zoukankan      html  css  js  c++  java
  • 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")
    	
    

      

  • 相关阅读:
    tp5 select回显
    toFixed
    用js来实现银行家算法
    js 日期证有效性验的通用方法
    js获取或判断任意数据类类型的通用方法(getDataType)和将NodeList转为数组(NodeListToArray)
    js实现jquery函数animate动画效果
    js原生实现 无缝滚动图片
    scrollTop实现图像循环滚动(实例1)
    commonCookie.js
    delphi XE3解析JSON数据
  • 原文地址:https://www.cnblogs.com/beiyuoi/p/6011704.html
Copyright © 2011-2022 走看看