Submission #931252

#TimeUsernameProblemLanguageResultExecution timeMemory
931252PlayVoltzThree Friends (BOI14_friends)Cpython 3
0 / 100
1043 ms12716 KiB
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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...