제출 #897000

#제출 시각아이디문제언어결과실행 시간메모리
897000Nexus세 명의 친구들 (BOI14_friends)C++17
0 / 100
49 ms2552 KiB
#include <iostream> #include <vector> #include <map> #include <set> #include <math.h> #include <string> #include <algorithm> #include <random> #include <iomanip> #include <utility> #include <cstring> //#include <bits/stdc++.h> #define ll long long #define s .size() using namespace std; const ll N=1e5+9,M=1e18+9,mod=1e9+7; //cout<<fixed<<setprecision(6)<< ll n,x,y; string a,b; map<char,ll>m; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n>>a; if(!(n%2))goto end; for(ll i=0;i<n;++i)++m[a[i]]; for(auto i:m)if(i.second%2)++x,y=i.second; end: if(x!=1)cout<<"NOT POSSIBLE"; else if(y>1)cout<<"NOT UNIQUE"; else{ for(ll i=0;i<n;++i) if(m[a[i]]>1)b+=a[i]; n/=2; for(ll i=0;i<n;++i)cout<<b[i]; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...