Search found 12 matches

by Carthage
Mon Nov 03, 2003 5:59 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 50590

Your program is reading off from a file. All programs regardless of language are supposed to read from the standard input stream (stdin) and write to the standard output stream (stdout).
by Carthage
Sun Nov 02, 2003 7:58 pm
Forum: C++
Topic: automatic header inclusion
Replies: 4
Views: 2669

Ummm, can you force the compiler to do a strict C++ compile?? I think there should be an option...
by Carthage
Sun Nov 02, 2003 7:42 pm
Forum: Volume 1 (100-199)
Topic: 103 - Stacking Boxes
Replies: 200
Views: 24064

Yes, 101 is a real problem, probably because I misunderstood the instructions. :P My first algorithm gives the correct sample output, but with the inputs here, it went haywire! Anyway, it took me about a dozen WAs before I finally knew that the algorithm was wrong. Anyway, 118 is an easier problem. :)
by Carthage
Sun Nov 02, 2003 6:28 pm
Forum: C++
Topic: automatic header inclusion
Replies: 4
Views: 2669

Try renaming your files with a .CPP extension. I don't know about gcc, but in Borland compilers, they use the file extension to determine what type of action to take with the file. They aren't so strict with a .C file, but Borland compilers require that you explicity #include the right header files ...
by Carthage
Sun Nov 02, 2003 6:23 pm
Forum: Other words
Topic: Microsecond Running Times!
Replies: 10
Views: 2687

Maarten wrote: What's the last 1% ?
Oops. Forgot it. :) Probably should be with the majority...
by Carthage
Fri Oct 31, 2003 7:42 pm
Forum: Other words
Topic: Microsecond Running Times!
Replies: 10
Views: 2687

BTW, I sent a WA 107. Although I don't think that my algorithm is right, what intrigued me was that according to the results, my program ran in 0.534 seconds using as much as 64k of memory. 64k is impossible considering that I used a really big lookup table that takes about a megabyte of memory. So ...
by Carthage
Fri Oct 31, 2003 7:29 pm
Forum: Other words
Topic: Microsecond Running Times!
Replies: 10
Views: 2687

Your function seems ok to me. Your mistake should be somewhere else. If you use scanf to get the numbers, then do not forget to put a getchar(); after. I thought I was flushing out the standard input stream if the input comes from a file, so I removed fflush(), then recompiled my program, but now i...
by Carthage
Fri Oct 31, 2003 6:56 pm
Forum: Other words
Topic: Microsecond Running Times!
Replies: 10
Views: 2687

Hi, I've just solved 101. Before that, it took about 10 tries before it got accepted. I was so sure of my code it baffled me as to how it could get WA. I used this... [cpp]const int MAX = 80; // Utility function to read from stdin. bool readLine(char *stream) { if(stream == NULL) throw "Valid stream...
by Carthage
Thu Oct 30, 2003 6:28 pm
Forum: Other words
Topic: Microsecond Running Times!
Replies: 10
Views: 2687

Microsecond Running Times!

Hello, I'm new here and I was just browsing through some of the problems. I cam across a ranklist for problem 100 (3n + 1 problem) and found that those that were on the top ten had running times as low as 0.002 secs using only 64k of memory! How the hell did they do that?? My best program for the sa...
by Carthage
Wed Oct 29, 2003 9:24 pm
Forum: Java
Topic: Java Compiler is FLAWED!!
Replies: 3
Views: 2734

Maybe they should replace the compiler with a newer version, or they should try Excelsior JET...
by Carthage
Wed Oct 29, 2003 9:21 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 50590

I have the same problem too. I'm currently using java, but I'm tempted to switch to C or C++ because of the java support. Could anyone please help us???
by Carthage
Wed Oct 29, 2003 8:57 pm
Forum: Java
Topic: Is There Vector Support?
Replies: 10
Views: 6918

Vector is supported. However, the methods you mentioned are not, so instead of add(), use addElement(). And use elementAt() instead of get().

Cheers!

Go to advanced search