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 1219. Symbolic Sequence

I've got WA#1
Posted by Mihran Hovsepyan {1 kurs of <RAU>} 4 Jun 2008 14:51
Is my algo wrong?
This is my solution


# include <stdio.h>
main()
{
    int i=0,m,g,k=0;
    const int n=100000;
//    const char AZ[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
    const char az[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
    while(i!=n)
    {
        for(m=k;m+k<26&&i<n;m++)
            for(g=0;g<26&&i<n;g++)
            {
                printf("%c",az[m%26]);
                i++;
                printf("%c",az[g]);
                i++;
            }
        k++;
        k%=26;
    }
    return 0;
}