-
Notifications
You must be signed in to change notification settings - Fork 0
/
dc.py
50 lines (39 loc) · 896 Bytes
/
dc.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from random import randint
import sys
times = sys.argv[1]
front_max=35
back_max=12
front_num=5
back_num=2
def choose_front():
start=1
ret=list()
pool=list(range(1, front_max + 1))
# print(pool)
for i in range(1, front_num + 1):
index=randint(0, front_max - start)
get=pool[index]
# print(pool, get)
ret.append(get)
start=start+1
pool.pop(index)
return ret
def choose_back():
start=1
ret=list()
pool=list(range(1, back_max + 1))
# print(pool)
for i in range(1, back_num + 1):
index=randint(0, back_max - start)
get=pool[index]
# print(pool, get)
ret.append(get)
start=start+1
pool.pop(index)
return ret
for t in range(0, int(times, 10)):
front=choose_front()
front.sort()
back=choose_back()
back.sort()
print(front, back)