이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string str;
cin >> str;
string resp;
int ct=0;
for(int i=0;i<n;i++){
string x;
for(int j=0;j<n;j++)
if(j != i) x += str[j];
int k = x.size()/2;
int p1=0, p2=k;
bool consegue = true;
while(p1 < k){
if(x[p1] != x[p2]){
consegue = false;
break;
} p1++, p2++;
}
if(consegue){
ct++;
for(int j=0;j<k;j++)
resp += x[j];
}
if(ct > 1){
cout << "NOT UNIQUE\n";
return 0;
}
}
cout << (ct ? resp : "NOT POSSIBLE") << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |