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!

why time limitexeted????
Posted by ooo 14 Dec 2008 13:53
#include <iostream.h>
int main()
{const int n=100;
char a[101];
int i,b[n];
for(i=0;i<n;i++) cin>>a[i];
for(i=0;i<n;i++) b[i]=a[i]-'a';
if(b[0]<=5) b[0]=b[0]+26;
for(i=1;i<=n;i++) while(a[i]<a[i-1]) b[i]=b[i]+26;
for(i=1;i<=n;i++) b[i]=b[i]-b[i-1];
b[0]=b[0]-5;
for(i=0;i<n;i++) a[i]=(b[i]+'a');
for(i=0;i<n;i++) cout<<a[i]<<endl; return 0;}
Re: why time limitexeted????
Posted by Galen Georgiev 28 Apr 2009 01:12
You have 6 - "for"!!!
1000^6 work over second

Edited by author 28.04.2009 01:13