Search found 110 matches

by wyvmak
Tue Jul 20, 2004 6:31 am
Forum: Volume 105 (10500-10599)
Topic: 10584 - Text Formalization
Replies: 5
Views: 2328

Thanks for your smart hint. And I have to throw away my common sense and common interpretation on english words again.
by wyvmak
Tue Jun 01, 2004 2:56 pm
Forum: Volume 104 (10400-10499)
Topic: 10455 - Gray Code
Replies: 3
Views: 3185

After someone taught me, I've the following interpretation: G(n) represents the number of ways to form the n-bit gray code. For n-bit, you can fix 1st bit, 2nd bit, ..., n-th bit. After each bit fixed, you can have G(n-1) ways to generate the upper half, and G(n-1) ways to generate the lower half. I...
by wyvmak
Fri May 07, 2004 8:44 am
Forum: Volume 105 (10500-10599)
Topic: 10503 - The dominoes solitaire
Replies: 16
Views: 11576

Re: What does 10503 mean?

what does "dots" & "values" mean? i didn't find anywhere contains description of "dots" & "value". one piece of domino has two "values", say (0,1). there are "dots" to represent the "value", so on the domino there is one dot for "1". just like a dice. It took me some time to figure out the problem....
by wyvmak
Fri May 07, 2004 6:21 am
Forum: Volume 105 (10500-10599)
Topic: 10581 - Partitioning for fun and profit
Replies: 15
Views: 8431

I used DP to store a 3D table, storing in how many ways using M numbers, starting from I, and sum up to S. After constructing the table, can determine each individual number starting from left to right. I cannot think of a better way (likely due to limited ability/knowledge), though I believe there ...
by wyvmak
Fri Apr 16, 2004 8:41 am
Forum: Volume 106 (10600-10699)
Topic: 10613 - Mushroom Misery
Replies: 14
Views: 6281

Just this:

Input:
1
1 1
0 0 40

Output:
1
by wyvmak
Thu May 08, 2003 5:56 am
Forum: Volume 100 (10000-10099)
Topic: 10052 - Inviting Politicians
Replies: 15
Views: 4428

judge is wrong

I wanna say something. first, the judge is wrong. actually i think this is an NP-complete problem, but Adil's algorithm works, which is polynomial running time. i first guess this is just an approximation algorithm, but, after the algorithm, i verified that it doesn't invite all the politicians! the...
by wyvmak
Wed Apr 02, 2003 6:26 pm
Forum: Volume 101 (10100-10199)
Topic: 10181 - 15-Puzzle Problem
Replies: 36
Views: 19765

I'm not sure about the speed either, as my program doesn't run fast. but, for IDA*, i suppose a stack is enough, not a heap. i used Manhattan distance heuristic too (quite standard?) i guess if you adjust/tune your scoring functions, say F() = number of steps + 80* estimated steps, it may terminate ...
by wyvmak
Wed Apr 02, 2003 4:27 am
Forum: Volume 101 (10100-10199)
Topic: 10181 - 15-Puzzle Problem
Replies: 36
Views: 19765

yes, there's such a way. if you search the web.
if i remember correctly, i used the following:
let X = determine number of inversions + the row number of the empty square (numbered as row 1 to row 4)
if X is odd, no solution
if X is even, do the search
by wyvmak
Sun Sep 29, 2002 2:32 pm
Forum: Volume 1 (100-199)
Topic: 135 - No Rectangles
Replies: 24
Views: 4576

i forget exactly how i solve it. but think about prime number sequences. eg. for n=5 start from 1, 1+(i*j) , j=0,1,2,3,4 for i=0, then { 1,1,1,1,1 } for i=1, { 1,2,3,4,5 } for i=2, { 1,3,5,2,4 } for i=3, { 1,4,2,5,3 } for i=4, { 1,5,4,3,2 } you see that there's no rectangle. hope that helps. and wis...
by wyvmak
Sun Sep 29, 2002 1:58 pm
Forum: Volume 103 (10300-10399)
Topic: 10309 - Turn the Lights Off
Replies: 19
Views: 8832

i used recursion. though i guess there're better methods than mine. (i heard somebody use looping) my algorithm: go from the top-row, - for each one in top-row, you can switch or not switch for the rest of the rows, - the upper row would determine whether you can switch or not. ie. if the upper row ...
by wyvmak
Sun Sep 29, 2002 6:04 am
Forum: Volume 3 (300-399)
Topic: 376 - More Triangles ... THE AMBIGUOUS CASE
Replies: 10
Views: 4871

thanks to all of you. i think it's more than a year when i first tried to solve this problem.

i just wonder, how am i suppose to know the output format in such a way. how am i suppose to handle 0 and 180, if not your hints. or it's just a good proof that i'm not clever enough for ACM?
by wyvmak
Sat Sep 14, 2002 4:59 am
Forum: Volume 3 (300-399)
Topic: 376 - More Triangles ... THE AMBIGUOUS CASE
Replies: 10
Views: 4871

just then, I noticed that there's not a special correction program, does that imply side1 >= side2 in the output?
by wyvmak
Mon Sep 02, 2002 12:53 pm
Forum: Volume 102 (10200-10299)
Topic: 10216 - The Optimal Coffee Shop!!
Replies: 12
Views: 6221

DM is called Fermat point, a search engine will tell you about it. one thing, there're two cases for Fermat point. [i'm surprised that Fermat is such a great mathematician] if a triangle cannot be formed, only circumcentre is -1. other values still can be obtained. i think you would know what should...
by wyvmak
Sun Sep 01, 2002 5:21 pm
Forum: Volume 100 (10000-10099)
Topic: 10024 - Curling up the cube
Replies: 13
Views: 3922

it can, please trust me. :-?

OOXO
XXXX
XOOO

also can, do you think so?
by wyvmak
Sun Sep 01, 2002 10:09 am
Forum: Volume 102 (10200-10299)
Topic: 10219 - Find the ways !
Replies: 33
Views: 10327

our code are alike, but what my guess is,

maybe you try to return real number in s()

then change to integer when output
(int) (s(m2+1,n)-s(2,m1)+1)

Go to advanced search