11058 - Encoding

All about problems in Volume 110. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Ashkankhan
New poster
Posts: 12
Joined: Wed Oct 13, 2004 10:14 am
Location: Teh
Contact:

11058 - Encoding

Post by Ashkankhan » Sun Aug 06, 2006 6:03 pm

can any body give i/o for this problem.I got WA :cry:

User avatar
arsalan_mousavian
Experienced poster
Posts: 111
Joined: Mon Jan 09, 2006 6:19 pm
Location: Tehran, Iran
Contact:

Re: 11058 : Encoding

Post by arsalan_mousavian » Sun Aug 06, 2006 7:15 pm

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
In being unlucky I have the record.

User avatar
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Re: 11058 : Encoding

Post by Martin Macko » Sun Aug 06, 2006 9:54 pm

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.

Ashkankhan
New poster
Posts: 12
Joined: Wed Oct 13, 2004 10:14 am
Location: Teh
Contact:

Thanx

Post by Ashkankhan » Mon Aug 07, 2006 6:58 am

thanx Dear Arsalan.I got AC.
But is there faster algorithm for this problem?

User avatar
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Re: Thanx

Post by Martin Macko » Mon Aug 07, 2006 8:04 am

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.

User avatar
arsalan_mousavian
Experienced poster
Posts: 111
Joined: Mon Jan 09, 2006 6:19 pm
Location: Tehran, Iran
Contact:

Re: Thanx

Post by arsalan_mousavian » Mon Aug 07, 2006 9:23 am

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
In being unlucky I have the record.

User avatar
_.B._
Experienced poster
Posts: 160
Joined: Sat Feb 07, 2004 7:50 pm
Location: Venezuela
Contact:

I/O

Post by _.B._ » Wed Aug 09, 2006 8:07 am

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
_.

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko » Wed Aug 09, 2006 8:13 am

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).

User avatar
_.B._
Experienced poster
Posts: 160
Joined: Sat Feb 07, 2004 7:50 pm
Location: Venezuela
Contact:

Fast!

Post by _.B._ » Wed Aug 09, 2006 8:16 am

That's some pretty fast answer Darko! 8)
Thanks a lot! :lol:
My output is wrong :S
Going to check why.
_.

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko » Wed Aug 09, 2006 8:17 am

Heh, I didn't see the time, I already edited it :)
(added a comment)

ytsejam
New poster
Posts: 3
Joined: Tue Aug 01, 2006 5:27 pm

Post by ytsejam » Fri Aug 11, 2006 5:00 pm

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
Last edited by ytsejam on Sat Aug 12, 2006 8:43 pm, edited 1 time in total.

leocm
New poster
Posts: 22
Joined: Fri Jul 21, 2006 9:44 am
Location: Brasil

Post by leocm » Fri Aug 11, 2006 7:17 pm

I really don't know where is the mistake... Could anyone explain me?

Code: Select all

T every body!
Last edited by leocm on Thu Aug 17, 2006 6:49 pm, edited 1 time in total.

Mushfiqur Rahman
Learning poster
Posts: 56
Joined: Tue Jun 13, 2006 5:18 pm
Location: (CSE, SUST) Sylhet, Bangladesh
Contact:

Why I am getting WA? Help plzzzzzzzz

Post by Mushfiqur Rahman » Sat Aug 12, 2006 5:09 am

I am getting WA with this code.
Here is my code:

Code: Select all

Removed after AC
Last edited by Mushfiqur Rahman on Sat Mar 03, 2007 3:21 pm, edited 1 time in total.

User avatar
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Post by Martin Macko » Sat Aug 12, 2006 7:22 pm

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.

User avatar
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Re: Why I am getting WA? Help plzzzzzzzz

Post by Martin Macko » Sat Aug 12, 2006 7:23 pm

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.

Post Reply

Return to “Volume 110 (11000-11099)”