362 - 18,000 Seconds Remaining

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

CDiMa
Experienced poster
Posts: 214
Joined: Fri Oct 17, 2003 5:49 pm
Location: Genova

Post by CDiMa » Tue Feb 03, 2004 11:10 am

sjn wrote:Sorry, what i mean is "ceil" :(
i made the mistake when i posted the topic
Are you sure that it was your mistake and not that your source uses ceill?
ceill is a valid C99 function and handles long double...

Ciao!!!

Claudio

Dejarik
New poster
Posts: 32
Joined: Sun Mar 07, 2004 1:23 pm
Location: Barcelona, SPAIN
Contact:

362 - 18.000 seconds remaining. Please this input

Post by Dejarik » Sun Mar 07, 2004 1:30 pm

I'm guessed to be very near from the Accepted Answer. Please, may you help me by testing this simple input in your correct 362's implementations?

Maybe i will found my problem here. Thanks in advance.

My input is
  • 210
    20
    19
    18
    17
    16
    15
    14
    13
    12
    11
    10
    9
    8
    7
    6
    5
    4
    3
    2
    1
    10
    1
    0
    1
    0
    1
    0
    1
    0
    1
    0
    1
    0
    1
    0
    1
    0
    1
    0
    1
    5
    1
    0
    0
    0
    0
    1
    0
    0
    0
    0
    1
    0
    0
    0
    0
    1
    0
    0
    0
    0
    0
    0
    0
    0
    1
    0
And my output succeeded in my WA implementation:
  • Output for data set 1, 210 bytes:
    Time remaining: 7 seconds
    Time remaining: 5 seconds
    Time remaining: 2 seconds
    Time remaining: 0 seconds
    Total time: 20 seconds

    Output for data set 2, 10 bytes:
    Time remaining: 12 seconds
    Time remaining: 13 seconds
    Time remaining: 4 seconds
    Total time: 19 seconds

    Output for data set 3, 5 bytes:
    Time remaining: 20 seconds
    Time remaining: 15 seconds
    Time remaining: 10 seconds
    Time remaining: 5 seconds
    Time remaining: 0 seconds
    Total time: 25 seconds

User avatar
angga888
Experienced poster
Posts: 143
Joined: Sat Dec 21, 2002 11:41 am
Location: Indonesia

Post by angga888 » Sun Mar 07, 2004 2:49 pm

Your output is the same with my AC solution.
Maybe you should care about output formatting.

Hope it helps,
angga888

Dejarik
New poster
Posts: 32
Joined: Sun Mar 07, 2004 1:23 pm
Location: Barcelona, SPAIN
Contact:

Post by Dejarik » Sun Mar 07, 2004 3:05 pm

Why do you mean with 'output formatting'? Can you show me an example?

Thank you very much!


PD: Does your program finish each iteration with:

[c]printf("Total time: %d seconds\n\n",time);[/c]

or with

[c]printf("Total time: %d seconds\n",time);[/c]

I don't know if an extra /n at the end of the output will make execution fail... Thanks again

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

Post by junbin » Tue Mar 09, 2004 2:24 am

If it is a simple one more line, one less line thing, then you'd get PE.. so I think you probably have a +1/-1 bug somewhere... try posting random data of very long length.. I'll post my results and then you can compare a bit.

Dejarik
New poster
Posts: 32
Joined: Sun Mar 07, 2004 1:23 pm
Location: Barcelona, SPAIN
Contact:

Post by Dejarik » Tue Mar 09, 2004 3:58 pm

Thank you very much junbin. Please try this input in your 362 accepted problem.

Code: Select all

980
32
23
22
48
38
28
36
4
9
31
10
2
42
44
52
11
19
93
22
42
33
21
48
0
32
0
42
0
1
0
14
94
0
44
43
465
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
10
0
My output is the next one:

Code: Select all

Output for data set 1, 980 bytes:
   Time remaining: 26 seconds
   Time remaining: 33 seconds
   Time remaining: 19 seconds
   Time remaining: 10 seconds
   Time remaining: 9 seconds
   Time remaining: 23 seconds
   Time remaining: 0 seconds
Total time: 35 seconds

Output for data set 2, 465 bytes:
   Time remaining: 150 seconds
   Time remaining: 52 seconds
   Time remaining: 27 seconds
   Time remaining: 15 seconds
   Time remaining: 7 seconds
   Time remaining: 0 seconds
Total time: 30 seconds

Output for data set 3, 10 bytes:
   Time remaining: stalled
   Time remaining: stalled
   Time remaining: stalled
   Time remaining: stalled
Total time: 23 seconds
Thanks again!

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

Post by junbin » Tue Mar 09, 2004 4:58 pm

my answer is exactly the same. :p

Code: Select all

Output for data set 1, 980 bytes:
   Time remaining: 26 seconds
   Time remaining: 33 seconds
   Time remaining: 19 seconds
   Time remaining: 10 seconds
   Time remaining: 9 seconds
   Time remaining: 23 seconds
   Time remaining: 0 seconds
Total time: 35 seconds

Output for data set 2, 465 bytes:
   Time remaining: 150 seconds
   Time remaining: 52 seconds
   Time remaining: 27 seconds
   Time remaining: 15 seconds
   Time remaining: 7 seconds
   Time remaining: 0 seconds
Total time: 30 seconds

Output for data set 3, 10 bytes:
   Time remaining: stalled
   Time remaining: stalled
   Time remaining: stalled
   Time remaining: stalled
Total time: 23 seconds

though you may wanna go through the spelling and stuff just to make sure.

Dejarik
New poster
Posts: 32
Joined: Sun Mar 07, 2004 1:23 pm
Location: Barcelona, SPAIN
Contact:

Post by Dejarik » Tue Mar 09, 2004 6:24 pm

I can't understand where is my fuc**** mistake in my solutions

My only chance is to try with large numbers as the total amount of bytes (for possible overflows). Did you realized similar tests with this problem when you was trying to get its correct answer?

I think i will let this problem as impossible for me... I will focus my time on other problems...

Thank you by the way, we will be in contact if needed with our tries...

Joan

;-)

