QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#508443 | #7656. Eszett | Umok | WA | 0ms | 3700kb | C++20 | 825b | 2024-08-07 15:35:07 | 2024-08-07 15:35:08 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
string s,t;
int cnt,p;
int main()
{
cin>>s;
t=s+s;
int i,j,l;
for(i=0;i<s.size()&&p!=2;i++)
{
p=0;
if(t[i]=='(')cnt++;
else if(t[i]==')')cnt--;
if(!cnt)
{
for(j=0,l=0;j<s.size();j++,l++)
{
if(s[j]!=t[i+1+l])
{
p++;
break;
}
}
for(j=s.size()-1,l=0;p==1&&j>=0;j--,l++)
{
if(s[j]==t[i+1+l])
{
p++;
break;
}
}
}
}
if(p==2)
{
for(int k=i;k<i+s.size();k++)cout<<t[k];
}
else cout<<"no";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3700kb
input:
AUFREISSEN
output:
UFREISSENA
result:
wrong answer invalid string