10605 - Mines For Diamonds
Moderator: Board moderators
-
- Experienced poster
- Posts: 123
- Joined: Thu Feb 10, 2005 4:46 am
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
I guess test data is weak (but I don't have the test data on my computer here, so I can't check). With how I understood the problem first, greedy strategies seemed likely to fail on random inputs. After I realised I understood the problem wrong, I didn't change the input.
I would be interested what your program would print in following case:
Output should be 6.
I would be interested what your program would print in following case:
Code: Select all
10 10
##########
#........#
#........#
#........#
#...*....#
#........#
#...*.*..#
#...#....#
#...#....#
##########
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
-
- Experienced poster
- Posts: 123
- Joined: Thu Feb 10, 2005 4:46 am
-
- Guru
- Posts: 724
- Joined: Wed Dec 19, 2001 2:00 am
- Location: Germany
10605 TLE
I always get TLE on this problem.
Using brute forse on each step I try go from one diamante to another or go to exit(when i go to exit i find another unused diamonde and use recursion again).
How can i prune it?
Give me some hints.Plz.
Using brute forse on each step I try go from one diamante to another or go to exit(when i go to exit i find another unused diamonde and use recursion again).
How can i prune it?
Give me some hints.Plz.
10605
i just got ac.
i noticed that each diamond must connect to another diamond or the wall.
so i enumerate the father of a diamond node. and then calculate the total langth.
i got acc but i don't know how to prove my method right.
i wonder how you guys solved this problem,and whether my algo was right?
i noticed that each diamond must connect to another diamond or the wall.
so i enumerate the father of a diamond node. and then calculate the total langth.
i got acc but i don't know how to prove my method right.
i wonder how you guys solved this problem,and whether my algo was right?

不鸣则已,一鸣惊人.
-
- Learning poster
- Posts: 72
- Joined: Tue May 30, 2006 5:57 pm
- Location: bangladesh
Re: 10605
You are right "Ziliang".ziliang wrote:i just got ac.
i noticed that each diamond must connect to another diamond or the wall.
i wonder how you guys solved this problem,and whether my algo was right?
I solved is using DP(TSP).
It will help some one:
Code: Select all
1
5 11
###########
#.........#
#..**.....#
#.........#
###########
Code: Select all
3
Mak
Help me PLZ!!
Help me PLZ!!