Search found 14 matches

by zacharyleung
Mon Aug 02, 2004 3:40 am
Forum: C++
Topic: strange compile error
Replies: 11
Views: 3600

zacharyleung - what version of gcc do you have? Do you happen to use any command line switch? Your problem is not with the compiler though, but with linker (ld). Ask your system administrator about it - it seems that gcc is installed inappriopriately. Your TMP environmental variable possibly has a ...
by zacharyleung
Sun Aug 01, 2004 9:33 am
Forum: C++
Topic: strange compile error
Replies: 11
Views: 3600

Ok, I changed the program to: [cpp] #include <iostream> using namespace std; int main() { int i; cout << "hello" << endl; cin >> i; return 0; } [/cpp] But I get exactly the same problem! Just a note: I'm not doing this on my own computer. I'm SSH-ing to a remote computer (a university comp) and comp...
by zacharyleung
Sat Jul 31, 2004 8:57 am
Forum: C++
Topic: strange compile error
Replies: 11
Views: 3600

strange compile error

This is a really strang error that I get! Any idea what's wrong? [cpp] #include <iostream> int main() { int i; cout << "hello" << endl; cin >> i; return 0; } [/cpp] leungnga@sf3:~/CS3233[518]$ gcc Test.cc Undefined first referenced symbol in file ostream::operator<<(char const *) /var/tmp/cc65MrC2.o...
by zacharyleung
Tue May 04, 2004 7:55 am
Forum: Volume 102 (10200-10299)
Topic: 10203 - Snow Clearing
Replies: 21
Views: 4581

I tried to think about it, but I really have no idea how to do that. Since we use the square root of x^2 and y^2, won't that always be a float?
by zacharyleung
Tue Apr 20, 2004 9:43 am
Forum: Volume 102 (10200-10299)
Topic: 10203 - Snow Clearing
Replies: 21
Views: 4581

10203 Snow Clearing

I'm quite sure my code is correct, could anyone tell me what's wrong, cos I keep on getting WA.... [cpp] #include <cstdio> #include <cmath> #include <cstring> #define DEBUG(var) cout << #var << " = " << var << endl; #define LINE cout << __LINE__ << endl; const int MAX_LINE_LEN = 100; void test(); in...
by zacharyleung
Wed Apr 14, 2004 8:18 am
Forum: Volume 101 (10100-10199)
Topic: 10152 - ShellSort
Replies: 33
Views: 8873

10152 Shellsort--how do you make this faster?

I've gotten an AC for this question. :D But my solution takes about 6 seconds to run, which is a lot longer than the fastest solutions (about 0.15 seconds) Any suggestions as to how to make this faster? [cpp] #include <cstdio> #include <climits> #include <cstring> #define DEBUGI(var) printf( "%s = %...
by zacharyleung
Sat Mar 27, 2004 7:34 am
Forum: Volume 1 (100-199)
Topic: 183 - Bit Maps
Replies: 15
Views: 2884

Clarification for 183 (Bit Maps)

I was getting stuck on this problem, and I finally figured out why I was getting WA. The reason was that if the bit map contians more than 50 characters, they would like the answer to be something like the following: D 3 30 DDDDD01D01DD01D01DDD01D01DD010DDD10D10DD10D10DDD10 D10DD101DDDD10D10D1D01DDD...
by zacharyleung
Sat Mar 20, 2004 10:10 am
Forum: Other words
Topic: What exactly is "lexicographical order"?
Replies: 4
Views: 1736

What exactly is "lexicographical order"?

There are quite a few questions where we are required to print the lexicographically smallest answer. Is there a good way in general to get this smallest answer? Problems that are like this include 116, 10026...
by zacharyleung
Sat Mar 20, 2004 4:28 am
Forum: Off topic (General chit-chat)
Topic: Linux question about Ctrl-z
Replies: 4
Views: 2546

Yeah, that was definitiely helpful, thanks! :D
by zacharyleung
Thu Mar 18, 2004 10:38 am
Forum: Off topic (General chit-chat)
Topic: Linux question about Ctrl-z
Replies: 4
Views: 2546

Linux question about Ctrl-z

Normally when I write programs, I log on using a SSH client to a remote server and I use emacs to write my program. Sometimes I accidentally hit C-z which suspends my currently running application. I can't figure out how to restart it, does anyone know how I can restart my suspended application? Tha...
by zacharyleung
Tue Mar 16, 2004 3:24 am
Forum: C
Topic: What's the maximum integer in C?
Replies: 4
Views: 2402

Ah, ok, thanks!
by zacharyleung
Mon Mar 15, 2004 10:28 am
Forum: C
Topic: What's the maximum integer in C?
Replies: 4
Views: 2402

What's the maximum integer in C?

I believe it's 2^31 - 1. The thing is when I want to write code like the following

min = Integer.MAX_VALUE
for( i = ...)
if( min < value )
min = vale

So what is the maximum value, or where can I find it?

Thanks! :)
by zacharyleung
Tue Feb 03, 2004 3:28 pm
Forum: Java
Topic: [ Java ] Useful methods to save time.
Replies: 12
Views: 10846

Just wondering, what is the significance of the number 65535 in this line?

[java]
while( delim.indexOf( (int) c ) != -1 && c != 65535 )
[/java]

Thanks.
by zacharyleung
Tue Feb 03, 2004 3:53 am
Forum: Volume 102 (10200-10299)
Topic: 10205 - Stack 'em Up
Replies: 60
Views: 22991

Java input issues... (ref Problem 10205)

This is my first post! :) Anyway, I know this is a pretty simple problem, but I can't figure out how to read in the input correctly. I'm pretty confident that my algorithm works. Because I can't always read in the input correctly, I'm having problems with a few other problems too. I'd appreciate it ...

Go to advanced search