QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#508443#7656. EszettUmokWA 0ms3700kbC++20825b2024-08-07 15:35:072024-08-07 15:35:08

Judging History

你现在查看的是最新测评结果

  • [2024-08-07 15:35:08]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3700kb
  • [2024-08-07 15:35:07]
  • 提交

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