Commit 5ac01dc3 authored by casesense's avatar casesense

pyjudge v0.1

parents
File added
File added
#include<stdio.h>
int main()
{
int n=0;
for(int i=0;i<6;i++){
int tmp;
scanf("%d",&tmp);
if(tmp>8){
n++;
}
}
printf("%d\n",n);
return 0;
}
num = 0
for i in range(6):
a = int(input())
if a > 8:
num = num + 1
print(num)
7
8
8
9
8
7
8
8
8
8
8
8
9
9
9
9
9
9
1
2
3
4
5
6
9
8
7
100
1000
1000
from multiprocessing import Pool
import os
import time
import random
import sys
t_start = time.time()
pool_size = 0
task_size = 0
exec_type = ""
def worker(msg):
#print("task %s start, pid %d" % (msg, os.getpid()))
os.system("bash test.sh " + exec_type)
t_stop = time.time()
print("task %s done, pid %d cost %0.2f" % (msg, os.getpid(), t_stop-t_start))
if __name__ == "__main__":
if len(sys.argv) < 3:
print("arguments error")
sys.exit(1)
pool_size = int(sys.argv[1])
task_size = int(sys.argv[2])
exec_type = sys.argv[3]
po = Pool(16) # 定义一个进程池,最大进程数3
for i in range(0,125):
po.apply_async(worker, (i,))
print("----start----")
po.close()
po.join()
print("-----end-----")
cd ./lab
exe="./c"
if [ "$1" == "python" ]; then
exe="python ./c.py"
fi
for n in `seq 1 5`
do
$exe < i$n.dat > /dev/null
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment