## 11280 - Flying to Fredericton

**Moderator:** Board moderators

### 11280 - Flying to Fredericton

I tried Floyd-Warshall but getting WA. Can anyone tell me how to solve this problem?

Thanks.

Thanks.

Code: Select all

`dp(x,y) = min{dp(x,y), dp(i, y-1)+cost(i,x)}; `

My solution is dp, and it works fine. May be you have done something wrong in your implementation.

Ami ekhono shopno dekhi...

HomePage

HomePage

Code: Select all

```
dp(x,y) = min{dp(x,y-1), dp(i, y-1)+cost(i,x)};
```

- Masud_CSE_SUST
- New poster
**Posts:**11**Joined:**Sat Jul 22, 2006 8:45 pm**Location:**Sylhet, Bagladesh-
**Contact:**

what's wrong with my code?
Can I get some tricky I/O.

Code: Select all

`code removed after finding mistake`

Last edited by Masud_CSE_SUST on Wed Sep 19, 2007 6:37 pm, edited 1 time in total.

"Computer science is no more about computers than astronomy is about telescopes." - Dijkstra

- Masud_CSE_SUST
- New poster
**Posts:**11**Joined:**Sat Jul 22, 2006 8:45 pm**Location:**Sylhet, Bagladesh-
**Contact:**

I get too many runtime error.plz help me................

deleted......................

Thanks

Keep posting;

deleted......................

Thanks

Keep posting;

Last edited by sapnil on Fri Sep 21, 2007 11:55 am, edited 1 time in total.

U did the same mistake as Masud_CSE_SUST. Read this

Code: Select all

```
Read the problem statement carefully.
U have to find the shortest path from Calgary to Fredericton using not more than the requested number of stopovers. U can get a shortest path using (<stop) number of stopovers. It should be considered.
```