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 1404. Easy to Hack!

I'm good with you (C++ ->AC<-):)
Posted by alexutz_mircescu 20 Oct 2007 23:25
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>

int i,u,n,minus,v[128],aux,auxs;
char st[128],auxx;

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("1404.in","r",stdin);
    freopen("1404.out","w",stdout);
    #endif
    scanf("%s",st);
    u=strlen(st);
    for(i=0;i<u;i++)
        v[i]=(int)(st[i])-'a';
    for(i=0;i<u;i++)
    {
        if(i==0)
            v[i]+=26;
        else
            while(v[i]<v[i-1])
                v[i]+=26;
    }
    minus=5;
    for(i=0;i<u;i++)
    {
        auxs=st[i]-st[i]+(v[i]-minus)%26+'a';
        printf("%c",auxs);
        minus=v[i];
    }
    return 0;
}

Re: I'm good with you (C++ ->AC<-):)
Posted by Alias (Alexander Prudaev) 21 Oct 2007 00:24
please stop post AC code. read FAQ.
It is wrong to post AC code. if somebody asks you to
help, then you can give him some hints. it is all.