Search found 14 matches

by LawrenceT
Thu Aug 21, 2003 2:33 pm
Forum: Volume 3 (300-399)
Topic: 349 - Transferable Voting (II)
Replies: 9
Views: 2415

Thanks... there must be some careless mistake in my code then. I'll go check it out. :wink:
by LawrenceT
Thu Aug 21, 2003 5:45 am
Forum: Volume 3 (300-399)
Topic: 349 - Transferable Voting (II)
Replies: 9
Views: 2415

Someone said on another post somewhere that if such a case (as above) appears, then u remove all of them, not just any one of them. Perhaps someone who has solved this problem would like to say something?
by LawrenceT
Tue Jul 29, 2003 9:48 am
Forum: Volume 3 (300-399)
Topic: 349 - Transferable Voting (II)
Replies: 9
Views: 2415

Problem 349 - Transferable Voting (II)

The problem description says that If there had been several candidates with the fewest first choice votes, any of them, selected at random, could be selected for elimination. Consider this input data: 3 4 1 2 3 2 1 3 3 2 1 3 1 2 Candidate 1 has 1 vote, candidate 2 has 1 vote and candidate 3 has 2 vo...
by LawrenceT
Sun Jun 15, 2003 6:49 pm
Forum: Volume 3 (300-399)
Topic: 353 - Pesky Palindromes
Replies: 43
Views: 12161

all you need is the original string, which should be a character array of size 81, and a array storing the avaliable start positions. the way i do this question is to find all palindromes of length i, before moving on to find palindromes of length i + 1. It is easy to eliminate all duplicates just b...
by LawrenceT
Thu Jan 23, 2003 6:09 am
Forum: Volume 103 (10300-10399)
Topic: 10334 - Ray Through Glasses
Replies: 19
Views: 8575

haha... i did this question almost half a year back... dun think i still haf my source... y dun u email your code to me and i'll take a look for u?

[url]mailto:funkyboy2000@swirvemail.com[/url]
by LawrenceT
Wed Jan 22, 2003 3:52 pm
Forum: Volume 103 (10300-10399)
Topic: 10334 - Ray Through Glasses
Replies: 19
Views: 8575

as above... int i; long total[1000], next[1000], temp[1000]; long * pTotal, pNext, pTemp; long carry; pTotal = total; pNext = next; pTemp = temp; carry = 0; for (i = 0; i < 1000; i++) { pTemp[i] += carry + pNext[i] + pTotal[i]; carry = pTemp[i] / 100000; /* assuming 5 digits stored per element */ pT...
by LawrenceT
Wed Jul 24, 2002 6:13 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 26148

my guess is that you are programming in windows.. probably using microsoft visual c or some variant... cos these functions starting with '_' do not exist in ANSI C, which is generally (with a few exceptions - for example, the long long int type) what the judge is running... so, use other functions t...
by LawrenceT
Mon Jul 15, 2002 6:30 pm
Forum: Volume 103 (10300-10399)
Topic: 10323 - Factorial! You Must be Kidding!!!
Replies: 106
Views: 32170

yes, i totally agree with you... the problem really has no mathematical basis... but anyway, the thing i stated earlier is just the solution
by LawrenceT
Mon Jul 15, 2002 5:19 pm
Forum: Volume 103 (10300-10399)
Topic: 10324 - Zeros and Ones
Replies: 179
Views: 43255

this problem requires a solution that takes linear time (ie. no nested loops, no recursion needed)
by LawrenceT
Mon Jul 15, 2002 4:44 pm
Forum: Volume 103 (10300-10399)
Topic: 10334 - Ray Through Glasses
Replies: 19
Views: 8575

personally, i use pointers and long array... its much faster than using a char array, cos u can then process 9 digits at once (for addition), and 4 digits at once (for multiplication). So what you can do is to create 3 arrays, one to store your current total, one to store the next number to add, and...
by LawrenceT
Mon Jul 15, 2002 4:37 pm
Forum: Volume 103 (10300-10399)
Topic: 10323 - Factorial! You Must be Kidding!!!
Replies: 106
Views: 32170

well... i guess the answers are quite obvious for positive input... well... when input is -1, f(-1) = f(0) / 0 = 1 / 0 = positive infinity (overflow)... den when u divide that by a negative num... u get another answer... and when u divide that by another negative num... what do you get?... that's th...
by LawrenceT
Tue Jun 18, 2002 11:57 am
Forum: Other words
Topic: Number of submissions doubled ?!?!
Replies: 8
Views: 2775

well... apparently they just reset the system... so stuff submitted after like year 2000 all disappeared... *sigh*... i'm back down to 0 solved questions =)... hopefully they fix it soon...
by LawrenceT
Mon Feb 25, 2002 3:03 pm
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 13503

well, this question has got to do with searching for negative cycles in a graph. represent each currency by a vertex in a graph, with the edge weights the negative of the log of the currency exchange value. If a negative cycle can be found, then a arbitrage cycle exists. The length of the negative c...
by LawrenceT
Sun Feb 24, 2002 3:38 pm
Forum: Other words
Topic: is the online judge system broken ?
Replies: 6
Views: 3005

well... i think the online judge is okay, but the email system is down, cos the clock on the status page is counting... but no new judging is going on.

Go to advanced search