i use floyd to calculate distance between each store
and build a new graph that contains only store node and home node
then I use a bit DP to find the max profit
is this algorithm wrong?
can someone give me some test data ?
btw, what is the range of the cost of road and money saved in stoer ...
Search found 19 matches
- Sun Sep 16, 2007 5:45 am
- Forum: Volume 112 (11200-11299)
- Topic: 11284 - Shopping Trip
- Replies: 32
- Views: 19536
- Sun Jul 29, 2007 1:56 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11249 - Game
- Replies: 32
- Views: 18329
- Sun Jul 29, 2007 1:33 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11249 - Game
- Replies: 32
- Views: 18329
- Sun Jul 29, 2007 12:55 pm
- Forum: Volume 112 (11200-11299)
- Topic: 11249 - Game
- Replies: 32
- Views: 18329
11249 - Game
I solve it like this:
if(a>b)swap(a,b);
if(a*(k+2)==b) it_is_losing
else it_is_winning
Am I missing something?? or I used a wrong algorithm??
please help me.
if(a>b)swap(a,b);
if(a*(k+2)==b) it_is_losing
else it_is_winning
Am I missing something?? or I used a wrong algorithm??
please help me.
- Fri Feb 09, 2007 2:22 pm
- Forum: Volume 106 (10600-10699)
- Topic: 10605 - Mines For Diamonds
- Replies: 22
- Views: 9455
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 ...
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 ...
- Fri Feb 09, 2007 5:30 am
- Forum: Volume 106 (10600-10699)
- Topic: 10604 - Chemical Reaction
- Replies: 24
- Views: 19034
re
this is ridiculous.
- Mon Jan 29, 2007 7:20 pm
- Forum: Volume 101 (10100-10199)
- Topic: 10110 - Light, more light
- Replies: 76
- Views: 39656
re
wow~ it's cool..
- Wed Nov 01, 2006 12:57 pm
- Forum: Volume 110 (11000-11099)
- Topic: 11007 - Mini Cube
- Replies: 11
- Views: 9547
a*
can this problem solved with A* searching?
if it can,how?
if it can,how?
- Fri Oct 27, 2006 5:00 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11129 - An antiarithmetic permutation
- Replies: 21
- Views: 21487
how?
wow~ got it. really a cool way.
but how do you prove it correct?
I mean how do you prove that correct when you insert 8 between 0 and 4 that 4 6 8 will not form a progression?
let n=13,
first consider 2 0.
now, you've 2 insert 4 and (4,2,0) forms an arithmetic progression. so, insert 4 in the ...
but how do you prove it correct?
I mean how do you prove that correct when you insert 8 between 0 and 4 that 4 6 8 will not form a progression?
let n=13,
first consider 2 0.
now, you've 2 insert 4 and (4,2,0) forms an arithmetic progression. so, insert 4 in the ...
- Fri Oct 27, 2006 4:46 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11129 - An antiarithmetic permutation
- Replies: 21
- Views: 21487
[ ]
still dont quite understand..
but will try to figure it out
but will try to figure it out

- Fri Oct 27, 2006 2:47 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11147 - KuPellaKeS BST
- Replies: 12
- Views: 5851
11147 - KuPellaKeS BST
anyone help..
- Fri Oct 27, 2006 8:27 am
- Forum: Volume 111 (11100-11199)
- Topic: 11129 - An antiarithmetic permutation
- Replies: 21
- Views: 21487
[ ]
to sunny:
when inserting 8,would you consider 4 and 6?
obviously,8 is between 4and6, and , 4and0
then,there will be no place for 8
i think i dont quite understand your method
when inserting 8,would you consider 4 and 6?
obviously,8 is between 4and6, and , 4and0
then,there will be no place for 8
i think i dont quite understand your method
- Fri Oct 27, 2006 7:39 am
- Forum: Volume 111 (11100-11199)
- Topic: 11129 - An antiarithmetic permutation
- Replies: 21
- Views: 21487
[ ]
i think the O(n^2) algorithm will not get a tle
first,calculate the permutation for N=10000
then,for the case n<=10000,the solution is the subset of the former permution,from which you just need to printf the element that is smaller than or equal to n.
then we just need to compute 10000^2 times ...
first,calculate the permutation for N=10000
then,for the case n<=10000,the solution is the subset of the former permution,from which you just need to printf the element that is smaller than or equal to n.
then we just need to compute 10000^2 times ...
- Tue Oct 24, 2006 6:53 am
- Forum: Volume 111 (11100-11199)
- Topic: 11129 - An antiarithmetic permutation
- Replies: 21
- Views: 21487
[]
can anyone give me some tips to solve this problem?
- Mon Oct 16, 2006 10:24 am
- Forum: Volume 111 (11100-11199)
- Topic: 11125 - Arrange Some Marbles
- Replies: 20
- Views: 18084
[ ]
灌个水!