제출 #944672

#제출 시각아이디문제언어결과실행 시간메모리
944672tamir1세 명의 친구들 (BOI14_friends)C++17
0 / 100
1060 ms8936 KiB
#include<bits/stdc++.h> #define ll long long using namespace std; ll n,i,cnt,ans; string t,u,s; bool check(string s){ ll n=s.size(),i; for(i=0;i<n/2;i++){ if(s[i]!=s[i+n/2]) return 0; } return 1; } int main(){ cin >> n >> u; if(n%2==0){ cout << "NOT POSSIBLE"; return 0; } for(i=0;i<n;i++){ t=u; t.erase(t.begin()+i); if(check(t)){ ans=i; cnt++; s=t; } } if(cnt==0) cout << "NOT POSSIBLE"; else if(cnt>1) cout << "NOT UNIQUE"; else{ for(i=0;i<n/2;i++) cout << s[i]; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...