이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
int n,m,b[200005],a[200005],k,flag,t,mpp[50],bir,iki,uc,cev;
char c;
map<string,int> vis;
string s,ss,yaz;
int main(void){
fio();
cin>>n>>s;
cev=0;
for(int i=0;i<n;i++){
string s1{};
string s2{};
//~ if(s[i]!=c)continue;
for(int j=0;j<n;j++){
if(i==j)continue;
if((int)s1.size()<n/2)s1+=s[j];
else s2+=s[j];
}
if(s1==s2){
if(vis[s1]==0)
cev++;
yaz=s1;
vis[s1]=1;
}
}
if(cev>=2){cout<<"NOT UNIQUE\n";return 0;}
if(cev==0){cout<<"NOT POSSIBLE\n";return 0;}
cout<<yaz<<endl;
return 0;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |