제출 #931251

#제출 시각아이디문제언어결과실행 시간메모리
931251PlayVoltz세 명의 친구들 (BOI14_friends)Cpython 3
0 / 100
1006 ms12600 KiB
import sys n = int(sys.stdin.readline()) s = sys.stdin.readline().strip() ans = "" count = 0 def is_permutation(s1, s2): return s1==s2 for i in range(1, n + 1): temp = s[:(i - 1)] + s[i:] if is_permutation(temp[:n//2], temp[n//2:]): count += 1 ans = temp[:n//2] if count > 1: break if count == 0: print("NOT POSSIBLE") elif count == 1: print(ans) else: print("NOT UNIQUE")
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...