Search found 14 matches
- Thu Aug 21, 2003 2:33 pm
- Forum: Volume 3 (300-399)
- Topic: 349 - Transferable Voting (II)
- Replies: 9
- Views: 2637
- Thu Aug 21, 2003 5:45 am
- Forum: Volume 3 (300-399)
- Topic: 349 - Transferable Voting (II)
- Replies: 9
- Views: 2637
- Tue Jul 29, 2003 9:48 am
- Forum: Volume 3 (300-399)
- Topic: 349 - Transferable Voting (II)
- Replies: 9
- Views: 2637
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...
- Sun Jun 15, 2003 6:49 pm
- Forum: Volume 3 (300-399)
- Topic: 353 - Pesky Palindromes
- Replies: 43
- Views: 13774
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...
- Thu Jan 23, 2003 6:09 am
- Forum: Volume 103 (10300-10399)
- Topic: 10334 - Ray Through Glasses
- Replies: 19
- Views: 9207
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]
[url]mailto:funkyboy2000@swirvemail.com[/url]
- Wed Jan 22, 2003 3:52 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10334 - Ray Through Glasses
- Replies: 19
- Views: 9207
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...
- Wed Jul 24, 2002 6:13 pm
- Forum: Volume 1 (100-199)
- Topic: 195 - Anagram
- Replies: 242
- Views: 32840
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...
- Mon Jul 15, 2002 6:30 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10323 - Factorial! You Must be Kidding!!!
- Replies: 106
- Views: 35323
- Mon Jul 15, 2002 5:19 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10324 - Zeros and Ones
- Replies: 179
- Views: 48665
- Mon Jul 15, 2002 4:44 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10334 - Ray Through Glasses
- Replies: 19
- Views: 9207
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...
- Mon Jul 15, 2002 4:37 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10323 - Factorial! You Must be Kidding!!!
- Replies: 106
- Views: 35323
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...
- Tue Jun 18, 2002 11:57 am
- Forum: Other words
- Topic: Number of submissions doubled ?!?!
- Replies: 8
- Views: 3054
- Mon Feb 25, 2002 3:03 pm
- Forum: Volume 1 (100-199)
- Topic: 104 - Arbitrage
- Replies: 223
- Views: 18611
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...
- Sun Feb 24, 2002 3:38 pm
- Forum: Other words
- Topic: is the online judge system broken ?
- Replies: 6
- Views: 3209