Search found 38 matches

by Maxim
Sun Feb 15, 2004 4:48 pm
Forum: Volume 100 (10000-10099)
Topic: 10029 - Edit Step Ladders
Replies: 70
Views: 20499

I don't think he completely bypassed the size of the alphabet, but I think he ignored it because it could be treated as a constant. You can pass the time limit with hashing too, if you have a good implementation. Check out little joey's comments at: http://online-judge.uva.es/board/viewtopic.php?t=...
by Maxim
Sat Feb 14, 2004 9:34 pm
Forum: Volume 100 (10000-10099)
Topic: 10029 - Edit Step Ladders
Replies: 70
Views: 20499

I have two method to solve your problem, and both of them are related to the size of the strings (but I think the O(t*n) is better than O(n^2) where t refers to the length of the string) ... The second method uses hash instead of Sorting and Searching with binary search. (Ofcourse I ignore problems...
by Maxim
Wed Feb 11, 2004 7:44 pm
Forum: C++
Topic: Debugging cpp files in rhide
Replies: 1
Views: 3124

Debugging cpp files in rhide

Hi. I'm coding in rhide v1.4.9. I'm having trouble with debugging C++ code. Say I start tracing into (F7 option). All I can see during this process is last few lines of code instead of highlighted line that is being executed. Another one problem is that sometimes I can't see values of variables in W...
by Maxim
Sat Aug 30, 2003 1:05 pm
Forum: Volume 101 (10100-10199)
Topic: 10100 - Longest Match
Replies: 95
Views: 20415

Hello I'm having WA for this problem, and after having rewrote it from scratch twice, and read the whole forum. So I'm now going to an extremity I never used before : posting my algorithm and my whole source here, hoping that someone we'll help me ;) The algo is simple : DP with a table l [j] where...
by Maxim
Thu Jul 31, 2003 11:21 am
Forum: Volume 105 (10500-10599)
Topic: 10534 - Wavio Sequence
Replies: 44
Views: 7457

There is a way to find LIS in O(n log n).
If you have found LIS for first i-1 elements, calculating LIS for i-th element should be done in O(log n). Think of such structure.
by Maxim
Mon Jun 02, 2003 1:16 pm
Forum: Algorithms
Topic: Negative cycle in graph
Replies: 11
Views: 4565

need something better

I've found a negative-weight cycle (cycle itself) with Floyd-Warshall in O(n^4). Please, does anyone know how to do it faster? I need to do it in dynamic graph and remove them after detected, so it would take really long to complete it. I
by Maxim
Sun Jun 01, 2003 1:09 pm
Forum: Algorithms
Topic: Negative cycle in graph
Replies: 11
Views: 4565

Excuse me. Can anyone post the pseudocode for Bellman-Ford's Algorithm here? d[i] <- infinity for each i except for source (i.e. starting node), so d[source] <- 0 for i <- 1 to |V[G]| - 1 do for each edge (u, v) in E[G] if d[v] > d[u] + w(u, v) d[v] <- d[u] + w(u, v) If you want to know if there is...
by Maxim
Fri May 30, 2003 11:52 am
Forum: Algorithms
Topic: Negative cycle in graph
Replies: 11
Views: 4565

Negative cycle in graph

Given directed weighted graph determine a negative cycle C, (c1,c2,
by Maxim
Fri May 30, 2003 11:51 am
Forum: Algorithms
Topic: Minimum cost flow problems
Replies: 0
Views: 1366

Minimum cost flow problems

Are there any instances of minimum cost flow problem at UVA?

Maxim
by Maxim
Sun May 25, 2003 10:43 pm
Forum: C++
Topic: how to copy an array in&#12288;&#65315;
Replies: 2
Views: 1835

Well, you could include "string.h" (cstring), and do something like this:
[cpp]#include <cstring>
...
int a[10], b[10];
...
memcpy(b, a, sizeof a); //copy a to b[/cpp]
But you should be careful about third parameter.

Maxim
by Maxim
Mon May 12, 2003 1:08 pm
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 38555

Why WA?

First of all, set not only line1[num] and line2[num] to zero, but all num + 1 elements of each line to zero.
After computation, only line1[num] might be leading zero, so test only for it, not whole line1.

Maxim
by Maxim
Mon May 12, 2003 12:26 pm
Forum: Volume 5 (500-599)
Topic: 538 - Balancing Bank Accounts
Replies: 18
Views: 8180

538 - Balancing Bank Accounts

Can anyone tell me or prove whether this problem can be solved using Network flow? :-?

Thanks,
Maxim
by Maxim
Sun May 11, 2003 10:05 pm
Forum: Volume 104 (10400-10499)
Topic: 10436 - Cheapest way
Replies: 18
Views: 6244

Don't know why

It's quite tricky to solve this problem using Floyd-Warshall. Your program doesn't work well because of additional cost when passing through some station. I've been testing your program and I couldn
by Maxim
Sun May 11, 2003 11:42 am
Forum: Volume 104 (10400-10499)
Topic: 10436 - Cheapest way
Replies: 18
Views: 6244

Tricky input

What about case when r and s are the same stations (find cheapest path from node to itself)? Your program outputs 0, instead of 1.1 * b[j] / val ?
Am I right? I think this is the only mistake you've made.

Maxim
by Maxim
Sun May 11, 2003 11:06 am
Forum: Other words
Topic: Multiple input problems??
Replies: 1
Views: 759

Go to advanced search