제출 #398801

#제출 시각아이디문제언어결과실행 시간메모리
398801YaserFaisal세 명의 친구들 (BOI14_friends)C++14
0 / 100
1037 ms8240 KiB
#include <bits/stdc++.h> using namespace std ; #define int long long int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n ; cin >> n ; string s ; cin >> s ; n = s.size() ; int counter = 0 ; string ans ; for ( int i = 0 ; i < n ; i++ ) { string g = s ; g.erase(g.begin()+i) ; int x = n/2 , y = x ; if ( n%2 ) y++ ; string a = g.substr(0,x) ; string b = g.substr(x,y) ; //cout << g << " " << a << " " << b << endl ; if ( a == b ) { counter++ ; ans = a ; } } if ( counter == 0 ) cout << "NOT POSSIBLE" << endl ; else if ( counter > 1 ) cout << "NOT UNIQUE" << endl ; else cout << ans << endl ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...