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 1786. Sandro's Biography

Got WA test # 16!!! HELP!
Posted by iCE Hin 7 Aug 2011 08:33
#include <cstdio>
#include <cstring>

char s1[10] = "Sandro", s2[10] = "sANDRO", l[205], n, a[10] = "Aaaaaa" , b[10] = "Zzzzzz";
int min = 60000;

int main(){
    scanf("%s", &l);
    n = strlen(l) - 5;

    for ( int i = 0; i < n; i++ ){
        int t = 0;
        for ( int j = 0; j < 6; j++ ){
            if ( l[i+j] != s1[j] ){
                if (!( l[i+j] == s2[j] || ( l[i+j] >= a[j] && l[i+j] <= b[j] ) ))
                    t += 1;
                ++t;
            }
        }
        if ( t < min )
            min = t;
    }
    printf("%d", min*5);
    scanf("\n");
    return 0;
}
Re: Got WA test # 16!!! HELP!
Posted by Daler Qurbonov MSU_Tashkent 30 Nov 2011 04:10

Edited by author 03.12.2011 02:02

Edited by author 03.12.2011 02:02