Files
DataStructureAndAlgorithm/2023206/rand_input.py
2023-11-29 19:30:25 +08:00

27 lines
602 B
Python

import random
import os
m = random.randint(10000, 100000)
k = random.randint(10000, 65535)
h = random.randint(10000, 100000)
# M = 10000
# K = 1
# H = 1
arr = list(range(2147483647, 2147483647 - m, -1))
# print(len(arr) == M)
arr.append(0)
m += 1
random.shuffle(arr)
# print(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")