Files
DataStructureAndAlgorithm/2023206/rand_input.py
2023-11-29 16:26:24 +08:00

23 lines
520 B
Python

import random
import os
M = random.randint(10000, 100000)
K = random.randint(10000, 100000)
H = random.randint(10000, 100000)
# M = 10000
# K = 1
# H = 1
arr = list(range(0, M))
random.shuffle(arr)
with open('fuck.txt', 'w') as f:
f.write(str(M)+' '+str(K)+' '+str(H)+'\n')
for i in arr:
f.write(str(i)+' ')
f.write('\n')
print("main")
os.system("./main.out < ./fuck.txt")
print("\ncorrect")
os.system("./correct.out < ./fuck.txt")
print("\nbrute_force")
os.system("./brute_force.out < ./fuck.txt")