From f7432edaf382954e1dacfc4833b3120a64546163 Mon Sep 17 00:00:00 2001 From: TienNM Date: Wed, 2 Aug 2023 08:17:26 +0700 Subject: [PATCH] Update main.py --- main.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 79e2e92..64f845f 100644 --- a/main.py +++ b/main.py @@ -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") \ No newline at end of file