I had no idea how to solve this problem efficiently....
I used DFS to solve this problem, but it seemed that my program ran too slow....
Can anyone help me to solve this problem efficiently ?
Thanks in advance!
Search found 5 matches
Search found 5 matches • Page 1 of 1
- Sun Sep 29, 2002 12:48 am
- Forum: Volume 4 (400-499)
- Topic: 431 - Trial of the Millennium
- Replies: 13
- Views: 7345
Hmmm .... I was wondering how to solve this problem. First, I try to solve this problem like a 0/1 knapsack problem. However, after I found the maximum points and the optimal number of evidence presentations within the time constraint, I had another problem which is how to find the sequence of the e...
- Tue Aug 20, 2002 8:14 pm
- Forum: Volume 103 (10300-10399)
- Topic: 10325 - The Lottery
- Replies: 14
- Views: 6900
Actually, my program produces the correct answer for the above test case. However, I still do not understand why my program could not get accepted. >_< Here is my code: [cpp] #include <stdio.h> #include <math.h> long long int save,used,num; long long int result,m,n; long long int gcd(...