Are you sure that it was your mistake and not that your source uses ceill?sjn wrote:Sorry, what i mean is "ceil"

i made the mistake when i posted the topic

ceill is a valid C99 function and handles long double...

Ciao!!!

Claudio

**Moderator:** Board moderators

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

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

- 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

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

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
```

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
```

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
```

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

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
```

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
```

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
```

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 can't believe myself . . .

I get WA with;

I get WA with;

I get AC with;remaintime=ceil(remainbyte/(transferbyte/5.0));

printf(" Time remaining: %ld seconds\n",long(remaintime));

only chainge is ceil in printf function...remaintime=remainbyte/(transferbyte/5.0);

printf(" Time remaining: %ld seconds\n",long(ceil(remaintime)));

What is the type of the remaintime variable?Rajib wrote:I can't believe myself . . .

I get WA with;I get AC with;remaintime=ceil(remainbyte/(transferbyte/5.0));

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

printf(" Time remaining: %ld seconds\n",long(ceil(remaintime)));

Ciao!!!

Claudio

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

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

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