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

Piratek-(akaDK) How can we find the end of input file? [13] // Problem 1001. Reverse Root 31 Dec 2006 14:17
I think it's easy problem we can use something like
binary search for find answer , but how can we read
input data :
if it will be input.txt we can do like that
 while not eof do
but it's now console
KIRILL(ArcSTU) Re: How can we find the end of input file? [12] // Problem 1001. Reverse Root 31 Dec 2006 17:56
You don't need to use binary search
All numbers can be stored in extended type
Delete Re: How can we find the end of input file? [11] // Problem 1001. Reverse Root 1 Jan 2007 03:45
If so then it's very simple, but i'm getting WA :(
Isn't simple recurse with sqrt() function not right? why?

I obviously can't read the input correctly.
I do it this way:

while not eof do
begin
  read(a);
  ...
end;
...

Is that right?

Edited by author 01.01.2007 04:03

Edited by author 01.01.2007 04:03
KIRILL(ArcSTU) Re: How can we find the end of input file? [9] // Problem 1001. Reverse Root 1 Jan 2007 04:21
Yes of course sqrt(), but
trouble is to get numbers from flow
You should read text char by char until eof
Numbers can be stored in array without recursion

Edited by author 01.01.2007 04:33
KIRILL(ArcSTU) Re: How can we find the end of input file? [7] // Problem 1001. Reverse Root 1 Jan 2007 15:05
KIRILL(ArcSTU) wrote 1 January 2007 04:21
Yes of course sqrt(), but
trouble is to get numbers from flow
You should read text char by char until eof
Numbers can be stored in array without recursion

Edited by author 01.01.2007 04:33
I'm stupid :)
It can be solved simple with seekeof
while not seekeof do
...
 read(number);
...

Edited by author 01.01.2007 15:22
Roma Labish[Lviv NU] Re: How can we find the end of input file? [6] // Problem 1001. Reverse Root 1 Jan 2007 20:44
How I can do it on C++ ??
Kit see FAQ again (-) [1] // Problem 1001. Reverse Root 1 Jan 2007 21:01


Edited by author 01.01.2007 21:02
Life is short... Re: see FAQ again (-) // Problem 1001. Reverse Root 1 Jan 2007 21:40
thanks, seekeof works fine :)
Yes,I can't do it too!
It annoyed me for a long time:

[code deleted]

Where's my problem!

Edited by author 03.02.2007 13:22

Edited by moderator 13.02.2007 20:57
Roma Labish[Lviv NU] Re: How can we find the end of input file? [2] // Problem 1001. Reverse Root 3 Feb 2007 14:32
1-st "int" is not enough to input
2-nd try to use printf instead setprecision.
Roma Labish[Lviv NU] Re: How can we find the end of input file? [1] // Problem 1001. Reverse Root 3 Feb 2007 14:37
Here is your AC program:
But better is to use only array, not stack!!!

[code deleted]

Edited by moderator 13.02.2007 20:57
And how can I find the end of input using Java? FAQ says nothing about it...

Does it work?
while (in.nextToken() != StreamTokenizer.TT_EOF) {
  // ...
}
You can use "seekeof" function instead of "eof". It presented even in BP7.0, so you can easily find description.