102 - Ecological Bin Packing
Moderator: Board moderators
NO BUG????
I guess you did not try "1000000000 1000000000 1 1 1 1 1 1 1".......
-
- Experienced poster
- Posts: 167
- Joined: Fri Oct 19, 2001 2:00 am
- Location: Saint Petersburg, Russia
Re: report
Yeah.minskcity wrote:Is handle 0 - reading, 1 - writing?
However I think that fread() & read works very similar. So pay attention to your printf() and parsing (well, computing also

compiler error
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
Here are the compiler error messages:
00862896_24.c:5: io.h: No existe el fichero o el directorio
-
- Experienced poster
- Posts: 167
- Joined: Fri Oct 19, 2001 2:00 am
- Location: Saint Petersburg, Russia
Re: compiler error
Nothing. If you're using C it's not necessary to use #include. If you're using C++ define read by your own like:minskcity wrote:According to Valladolid Online Judge there are no file "io.h". What did you include to use read() ?
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.
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.

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


Ivor
P.S I'll get back to you as soon as my tests are over.

-
- Experienced poster
- Posts: 167
- Joined: Fri Oct 19, 2001 2:00 am
- Location: Saint Petersburg, Russia
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!) compilerbtw, you seem have used asm, what was your best pure C time? Just out of curiosity. Mine's the one you had to beat.

-
- Experienced poster
- Posts: 167
- Joined: Fri Oct 19, 2001 2:00 am
- Location: Saint Petersburg, Russia
Re: NO BUG????
The answer of my program isminskcity wrote:I guess you did not try "1000000000 1000000000 1 1 1 1 1 1 1".......
BCG 1000000005
Is any bug in it ?
A mediocrityboy
that's strange
It printed
"BCG 1e+09"
in Borland C++ 5.02
"BCG 1e+09"
in Borland C++ 5.02
printf
Try this, it may help:
[cpp]
#include <stdio.h>
....
....
printf("%s%1.0f\n",c,min);
[/cpp]
-novice
[cpp]
#include <stdio.h>
....
....
printf("%s%1.0f\n",c,min);
[/cpp]
-novice

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:you seem have used asm
Learning always need teachers but what will be happen if all teachers take their knowledge as 'trade secret'?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.
-novice

-
- A great helper
- Posts: 284
- Joined: Thu Feb 28, 2002 2:00 am
- Location: Germany
- Contact:
Re: ASM
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
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