Search found 67 matches

by Ghost77 dimen
Mon Aug 02, 2004 7:49 pm
Forum: Volume 104 (10400-10499)
Topic: 10465 - Homer Simpson
Replies: 75
Views: 32429

gcd(a,b)|c means c can be divided by gcd(a,b) maybe the symbol '|' isn't quite common in your country. Well, maybe the method I mentioned before doesn't fit your request. You want do that by DP. If I were you, I'll do that by this. Now I read a, b, and t. a represented the needed time1, and b ... t...
by Ghost77 dimen
Sun Aug 01, 2004 4:31 pm
Forum: Volume 102 (10200-10299)
Topic: 10297 - Beavergnaw
Replies: 13
Views: 8750


Try calculus. It's an easy problem.

Good luck. 8)
by Ghost77 dimen
Sun Aug 01, 2004 4:23 pm
Forum: Volume 104 (10400-10499)
Topic: 10465 - Homer Simpson
Replies: 75
Views: 32429

The problem you request is ax+by=c find maximum x+y if existed otherwise decrease the c There is a well-known formula to examine the possiblity of the statement. That is wheather gcd(a,b) | c. If not don't waste any time to find the maximum x+y, otherwise try it. The formula work at the x and y are...
by Ghost77 dimen
Sun Aug 01, 2004 3:57 pm
Forum: Volume 106 (10600-10699)
Topic: 10671 - Grid Speed
Replies: 2
Views: 2059

10671 - Grid Speed

I think it is an ordinary dp problem, pass it without further doubt. What I'd like to ask here is how to reduce the memory and time as low as the top of the rankist. Before posting, I tried to find somthing out. Memory. 1. reduce the 2-dim mem to 1-dim mem. (mine: done) 2. Try linked list instead o...
by Ghost77 dimen
Thu Jan 01, 2004 2:59 pm
Forum: Volume 105 (10500-10599)
Topic: 10590 - Boxes of Chocolates Again
Replies: 20
Views: 10083

To windows2k :


I don't know the good method, either.

Mine solved the problem around 5 seconds.

It can pass the online judge, but still can't pass the contest.

If you only want to pass the online judge, you can do as my previous

article, and optimize it.
by Ghost77 dimen
Thu Jan 01, 2004 8:02 am
Forum: Volume 105 (10500-10599)
Topic: 10593 - Kites
Replies: 18
Views: 8695

To windows 2k : Your output is right. Try more samples. 5 x..xx xxxxx xxx.. xx.xx xx.xx 10 x..xxxxxxx .x.x.xxx.x xxxxx..x.x xxx.x.xx.. xxx.x.x.xx xxxx..xx.x x.xxxxxxxx xxx..xxxxx xxx.x..xx. .xx.xxxxx. 15 xxxx..x.xxx.x.x xx.xx..x..xxx.x x..x.x.x.xx.xxx .x.xxxxxx.xx..x xxxxxx.xx.xxx.x .x.x.....xxx... ...
by Ghost77 dimen
Thu Jan 01, 2004 7:56 am
Forum: Volume 105 (10500-10599)
Topic: 10590 - Boxes of Chocolates Again
Replies: 20
Views: 10083

To: Red Scorpion

Mine is f(n,k)=f(n,k-1)+f(n-k,k)

Idea is that:

When you calculate f(n,k), what you have to know is only column k

and column k-1.

So don't waste memory to store the value of other columns.
by Ghost77 dimen
Sun Dec 28, 2003 5:57 am
Forum: Volume 105 (10500-10599)
Topic: 10593 - Kites
Replies: 18
Views: 8695

Finally, I got accepted.

Thank you.
by Ghost77 dimen
Sun Dec 28, 2003 5:13 am
Forum: Volume 105 (10500-10599)
Topic: 10593 - Kites
Replies: 18
Views: 8695

The input should be a square, doesn't it??

My program is waiting for other lines. 8)
by Ghost77 dimen
Sat Dec 27, 2003 7:32 pm
Forum: Volume 105 (10500-10599)
Topic: 10593 - Kites
Replies: 18
Views: 8695

10593 - Kites

5
..x..
.xxx.
xxxxx
.xxx.
..x..

11

4
xxxx
xxxx
xxxx
xxxx

18

5
xxxxx
xxx..
.xxx.
..xxx
xxxxx

9

6
xxxxxx
.xxxxx
xxxxx.
.xxxxx
xxxxx.
.xxxxx

41

Above is my answer.

Anything wrong?? 8)
by Ghost77 dimen
Sat Dec 27, 2003 6:00 pm
Forum: Volume 105 (10500-10599)
Topic: 10592 - Freedom Fighter
Replies: 17
Views: 11937

8) Sorry, I find my program have some bugs. 3 BBB PPP BBB 3 PPP BBB PPP the last answer of mine are also equal to 4 (I don't know why I still got Accepted, maybe only simple connection will occur.) Some other sample 4 BB.. .PP. B..P BBBB Sector #1: contain 1 freedom fighter group(s) & 1 enemy gr...
by Ghost77 dimen
Sat Dec 27, 2003 5:27 pm
Forum: Volume 105 (10500-10599)
Topic: 10592 - Freedom Fighter
Replies: 17
Views: 11937

8)

I don't whether tricks exist or not.

But I consider if freedom A and B connect to oppenent C at the same time.

Like this:

BBB
PPP
BBB

I still count that only once.

(Maybe it is the trick. Good Luck)
by Ghost77 dimen
Wed Sep 17, 2003 7:12 am
Forum: Volume 105 (10500-10599)
Topic: 10513 - Bangladesh Sequences
Replies: 15
Views: 9904

As per said, you'll find the rule is worked when the length is more than

10. By the way, make sure your algorithm is efficient. 8)
by Ghost77 dimen
Mon Sep 15, 2003 7:14 pm
Forum: Volume 2 (200-299)
Topic: 254 - Towers of Hanoi
Replies: 39
Views: 20034

Hello, anupam. Memorizing all moves is much time consuming, maybe never be done, because the most numbers of moves would be 2^100-1. Try to solve it with your background knowledge. The Tower of Honai tells you that moves n disks from one peg to another needs 2^n-1 steps. So when you get a number, di...
by Ghost77 dimen
Fri Sep 12, 2003 8:58 am
Forum: Volume 105 (10500-10599)
Topic: 10501 - Simplified Shisen-Sho
Replies: 12
Views: 10396

8)

I have indicated that in previous post.

Go to advanced search