ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1001. Reverse Root

how to define the size of the array?
Posted by sera 19 Dec 2007 14:38
at first i wrote like this:

[CODE DELETED]

it says Crash (access violation) #9
from the sentence  "A size of the input stream does not exceed 256 KB " and all integers are 64bit,1 byte equals 8bits, so 64bits equals 8byte,so the input contains 256*1024/8 = 32768 integers.but why the "double temp[33000]"
doesnt work?
I have tried to change double temp[33000] to double temp[1000000],it works.....
I think i must be wrong somewhere in my conduction,can someone tell me where?thanks -_-

Edited by author 20.12.2007 06:24
Re: how to define the size of the array?
Posted by Alias (Alexander Prudaev) 20 Dec 2007 00:41
the input is not binary it is text file
so 256 KB of text can contain about 128000 pairs of symbols "1 " and it is 128000 numbers "1"

Edited by author 20.12.2007 00:43
Re: how to define the size of the array?
Posted by sera 20 Dec 2007 06:22
why is about 128000 pairs of symbols '1',is it the reason that the text file is like this:
1 1 1 1 1 1,there would be a blank between two digits,
so the actualy number of numbers should be 256*1024/2?
thank you!
Re: how to define the size of the array?
Posted by sera 20 Dec 2007 06:35
i have tried ,the test data is strong the 128000 get acess violation,256*1024/2 could make it