This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline().strip()
ans = ""
count = 0
for i in range(1, n+1):
temp = s[:(i-1)] + s[i:]
if 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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |