Комментарии
На windva → Codeforces Round 899 (Div. 2) Editorial, 3 года назад
0

Got you, thanks a lot.

Can you tell me how you noticed the problem in code and came up with a test to prove it?

I want to improve my CP skills, thanks!

На windva → Codeforces Round 899 (Div. 2) Editorial, 3 года назад
0

I'm curious to know if anyone did this approach solving the problem A ??, because it keeps failing for me for some case, even though I tested it in with a lot of cases:

  1. n = int(input())
  2. tests = []
  3.  
  4.  
  5. def no_one_repeat(array1, array2):
  6.     for a, b in zip(array1, array2):
  7.         if a == b:
  8.             return False
  9.     return True
  10.  
  11.  
  12. for x in range(n):
  13.     _ = input()
  14.     tests.append(list(map(int, input().split())))
  15.  
  16. for test in tests:
  17.     suppose_min = len(test)
  18.     done = False
  19.     while not done:
  20.         array = [suppose_min — i for i in reversed(range(len(test)))]
  21.         if no_one_repeat(test, array):
  22.             print(suppose_min)
  23.             done = True
  24.         suppose_min += 1