Search found 24 matches

by Bj
Wed Nov 30, 2005 1:56 am
Forum: Off topic (General chit-chat)
Topic: Who is this worm3959
Replies: 4
Views: 2159

It's probably a spam bot. They are quite common on larger more general forums.
by Bj
Sun Nov 27, 2005 12:25 am
Forum: Off topic (General chit-chat)
Topic: Author Info and profile (To ADMIN)
Replies: 8
Views: 3943

Roby wrote:To ADMIN, sorry for another complain I made...

*snip*
Oh, didn't notice that. Hopefully that problem will be fixed too.
by Bj
Fri Nov 25, 2005 5:28 am
Forum: Off topic (General chit-chat)
Topic: Author Info and profile (To ADMIN)
Replies: 8
Views: 3943

Oh, thanks! I was just getting bored solving these problems. It's a great motivator to have your own name on your profile page.

I really appreciate this! :)
by Bj
Mon Nov 07, 2005 10:23 pm
Forum: Volume 109 (10900-10999)
Topic: 10946 - You want what filled?
Replies: 38
Views: 17543

Your floodFill function is not very stack-friendly. Try to replace your floodFill with an empty function to see if you get wrong answer instead. void floodFill( cint i, cint j ) { return; } If you get WA, try to write an iterative flood fill. An ugly but easy way to do this is to directly convert yo...
by Bj
Wed Nov 02, 2005 6:35 am
Forum: Off topic (General chit-chat)
Topic: Access Denied?
Replies: 14
Views: 5276

I wonder if this problem is related with the "personal info not correct" problem. (My profile is http://acm.uva.es/cgi-bin/OnlineJudge?AuthorInfo:12139 but the country, name and registration date is incorrect).

Hopefully these problems will be fixed soon.
by Bj
Wed Nov 02, 2005 6:31 am
Forum: Other words
Topic: Runtime Error
Replies: 2
Views: 1569

Thanks, that's very useful!
by Bj
Tue Nov 01, 2005 10:43 pm
Forum: Volume 109 (10900-10999)
Topic: 10957 - So Doku Checker
Replies: 31
Views: 14649

Here are some test cases if anyone's interested. At first I posted these because I didn't know why my program failed. Now I do. :) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0...
by Bj
Mon Oct 31, 2005 11:17 pm
Forum: C++
Topic: priority queue in STL
Replies: 2
Views: 1825

Try this:

Code: Select all

// normal priority queue
priority_queue<int> pq1;

// reversed
priority_queue< int, vector<int>, greater<int> > pq2;
The default priority queue looks exactly like the "reversed" one above but uses std::less instead of std::greater as the comparision routine.
by Bj
Mon Oct 31, 2005 6:40 pm
Forum: Volume 109 (10900-10999)
Topic: 10956 - Prime Suspect
Replies: 24
Views: 11588

If you got 500 instead of 457, try to change your power mod routine to use long long internally.
by Bj
Mon Oct 31, 2005 6:35 am
Forum: Volume 109 (10900-10999)
Topic: 10957 - So Doku Checker
Replies: 31
Views: 14649

I have a love-hate relationship with these problems. On one hand I have already written several so doku solvers. On the other hand I am very well aware there are some very special cases that will completely screw up my runtime, if it weren't for the constraints. God forbid someone will create a prob...
by Bj
Sun Oct 30, 2005 11:52 pm
Forum: Volume 109 (10900-10999)
Topic: 10956 - Prime Suspect
Replies: 24
Views: 11588

The problem itself was fun (thanks little joey!) but I too agree the input was a little too heavy. My program takes 8 seconds (but then again I'm new to this and used cin ;) ) All of you who solved this fast (less than 4 seconds), did you modify the witness algorithm or did you rely on code optimiza...
by Bj
Sun Oct 30, 2005 4:22 am
Forum: Volume 109 (10900-10999)
Topic: 10954 - Add All
Replies: 80
Views: 26808

You can solve this problem in very few lines with a min priority queue.
by Bj
Sat Oct 29, 2005 5:00 am
Forum: C++
Topic: Who has easier variant?
Replies: 4
Views: 2327

I am not completely sure this will work, try it. Sorry for the dumb variable names. int main() { string test = "I think & 10*20.5(how are you)"; char a[30]; int b; float c; char d[30]; sscanf(test.c_str(), "%[A-Z,a-z, ] & %d * %f (%[A-Z,a-z, ])", a, &b, &c, d); cout << a << endl; cout << b << endl; ...
by Bj
Thu Oct 27, 2005 5:05 pm
Forum: Algorithms
Topic: anagram(next_permutation)
Replies: 2
Views: 1125

#include <iostream> #include <algorithm> #include <vector> using namespace std; int main() { vector<int> a; a.push_back(4); a.push_back(3); a.push_back(9); a.push_back(6); sort(a.begin(), a.end()); do { copy(a.begin(), a.end(), ostream_iterator<int>(cout, " ")); cout << endl; } while( next_permutat...
by Bj
Thu Oct 27, 2005 5:46 am
Forum: Algorithms
Topic: Artificial Intelligence (project)
Replies: 2
Views: 1250

Sounds like a fun and interesting problem. An idea is to keep a list of known areas (or states, an area is either "known" or "unknown"). Known areas can be visited using a shortest path algorithm such as A* or Dijkstra. As for the exploration of / learning the map there are several ways, you can for...

Go to advanced search