Search found 79 matches
- Sun Jun 20, 2004 7:53 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10100 - Longest Match
- Replies: 95
- Views: 31082
Runtime Error SIGSEGV
Can anyone tell me what's wrong with this (I got Runtime Error SIGSEGV) [cpp] // ACM #10100: Longest Match #include <ctype.h> #include <stdio.h> #include <string.h> #define MAXLLEN 1000 #define MAXWLEN 20 #define MAXNW 55 #define MAX(A,B) ((A)>(B)?(A):(B)) char line[MAXLLEN+1],w1[MAXNW+1][MAXWLEN+1]...
- Sun Dec 21, 2003 4:23 pm
- Forum: Algorithms
- Topic: help with one "usaco hard problem" ... please.....
- Replies: 19
- Views: 11408
Help needed for USACO problem
Hi, I am at USACO section 1.2.5 and am stuck at the problem Stringsobits. I tried generating all possible strings and of course got TLE when my program had to generate 2^31 strings. Here's the problem. I would appreciate any help given. Thank you very much. Consider an ordered set S of strings of N ...
- Mon Nov 17, 2003 5:17 pm
- Forum: Volume 6 (600-699)
- Topic: 600 - A Duckpin Tournament
- Replies: 12
- Views: 9784
600 - A Duckpin Tournament
Couldn't find any mistakes in this code. Tested with many test cases and all ran perfectly, but I still get a WA from the judge. Please help. [cpp]#include <stdio.h> #include <stdlib.h> #include <string.h> const int NOSCORE=16843009; struct { char name[11]; int sc[3][30]; // score for each try } guy...
- Wed Jun 25, 2003 12:40 pm
- Forum: Algorithms
- Topic: Number Theory!!!!
- Replies: 10
- Views: 5265
- Wed Jun 25, 2003 12:31 pm
- Forum: Other words
- Topic: An Important Request !!!!!!!!!!
- Replies: 14
- Views: 4219
Please don't distribute your solutions against requests via emails. May be one person is trying to gather codes in different identities. Also, certain people may be solving ACM problems as part of their homework, so sending them the solutions via email is equivalent to doing their homework for them...
- Mon Jun 23, 2003 12:46 pm
- Forum: Volume 6 (600-699)
- Topic: 617 - Nonstop Travel
- Replies: 9
- Views: 5085
617
Hi, I got a WA for the following code. I have a strong feeling that the error is due to inaccuracy in using floating point real numbers. However, the possibility of a flawed algorithm must not be ruled out. I would appreciate any help provided, as well as sample test cases. Thank you in advance. [cp...
- Mon Jun 23, 2003 12:43 pm
- Forum: Volume 6 (600-699)
- Topic: 636 - Squares (III)
- Replies: 7
- Views: 4359
- Fri Jun 20, 2003 7:28 pm
- Forum: Volume 6 (600-699)
- Topic: 639 - Don't Get Rooked
- Replies: 11
- Views: 10887
Using standard backtracking is enough to solve this problem. I am actually quite surprised that greedy algorithm works for this problem. My greedy algorithm works like this. 1. For each position p on the board, find the number of positions that a rook placed at p can attack. Let a[ p ] be the numbe...
- Fri Jun 20, 2003 7:08 pm
- Forum: Volume 1 (100-199)
- Topic: 147 - Dollars
- Replies: 233
- Views: 46019
- Fri Jun 20, 2003 7:03 pm
- Forum: Volume 1 (100-199)
- Topic: 100 - The 3n + 1 problem
- Replies: 1394
- Views: 293331
- Fri Jun 20, 2003 6:44 pm
- Forum: C++
- Topic: About CPU time
- Replies: 5
- Views: 3380
well problemsetter bhai, thanks for your great teaching. it's very important use. will it work on cygwin? will there be any problem to judge if i use clock_t will it return compile error? I think the functions in time.h are available for any compiler. However, I don't see any point in sending a pro...
- Fri Jun 20, 2003 6:35 pm
- Forum: General
- Topic: Never use yahoomail for submission
- Replies: 6
- Views: 2368
- Tue Jun 17, 2003 4:53 am
- Forum: Volume 6 (600-699)
- Topic: 616 - Coconuts, Revisited
- Replies: 37
- Views: 16276
- Mon Jun 09, 2003 3:41 pm
- Forum: C
- Topic: quicksort built in
- Replies: 8
- Views: 9818
Compare function. [cpp]int cmp(const void *va, const void *vb) { tdata *a = (tdata*)va; tdata *b = (tdata*)vb; return a->key - b->key; }[/cpp] Calling the quicksort function. [cpp]qsort(data, 1000, sizeof(data), cmp);[/cpp] Quite easy. The skill of using the function comes with experience. Good luck.