# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
856345 | vjudge1 | Password (RMI18_password) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
string s,a,b,ans;
int x=1,ss;
int main()
{
ios::sync_with_stdio(false);
//freopen("pass.in","r",stdin);
//freopen("pass.out","w",stdout);
cin>>s;
ss=s.size();
s=" "+s;
a=s[1];
b=s[ss];
s.erase(ss,1);
s.erase(1,1);
ss-=2;
for(int c=1;c<=ss;c++)
{
a+=s[c];
b=s[ss]+b;
if(a==b&&s.find(a)!=-1)
{
ans=a;
}
ss-=2;
if(ss<3) break;
}
if(ans=="") cout<<"qwerty";
else cout<<ans;
return 0;
}