309 - FORCAL

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

Moderator: Board moderators

Post Reply
Mano2K
New poster
Posts: 1
Joined: Mon Sep 30, 2002 2:40 am

309 - FORCAL

Post by Mano2K »

After I figured out that comments starts with "--", not with "-" (that's what the html says), the problem made some sense. But is there anything special about them?

I says "no part of any comment is a token". That could mean two things:
a) if you find a "--", ignore the rest of the line
b) if you find a "--" with no valid token in the rest of the line, THEN it is a comment

I though it was the first one, but I got WA. The second one doesn't exactly make sense, but who knows? :(

Can anyone help me with it?

junbin
Experienced poster
Posts: 174
Joined: Mon Dec 08, 2003 10:41 am

Post by junbin »

if you find a -- ignore the rest of the line.

..
A great helper
Posts: 454
Joined: Thu Oct 18, 2001 2:00 am
Location: Hong Kong

309 - Need help for fixing PE

Post by .. »

I get PE on 309, I think the reason is, for the sample input:

A123 A123 )
01.2 A B
C

sample output:
A123 A123
)
01
TOKEN ERROR

I don't understand why I need to put "A123 A123" in one line.
My program outputs this:
A123
A123
)
01
TOKEN ERROR

Could anyone kindly tell what I missed in the problem?
Thanks!
My signature:
  • Please make discussion about the algorithm BRFORE posting source code.
    We can learn much more in discussion than reading source code.
  • I HATE testing account.
  • Don't send me source code for debug.

little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post by little joey »

My program also outputs the two A123 on separate lines, but gets Accepted without P.E. So there must be something else.
One thing: I only write empty lines if they appear in the input, not after every block as in the problem statement. In fact I process the input line by line, not block by block and just echo empty lines...

..
A great helper
Posts: 454
Joined: Thu Oct 18, 2001 2:00 am
Location: Hong Kong

Post by .. »

Thanks for the hint, I get accepted.
I think the problem specifiaction need to be changed, I will mail the admin for that.
My signature:
  • Please make discussion about the algorithm BRFORE posting source code.
    We can learn much more in discussion than reading source code.
  • I HATE testing account.
  • Don't send me source code for debug.

yasseryahia
New poster
Posts: 4
Joined: Sun Aug 20, 2006 10:55 pm
Contact:

309 why WA!!!

Post by yasseryahia »

This is a simple problem and thats why I am wondering why I am getting a WA

here is how I work on it

while ( NOT EOF )
read a complete block and save it in a vector
for each line in the block
process the line till the end of it or till U find a token error- if token error ignore the rest of the block -


I have found the input file and output file on the region website and my output matches the output file so any tricky output that can give me the WA ??!!

chinaeli
New poster
Posts: 1
Joined: Wed Mar 04, 2009 8:28 pm
Location: Shanghai

309 FORCAL I got wa all the time!

Post by chinaeli »

I doubt if there exist some characters that have not been mentioned in the description , such as '!' , '?' ,etc.
However I have checked these characters , I still get wa...
I wonder "abc.a" or "abc.1" is legal. I think they are illegal , because it is said that "Identifiers are composed of letters, digits and underscores. "

Now I am hopefully want to get the offical input data and output data , please help me!
I have searched the data on the centeral europe regional offical website , but it doesn't afford the data of the contest in 1996 .
Anyone who has the data , please email me or reply the post . Thank you !!!
china.eli@gmail.com ( my email )
"When you fall in love with coding..."

Post Reply

Return to “Volume 3 (300-399)”