Update main.py

This commit is contained in:
2023-08-02 08:17:26 +07:00
parent 3e4fbc6092
commit f7432edaf3
+10 -4
View File
@@ -1,17 +1,23 @@
import random
from collections import defaultdict
n = 55
seq_length = 7
match_times = 7
n = 45
seq_length = 6
match_times = 6
max_generation = 1000000000000
sequence_count = defaultdict(int)
count = 0
while True:
while count < max_generation:
sequence = random.sample(range(1, n + 1), seq_length)
sequence.sort()
seq = tuple(sequence)
sequence_count[seq] += 1
if sequence_count[seq] == match_times:
print(count)
print(seq)
break
count += 1
print("Done")