Page 1 of 1

814 - The Letter Carrier's Rounds

Posted: Tue Oct 14, 2003 1:39 pm
by Dominik Michniewski
Could anyone help me and post some tricky IO for this problem ?
What should I print in such cases:
1 - MTA of sender doesn't exist. Should I print "connection between ..." or not ?
2 - mail sender doesn't exist in MTA ?

Any help would be great :-)

Best regards
DM

Posted: Wed Nov 05, 2003 6:39 am
by carneiro
These cases do not exist.

I've asserted my program to check for that .

But I still get Wrong Answer anyway ... don't know why (actually, i've got no idea why)

I'm looking for good Inputs !!!!!!!!!! please all you accepted people !

here's my test input

Code: Select all

MTA London 4 Fiona Paul Heather Nevil
MTA SanFrancisco 3 Mario Luigi Shariff
MTA Paris 3 Jacque Suzanne Maurice
MTA HongKong 3 Chen Jeng Hee
MTA MexicoCity 4 Conrado Estella Eva Raul
MTA Cairo 3 Hamdy Tarik Misa
*
Hamdy@Cairo Eminem@MexicoCity Conrado@MexicoCity Shariff@SanFrancisco Lisa@MexicoCity Eva@MexicoCity
*
Congratulations on your efforts !!
--Hamdy
*
Fiona@London Chen@HongKong Natasha@Paris
*
Thanks for the report! --Fiona
*
Paul@London Maurice@Paris Eva@MexicoCity Misa@Cairo Fiona@London Jacque@Paris
*
Testando essa merda pqp!
*
*
And this is MY WA output :

Code: Select all

Connection between Cairo and MexicoCity
     HELO Cairo
     250
     MAIL FROM:<Hamdy@Cairo>
     250
     RCPT TO:<Eminem@MexicoCity>
     550
     RCPT TO:<Conrado@MexicoCity>
     250
     RCPT TO:<Lisa@MexicoCity>
     550
     RCPT TO:<Eva@MexicoCity>
     250
     DATA
     354
     Congratulations on your efforts !!
     --Hamdy
     .
     250
     QUIT
     221
Connection between Cairo and SanFrancisco
     HELO Cairo
     250
     MAIL FROM:<Hamdy@Cairo>
     250
     RCPT TO:<Shariff@SanFrancisco>
     250
     DATA
     354
     Congratulations on your efforts !!
     --Hamdy
     .
     250
     QUIT
     221
Connection between London and HongKong
     HELO London
     250
     MAIL FROM:<Fiona@London>
     250
     RCPT TO:<Chen@HongKong>
     250
     DATA
     354
     Thanks for the report! --Fiona
     .
     250
     QUIT
     221
Connection between London and Paris
     HELO London
     250
     MAIL FROM:<Fiona@London>
     250
     RCPT TO:<Natasha@Paris>
     550
     QUIT
     221
Connection between London and Paris
     HELO London
     250
     MAIL FROM:<Paul@London>
     250
     RCPT TO:<Maurice@Paris>
     250
     RCPT TO:<Jacque@Paris>
     250
     DATA
     354
     Testando essa merda pqp!
     .
     250
     QUIT
     221
Connection between London and MexicoCity
     HELO London
     250
     MAIL FROM:<Paul@London>
     250
     RCPT TO:<Eva@MexicoCity>
     250
     DATA
     354
     Testando essa merda pqp!
     .
     250
     QUIT
     221
Connection between London and Cairo
     HELO London
     250
     MAIL FROM:<Paul@London>
     250
     RCPT TO:<Misa@Cairo>
     250
     DATA
     354
     Testando essa merda pqp!
     .
     250
     QUIT
     221
Connection between London and London
     HELO London
     250
     MAIL FROM:<Paul@London>
     250
     RCPT TO:<Fiona@London>
     250
     DATA
     354
     Testando essa merda pqp!
     .
     250
     QUIT
     221

Posted: Sun Aug 29, 2004 1:57 am
by UFP2161
Did you consider this line in the output section?
Also a message is addressed to the same user only once.

814

Posted: Mon Oct 24, 2005 10:24 am
by problem_solver
Hello all,

still can't figure out why 814 was not accepted. Have found here that you have to check for duplicate recipients: "z@z.com z@z.com". But no one mention about another problem - you also have to check for more than one spaces between recipients:

Input:

Code: Select all

MTA London 4 Fiona Paul Heather Nevil
MTA SanFrancisco 3 Mario Luigi hariff
MTA Paris 3 Jacque Suzanne Maurice
MTA HongKong 3 Chen Jeng Hee
MTA MexicoCity 4 Conrado Estella Eva Raul
MTA Cairo 3 Hamdy Tarik Misa
*
Hamdy@Cairo    Conrado@MexicoCity     Shariff@SanFrancisco    Shariff@SanFrancisco    Lisa@MexicoCity
*
Congratulations on your efforts !!
--Hamdy
*
Fiona@London Chen@HongKong Natasha@Paris
*
Thanks for the report!  --Fiona
*
*
Output:

Code: Select all

Connection between Cairo and MexicoCity
     HELO Cairo
     250
     MAIL FROM:<Hamdy@Cairo>
     250
     RCPT TO:<Conrado@MexicoCity>
     250
     RCPT TO:<Lisa@MexicoCity>
     550
     DATA
     354
     Congratulations on your efforts !!
     --Hamdy
     .
     250
     QUIT
     221
Connection between Cairo and SanFrancisco
     HELO Cairo
     250
     MAIL FROM:<Hamdy@Cairo>
     250
     RCPT TO:<Shariff@SanFrancisco>
     550
     QUIT
     221
Connection between London and HongKong
     HELO London
     250
     MAIL FROM:<Fiona@London>
     250
     RCPT TO:<Chen@HongKong>
     250
     DATA
     354
     Thanks for the report!  --Fiona
     .
     250
     QUIT
     221
Connection between London and Paris
     HELO London
     250
     MAIL FROM:<Fiona@London>
     250
     RCPT TO:<Natasha@Paris>
     550
     QUIT
     221
Now instead of WA I've received Presentation Error. Where/Why, please somebody help me.

Thank you in advance!

Posted: Mon Oct 24, 2005 12:09 pm
by problem_solver
I have found world Finals Solution:
http://contest.mff.cuni.cz/archive/finl1999/

but even this solution gives WA... :(

Posted: Thu Mar 30, 2006 8:59 pm
by sclo
If you get a PE, check this statement in the description:
No innecessary spaces should be printed
It turns out that the message may contain trailing spaces that you need to remove.
Also, if after you remove trailing spaces, the line of message is empty, then you don't print the 5 spaces.

By the way, the world finals solution for that site gives WA for a couple of the problems, so don't take it seriously.