| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1094223 | Samakahhh | 세 명의 친구들 (BOI14_friends) | C++14 | 1066 ms | 10404 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
string s;
cin >>n>>s;
int cnt = 0 ;
string ans = "" ;
for(int i=0;i<n;i++){
string s1 = "" ;
for(int j=0;j<n;j++){
if(i == j)
continue ;
else{
s1 += s[j] ;
}
}
int k = n - 1;
if(k % 2 == 1){
continue ;
}
bool is = 1 ;
string q = "" ;
for(int i = 0 ; i < k / 2 ; i++){
if(s1[i] != s1[i + k / 2]){
is = 0 ;
}
q += s1[i] ;
}
if(is == 1){
cnt++ ;
ans = q ;
}
}
if(cnt == 0){
cout << "NOT POSSIBLE" << endl ;
}
else if(cnt == 1){
cout << ans << endl ;
}
else{
cout << "NOT UNIQUE" << endl ;
}
return 0;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
