10026 - Shoemaker's Problem

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

Moderator: Board moderators

Marcelo
New poster
Posts: 6
Joined: Sun Sep 30, 2007 7:53 pm

Post by Marcelo »

Ok!
----
Acho que penso, logo, acho que existo!
ddddcccc30
New poster
Posts: 6
Joined: Sat Oct 06, 2007 4:30 am
Contact:

Post by ddddcccc30 »

I have tried the test datas , ans I had right answers.
But I don't know whyI still have W.A.
Should I post my code?
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

Yes.
Ami ekhono shopno dekhi...
HomePage
ddddcccc30
New poster
Posts: 6
Joined: Sat Oct 06, 2007 4:30 am
Contact:

Post by ddddcccc30 »

Thank you so much!

If my thinking is approximately right ,you can just give me some examples that my program would return wrong answers.

I think I could try to find the mistakes by myself.

Code: Select all

...
(Sorry,I am not good at speaking or writing English...)
Last edited by ddddcccc30 on Tue Oct 09, 2007 7:00 am, edited 1 time in total.
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

Your code looks correct. But you have some wrong in your output.

1. Don't print a space after any line. The sample output is

Code: Select all

2.1.3.4
here '.' represents a space.
2. The outputs of two consecutive cases will be separated by a blank line. But your are printing a blank line after every case.

Hope these help.
Ami ekhono shopno dekhi...
HomePage
ddddcccc30
New poster
Posts: 6
Joined: Sat Oct 06, 2007 4:30 am
Contact:

Post by ddddcccc30 »

I am sorry, I don't completely understand your second point.(I know that's what the problem says.)

But I changed my code, I hope I guess right.

Code: Select all

. . . 
Last edited by ddddcccc30 on Tue Oct 09, 2007 2:07 pm, edited 1 time in total.
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

Check the set carefully.

Input:

Code: Select all

2

4
3 4
1 1000
2 2
5 5

4
3 4
1 1000
2 2
5 5
Output:

Code: Select all

2 1 3 4^
^
2 1 3 4^
Where '^' represents a newline character. Hope these help.
Ami ekhono shopno dekhi...
HomePage
ddddcccc30
New poster
Posts: 6
Joined: Sat Oct 06, 2007 4:30 am
Contact:

Post by ddddcccc30 »

I am sorry to trouble you a lot.

But I still get W.A. :evil:

I am now wondering if my answer is really wrong.

Code: Select all

. . .
Last edited by ddddcccc30 on Wed Oct 10, 2007 4:35 am, edited 1 time in total.
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

Your code is correct now! Just read the description again. Your code can overflow. So, change the following parts.

Code: Select all

long long paymoney(int);
...
long long flag,newflag;
...
long long paymoney(int a) 
{ long long i,sumdays=0,sum;
...
}
Hope these help.
Ami ekhono shopno dekhi...
HomePage
ddddcccc30
New poster
Posts: 6
Joined: Sat Oct 06, 2007 4:30 am
Contact:

Post by ddddcccc30 »

Thank you so much~

Overflow...

Anyway, thank you. I finally got Accepted.
cz.guardian
New poster
Posts: 4
Joined: Thu Oct 25, 2007 3:00 pm

Post by cz.guardian »

Hi there, i've a little problem with my code. Every single result is fine but still have WA. I dunno why. If is it possible can i post my code??
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

You can post your code.
Ami ekhono shopno dekhi...
HomePage
cz.guardian
New poster
Posts: 4
Joined: Thu Oct 25, 2007 3:00 pm

Post by cz.guardian »

Code: Select all

. . .
Last edited by cz.guardian on Sat Oct 27, 2007 4:51 am, edited 7 times in total.
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

Read the i/o specifications again. Your code can't pass the samples.
The input begins with a single positive integer on a line by itself indicating the number of the cases following, each of them as described below. This line is followed by a blank line, and there is also a blank line between two consecutive inputs.
Ami ekhono shopno dekhi...
HomePage
cz.guardian
New poster
Posts: 4
Joined: Thu Oct 25, 2007 3:00 pm

Post by cz.guardian »

Yeah, I wasn't sure if it is input or just a newline. Thx but still can't pass (I tried this option even before)
Post Reply

Return to “Volume 100 (10000-10099)”