mirror of
https://github.com/tiennm99/lottery-generator-java.git
synced 2026-09-02 07:37:46 +00:00
Update main.py
This commit is contained in:
@@ -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")
|
||||
Reference in New Issue
Block a user