Page 2 of 33
NO BUG????
Posted: Fri May 17, 2002 6:38 am
by minskcity
I guess you did not try "1000000000 1000000000 1 1 1 1 1 1 1".......
report
Posted: Fri May 17, 2002 6:59 am
by minskcity
At the moment I use fread/printf; my time is 0.050s with 0.010 - input, 0.030 - parsing, 0.010 - output. I'm going to try read/write now...
Is handle 0 - reading, 1 - writing?
Re: report
Posted: Fri May 17, 2002 7:38 am
by Ivan Golubev
minskcity wrote:Is handle 0 - reading, 1 - writing?
Yeah.
However I think that fread() & read works very similar. So pay attention to your printf() and parsing (well, computing also

).
compiler error
Posted: Fri May 17, 2002 12:32 pm
by minskcity
According to Valladolid Online Judge there are no file "io.h". What did you include to use read() ?
Here are the compiler error messages:
00862896_24.c:5: io.h: No existe el fichero o el directorio
Re: compiler error
Posted: Fri May 17, 2002 1:34 pm
by Ivan Golubev
minskcity wrote:According to Valladolid Online Judge there are no file "io.h". What did you include to use read() ?
Nothing. If you're using C it's not necessary to use #include. If you're using C++ define read by your own like:
int read(int, void *, unsigned int);
(or extern int read(int, void *, unsigned int); I'm never submitted solutions in C++.)
The function's code will be successfully linked to your program.
Posted: Fri May 17, 2002 3:36 pm
by Ivor
Blast it Ivan, I see you managed to regain your throne on 495. Superb... it only seems that some are trying to do it when I have no time.
btw, you seem have used asm, what was your best pure C time? Just out of curiosity. Mine's the one you had to beat.
to other people: actually it takes much more than simple IO. You must have a very good handle on many different aspects of optimization. But that's a trade secret

If you're really interested and have a good imagination you'll soon find out. All you have to do is learn it yourself. It took me more than half a year to get the current time on 102.
Ivor
P.S I'll get back to you as soon as my tests are over.

Posted: Fri May 17, 2002 5:54 pm
by Ivan Golubev
btw, you seem have used asm, what was your best pure C time? Just out of curiosity. Mine's the one you had to beat.
My best time with pure C was 0.150. And then I've switched into asm because GCC isn't my favorite compiler. It really limiting when trying to optimise something, I'm preferring to write code by my own than fighting with (dumb!) compiler

Posted: Fri May 17, 2002 5:58 pm
by Ivor
Youre wrong

C compiler is a very powerful thing. If you know how to use it, you can get the same results as with asm.
btw. I just equaled you on 495. I'll see if I can beat you.
Ivor
P.S Do you have any other ways of communicating than this board?
Posted: Fri May 17, 2002 6:20 pm
by Caesum
is inline asm in gas format for their compiler or intel ?
ie:
is it
mov eax,ebx
or
mov %ebx,%eax
??
presumably its gas since some people have mentioned gcc

Posted: Fri May 17, 2002 7:03 pm
by Ivan Golubev
Caesum wrote:is inline asm in gas format for their compiler or intel ?
Yes, it's in gas format (and I don't like it much).
Re: NO BUG????
Posted: Fri May 17, 2002 7:54 pm
by zerocool
minskcity wrote:I guess you did not try "1000000000 1000000000 1 1 1 1 1 1 1".......
The answer of my program is
BCG 1000000005
Is any bug in it ?
that's strange
Posted: Sat May 18, 2002 7:14 am
by minskcity
It printed
"BCG 1e+09"
in Borland C++ 5.02
printf
Posted: Sat May 18, 2002 9:35 am
by Fresh
Try this, it may help:
[cpp]
#include <stdio.h>
....
....
printf("%s%1.0f\n",c,min);
[/cpp]
-novice

ASM
Posted: Sat May 18, 2002 9:55 am
by Fresh
Ivor wrote:you seem have used asm
Is this mean that the Online Judge support ASM beside C/C++, Jave and Pascal? If yes, how to submit the solution or any trick to do this?
Ivor wrote:But that's a trade secret If you're really interested and have a good imagination you'll soon find out. All you have to do is learn it yourself.
Learning always need teachers but what will be happen if all teachers take their knowledge as 'trade secret'?
-novice

Re: ASM
Posted: Sat May 18, 2002 12:35 pm
by Stefan Pochmann
You can include assembler code inside programs in other languages. I've never done it, but it probably looks sth like this:
int c_function ( int n ) {
begin asm;
assembler code here
end asm;
}
The syntax is probably completely wrong, but I guess the idea is clear.
About that secrets/teachers thing: I agree, sharing knowledge and helping others is a good thing. I don't think asked for help in even a quarter of my posts. And after all, I guess not many of us are a new Ramanujan (you know, that math genius who basically invented all for himself and invented amazing new stuff):
http://www-groups.dcs.st-and.ac.uk/~his ... nujan.html