Page 1 of 2

11058 - Encoding

Posted: Sun Aug 06, 2006 6:03 pm
by Ashkankhan
can any body give i/o for this problem.I got WA :cry:

Re: 11058 : Encoding

Posted: Sun Aug 06, 2006 7:15 pm
by arsalan_mousavian
Ashkankhan wrote:can any body give i/o for this problem.I got WA :cry:
hi dear ashkan ,
it's good to see you , i think this problem is so trivial , maybe you did a little mistake , and i am not so good in generating IO ( i wish i could :wink: ), but you can PM me your code , and i'll check it 4 u
yours
Arsalan

Re: 11058 : Encoding

Posted: Sun Aug 06, 2006 9:54 pm
by Martin Macko
Ashkankhan wrote:can any body give i/o for this problem.I got WA :cry:
I don't think this problem has any special cases... 8) If you wish, just post your code here. Facing it some huge random inputs with outputs generated by AC could help to find the mistake.

Thanx

Posted: Mon Aug 07, 2006 6:58 am
by Ashkankhan
thanx Dear Arsalan.I got AC.
But is there faster algorithm for this problem?

Re: Thanx

Posted: Mon Aug 07, 2006 8:04 am
by Martin Macko
Ashkankhan wrote:thanx Dear Arsalan.I got AC.
But is there faster algorithm for this problem?
In what sense a faster algorithm do you want? There is no asymptotically faster algorithm, as this one does not do much more than just reading the input. However, you can prune your input routines to read the input quicker, but this does not make your algorithm asymptotically faster.

Re: Thanx

Posted: Mon Aug 07, 2006 9:23 am
by arsalan_mousavian
Ashkankhan wrote:thanx Dear Arsalan.I got AC.
But is there faster algorithm for this problem?
i don't think so , because this problem is so easy , it's a kind of simulation problem , and no need to think in order to solve it , but if you change your "cr" first dimension from 1005 to 100 ,and when you update the array up to strlen ( a ) instead of 1005, it would be faster

yours
Arsalan

I/O

Posted: Wed Aug 09, 2006 8:07 am
by _.B._
Greetings!
Anyone willing to post critical I/O?
I believe I'm missing something of the description of the problem :o
Or, at least, the ACed output for this input:

Code: Select all

ufrn
t
o
w
k
q
z
f
n
y
i
c
m
s
j
n
r
g
l
d
s
u
s
g
y
e
u
14
0 q t
0 j f
1 v d
1 r o
1 f d
1 r o
1 f a
2 e p
2 r w
2 v e
2 f x
3 y p
3 t m
3 u k

Posted: Wed Aug 09, 2006 8:13 am
by Darko
This is my output for your input:

Code: Select all

Case #1: The encoding string is uawj.


This is the only one I got in one try, I was surprised by it. I think the only thing that was close to being tricky was that you have to update your rule table every time there is a change (for all remaining steps, not just that one).

Fast!

Posted: Wed Aug 09, 2006 8:16 am
by _.B._
That's some pretty fast answer Darko! 8)
Thanks a lot! :lol:
My output is wrong :S
Going to check why.

Posted: Wed Aug 09, 2006 8:17 am
by Darko
Heh, I didn't see the time, I already edited it :)
(added a comment)

Posted: Fri Aug 11, 2006 5:00 pm
by ytsejam
This problem looks simple, but with this code, I get RE.
Someone can explain me what's wrong?
The test case above gives correct result.

Code: Select all

Now AC
Input buffer overflow, what a silly error!
Thanks Martin Macko

Posted: Fri Aug 11, 2006 7:17 pm
by leocm
I really don't know where is the mistake... Could anyone explain me?

Code: Select all

T every body!

Why I am getting WA? Help plzzzzzzzz

Posted: Sat Aug 12, 2006 5:09 am
by Mushfiqur Rahman
I am getting WA with this code.
Here is my code:

Code: Select all

Removed after AC

Posted: Sat Aug 12, 2006 7:22 pm
by Martin Macko
leocm wrote:I really don't know where is the mistake... Could anyone explain me?
Not working for:

Code: Select all

aaaaaa
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
2
2 a b
4 a a
The correct output:

Code: Select all

Case #1: The encoding string is aabbaa.

Your code outputs one 'a' less.

Re: Why I am getting WA? Help plzzzzzzzz

Posted: Sat Aug 12, 2006 7:23 pm
by Martin Macko
Mushfiqur Rahman wrote:I am getting WA with this code.
Here is my code:
Not working for the same test case as I've just posted above.