Dejarik
New poster
Posts: 32
Joined: Sun Mar 07, 2004 1:23 pm
Location: Barcelona, SPAIN
Contact:

Post by Dejarik » Wed Mar 10, 2004 10:40 pm

Hey, if you have an ACCEPTED answer for this problem, please can you check this input and report its results here?

I think i'm VERY near from the correct solution, but still WA

Code: Select all

500000
100000
100000
100000
100000
0
100000
5000000
1000000
1000000
1000000
1000000
0
1000000
500000000
100000000
100000000
100000000
100000000
0
100000000
5000000000
1000000000
1000000000
1000000000
1000000000
0
Thanks in advance! Joan

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

Post by junbin » Thu Mar 11, 2004 12:28 am

3rd data gave a very long string of "stalled"
4th data crashed my program


Output for data set 1, 500000 bytes:
Time remaining: 2 seconds
Total time: 6 seconds

Output for data set 2, 5000000 bytes:
Time remaining: 2 seconds
Total time: 6 seconds

Dejarik
New poster
Posts: 32
Joined: Sun Mar 07, 2004 1:23 pm
Location: Barcelona, SPAIN
Contact:

Post by Dejarik » Thu Mar 11, 2004 1:25 am

Of course, i was wrong while posting my example. Sorry junbin, this is the correct one. Thank you very much for the time spent on me.

Code: Select all

500000 
100000 
100000 
100000 
100000 
0 
100000 
5000000 
1000000 
1000000 
1000000 
1000000 
0 
1000000 
500000000 
100000000 
100000000 
100000000 
100000000 
0 
100000000 
5000000000 
1000000000 
1000000000 
1000000000 
1000000000 
0
1000000000 
0
And my output is the next one. For the last try, it makes an overflow, does like yor program? Thanks!!

Code: Select all

Output for data set 1, 500000 bytes:
   Time remaining: 2 seconds
Total time: 6 seconds

Output for data set 2, 5000000 bytes:
   Time remaining: 2 seconds
Total time: 6 seconds

Output for data set 3, 500000000 bytes:
   Time remaining: 2 seconds
Total time: 6 seconds

Output for data set 4, 705032704 bytes:
   Time remaining: -16 seconds
Total time: 6 seconds
Joan

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

Post by junbin » Thu Mar 11, 2004 1:39 pm

Code: Select all

Output for data set 1, 500000 bytes:
   Time remaining: 2 seconds
Total time: 6 seconds

Output for data set 2, 5000000 bytes:
   Time remaining: 2 seconds
Total time: 6 seconds

Output for data set 3, 500000000 bytes:
   Time remaining: 2 seconds
Total time: 6 seconds

Output for data set 4, 705032704 bytes:
Total time: 1 seconds

Output for data set 5, 1000000000 bytes:
Total time: 1 seconds

Output for data set 6, 1000000000 bytes:
Total time: 2 seconds

I think set 4 caused my program to overflow and so anything after set 3 should be invalid.

Rajib
New poster
Posts: 28
Joined: Tue Nov 04, 2003 6:45 am
Location: Bangladesh

Bug in judge

Post by Rajib » Mon Jun 21, 2004 2:56 pm

I can't believe myself . . . :o :o :o

I get WA with;
remaintime=ceil(remainbyte/(transferbyte/5.0));
printf(" Time remaining: %ld seconds\n",long(remaintime));
I get AC with;
remaintime=remainbyte/(transferbyte/5.0);
printf(" Time remaining: %ld seconds\n",long(ceil(remaintime)));
only chainge is ceil in printf function...

CDiMa
Experienced poster
Posts: 214
Joined: Fri Oct 17, 2003 5:49 pm
Location: Genova

Re: Bug in judge

Post by CDiMa » Tue Jun 22, 2004 8:55 am

Rajib wrote:I can't believe myself . . . :o :o :o

I get WA with;
remaintime=ceil(remainbyte/(transferbyte/5.0));
printf(" Time remaining: %ld seconds\n",long(remaintime));
I get AC with;
remaintime=remainbyte/(transferbyte/5.0);
printf(" Time remaining: %ld seconds\n",long(ceil(remaintime)));
only chainge is ceil in printf function...
What is the type of the remaintime variable?

Ciao!!!

Claudio

User avatar
Ghust_omega
Experienced poster
Posts: 115
Joined: Tue Apr 06, 2004 7:04 pm
Location: Venezuela

WA -- help 362 18,000 seconds remaining

Post by Ghust_omega » Thu Sep 02, 2004 5:34 am

Hi!! I get WA for 362 , anyone help me and give me tricky inputs
I dont know where its wrong, i try all the inputs before posted and i got the same answer :(
Any help would be appreciated

Thanks in advance

Post Reply

Return to “Volume 3 (300-399)”