ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2011. Long Statement

Frank Why WA?Who can help me? [1] // Problem 2011. Long Statement 14 Aug 2014 22:38
int main(int argc,char *argv[]){
    //freopen("data.txt","r",stdin);
    int n,i,key = 0,count = 0;
    char p[105],input[105];
    scanf("%d",&n);
    getchar();
    for(i = 0; i < n; i++){
        scanf("%c",&input[i]);
        getchar();
    }
    input[i] = '\0';
    strcpy(p,input);
    while(next_permutation(p,p+n)){
        if(strcmp(p,input) == 0){
            break;
        }
        else {
            count++;
            if(count >= 5){
                printf("Yes\n");
                return 0;
            }
        }
    }
    if(count >= 5){
        printf("Yes\n");
    }
    else {
        printf("No\n");
    }
}
froghramar Re: Why WA?Who can help me? // Problem 2011. Long Statement 11 May 2017 12:16
count should be at least 6 :)