## Search found 65 matches

- Tue May 27, 2008 5:09 pm
- Forum: Volume 113 (11300-11399)
- Topic: 11307 - Alternative Arborescence
- Replies:
**22** - Views:
**11088**

### Re: 11307 - Alternative Arborescence

Why it got Runtime Error? Could someone explain this for me? Thanks a lot. for(i=0; i<n; ++i) { gets(line); p = line; sscanf(p, "%d%n", &from, &len); p += len; while(*p) { if(sscanf(p, "%d%n", &to, &len) == 1) { v[from].push_back(to); } p += len; } }

- Thu Apr 12, 2007 7:03 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10085 - The most distant state
- Replies:
**10** - Views:
**3238**

### Re: 8-Puzzle

First of all, thanks for your kindness and response.

I wanna know why in the worst case shortest solution only needs 31 moves.

Can you explain it in some details.

Lonely

I wanna know why in the worst case shortest solution only needs 31 moves.

Can you explain it in some details.

Lonely

- Wed Apr 11, 2007 10:52 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10085 - The most distant state
- Replies:
**10** - Views:
**3238**

### 8-Puzzle

Hi all: I know there are many algorithm can be used to solve this problem quickly. But somehow I wanna use DFS to solve this problem. Problem Description: Given a board state, I wanna use DFS to find the shortest path from Init state to Goal state(123456780). Obviously, use DFS it should visit all p...

- Sat Jan 06, 2007 11:38 am
- Forum: Algorithms
- Topic: use Bellman ford algo. to find a negative cycle
- Replies:
**5** - Views:
**4075**

### use Bellman ford algo. to find a negative cycle

How to use Bellman ford algo. to find a negative cycle.

Could someone tell me how to do it.

I mean find the path v1...vk is a negative cycle.

I wanna to find this path.

Thanks a lot.

Could someone tell me how to do it.

I mean find the path v1...vk is a negative cycle.

I wanna to find this path.

Thanks a lot.

- Fri Jan 05, 2007 6:55 pm
- Forum: Algorithms
- Topic: ask two problems
- Replies:
**2** - Views:
**1656**

Your first problem is solvable by a modified BFS. Time complexity is O(V+E) (linear). Your second problem can be solved using suffix tree. Thanks for your reply. I think I can think of the solution of first problem. But would you please describe your method(suffix tree) for problem 2 in detail. Use...

- Fri Jan 05, 2007 4:18 pm
- Forum: Algorithms
- Topic: ask two problems
- Replies:
**2** - Views:
**1656**

### ask two problems

1. Let G=(V,E) be a directed graph and v and w be two vertices in G. Design a linear-time(O(V^2)) algorithm to find the number of different shortest paths(not necessarily vertex disjoint) between v and w. There are no weights on the edges or you may assume each edge is with weight 1. My thought is: ...

- Wed Oct 18, 2006 9:01 am
- Forum: Algorithms
- Topic: Hanoi Problem
- Replies:
**1** - Views:
**1682**

### Hanoi Problem

Consider a variation of the towers of Hanoi problem. We no longer assume that all the disks are initially on one peg. They may be arbitrarily distributed among thethree pegs, as long as they are ordered in decreasing sizes on each peg. The purpose of the puzzle remains to move all disks to one speci...

- Sat Oct 14, 2006 7:08 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11125 - Arrange Some Marbles
- Replies:
**20** - Views:
**13711**

### 11125 - Arrange Some Marbles

I would like to know how to DP it.

I write a Recursive Function; however, I couldn't find a way to memorize

some path.

Any one give me some hint, please.

Lonely

I write a Recursive Function; however, I couldn't find a way to memorize

some path.

Any one give me some hint, please.

Lonely

- Sun Oct 01, 2006 9:49 pm
- Forum: Algorithms
- Topic: One question about Tree
- Replies:
**3** - Views:
**2023**

- Sun Oct 01, 2006 9:53 am
- Forum: Algorithms
- Topic: One question about Tree
- Replies:
**3** - Views:
**2023**

### One question about Tree

Let d1, d2,

- Sun Sep 24, 2006 9:55 am
- Forum: Volume 110 (11000-11099)
- Topic: 11098 - Battle II
- Replies:
**11** - Views:
**6022**

- Thu Aug 24, 2006 9:18 am
- Forum: Volume 110 (11000-11099)
- Topic: 11052 - Economic phone calls
- Replies:
**26** - Views:
**11535**

I'm not understand the above input!! Why is 2 the output? You can explain to me? What is wrong in my idea? The years of all the phone calls are as follows: 04:09:06:59 47 - [year 1] (as 04>02) 02:07:05:49 47 + [year 1] (as 02<09) 09:01:03:11 47 - [year 0] (as 09>01) 01:30:02:34 47 - [year 0] (as it...

- Sun Aug 13, 2006 10:00 am
- Forum: Volume 110 (11000-11099)
- Topic: 11069 - A Graph Problem
- Replies:
**20** - Views:
**8935**

- Sun Aug 13, 2006 9:47 am
- Forum: Volume 110 (11000-11099)
- Topic: 11069 - A Graph Problem
- Replies:
**20** - Views:
**8935**

- Sun Aug 13, 2006 9:42 am
- Forum: Volume 110 (11000-11099)
- Topic: 11069 - A Graph Problem
- Replies:
**20** - Views:
**8935**