Search found 158 matches

by andmej
Fri Sep 05, 2008 5:39 am
Forum: C++
Topic: Help regarding STL
Replies: 4
Views: 2762

Re: Help regarding STL

by andmej
Fri Sep 05, 2008 5:37 am
Forum: ACM ICPC Archive Board
Topic: 3337 - Random walk
Replies: 0
Views: 1348

3337 - Random walk

Hi, I don't have a clue on how to solve this problem from the Live Archive: 3337 - Random walk . I tried a greedy solution but this gave me wrong answer. I can smell dynamic programming in this problem, but the state I've thought about is too big and will surely exceed the memory (and time) limit. C...
by andmej
Thu Sep 04, 2008 2:28 am
Forum: Volume 100 (10000-10099)
Topic: 10023 - Square root
Replies: 121
Views: 27785

Re: 10023 - RTE

Try this input:

Code: Select all

1
1
;)
by andmej
Wed Sep 03, 2008 4:20 pm
Forum: Volume 100 (10000-10099)
Topic: 10023 - Square root
Replies: 121
Views: 27785

Re: 10023 - RTE

Try changing

Code: Select all

public class Main {
for

Code: Select all

class Main {


I'm not sure if that is your problem, though.
by andmej
Wed Sep 03, 2008 4:06 pm
Forum: Bugs and suggestions
Topic: Spam is back!
Replies: 2
Views: 2283

Spam is back!

Hello, I've noticed that lately there has been lot of spam posts on these forums. Is there any way to control it? It's very annoying to open an unread post just to find a stupid senseless message. I think admin action is required to install an anti-spam plugin or find out another way to stop this bo...
by andmej
Wed Sep 03, 2008 3:51 pm
Forum: ACM ICPC Archive Board
Topic: 3985 - Board games
Replies: 4
Views: 2004

Re: 3985 - Board games

I am not sure, but my program did produce "infinity" for this input:

Code: Select all

1

3
0 2
3
0 0 -100
0 1 1  
1 2 1
I think the problem description has some flaws, it's very ambiguous in some parts. This holds for all problems from the problem-set that this problem belongs to (SWERC 2007).
by andmej
Mon Sep 01, 2008 10:19 pm
Forum: ACM ICPC Archive Board
Topic: 3985 - Board games
Replies: 4
Views: 2004

Re: 3985 - Board games

Apparently there are big numbers in the judge's test cases. I finally got accepted after changing the data type used in the relaxation step in Bellman's Ford algorithm from int to long long: Before (Gives Wrong Answer): int u = e[j].u, v = e[j].v; int w = e[j].w; if (d[u] + w < d[v]) d[v] = d[u] + w...
by andmej
Mon Sep 01, 2008 4:41 am
Forum: ACM ICPC Archive Board
Topic: 3985 - Board games
Replies: 4
Views: 2004

3985 - Board games

Problem 3985 - Board games from the Live Archive looks like a simple application of Bellmand-Ford's algorithm. At first I tried simply running Bellmand-Ford an if there existed a negative cycle, print "infinity." This gave me Wrong Answer. So then I noticed that there could be a negative cycle that ...
by andmej
Mon Aug 25, 2008 5:50 pm
Forum: General
Topic: source code for my submissions
Replies: 2
Views: 4088

Re: source code for my submissions

Right now you can't see your submitted code, as far as I know.
by andmej
Mon Aug 25, 2008 5:47 pm
Forum: Algorithms
Topic: Shortest path through a given vertex
Replies: 19
Views: 7396

Re: Shortest path through a given vertex

This problem is very similar too. It's about finding two disjoint-paths from vertex s to t such that sum of both is minimal.
by andmej
Thu Aug 21, 2008 3:21 pm
Forum: Algorithms
Topic: Timus Online Judge - 1500 Pass Licenses
Replies: 6
Views: 2001

Re: Timus Online Judge - 1500 Pass Licenses

skinnyguy wrote:I was able to get accepted in a very indecent time using an optimized O(N*N*2^K) finally.
Can you tell me how did you optimize your solution? I haven't got accepted yet.
by andmej
Tue Aug 19, 2008 4:39 am
Forum: Algorithms
Topic: Timus Online Judge - 1500 Pass Licenses
Replies: 6
Views: 2001

Re: Timus Online Judge - 1500 Pass Licenses

by the way, i found on the net that this problem is a "Minimum Color s-t Path Problem" on a colored graph. some where it says that the problem can be solved in O(N*(2^K)). but i am unable to find anything faster than O(N*N*(2^K) by myself I had never heard of that problem before. Where did you read...
by andmej
Sun Aug 17, 2008 7:31 pm
Forum: Algorithms
Topic: Timus Online Judge - 1500 Pass Licenses
Replies: 6
Views: 2001

Re: Timus Online Judge - 1500 Pass Licenses

I first tried Dijkstra's algorithm with the state = <node, used_c> where node is the node being visited and used_c is a bitwise mask telling which licenses I have bought so far. However, this approach got Memory Limit Exceeded (The limit is 16MB). From state <node, used_c> you can go to: <neighbor(n...
by andmej
Sun Aug 17, 2008 5:58 pm
Forum: Bugs and suggestions
Topic: Problem Set page down all day
Replies: 2
Views: 1606

Re: Problem Set page down all day

I have seen that error before. I cleaned my cookies and got fixed. (Ctrl + Shift + Del in Firefox).
by andmej
Tue Aug 12, 2008 3:32 pm
Forum: Bugs and suggestions
Topic: NEW JUDGE'S STATUS
Replies: 20
Views: 18553

Re: NEW JUDGE'S STATUS

I think the only solution right now is to install Mozilla Firefox.

Go to advanced search