|
|
let there be 2k odd gaps and n-2k even gaps between island A even gaps could be BCBCBC or CBCBCB odd gaps are half BCB half CBC You have some trash in this test after the usefull part. So, my multitest failed it firstly. 1 16 1584 463104 299289600 361552896000 732443959296000 2305449150971904000 10654390419268829184000 6920214578354800558800000 61152377325314475294720 7098963015274747190071787520 106459726394067298796772293345280 21744352989317777418537171765166080 47498845317423375939485280755676453273600 1369194888259957058516432482121960109637632000 47707727343353896071849199802676518699529142272000 198688065044741506792127293398293547707178657251328000 97908297986853596289751162973434570005127864341000880128000 5658411485682054563233513036204820116833187371988441418956800000 3804418826562281061366609374760846640177306323287429048139264000000 2954227420326099129930691812076717959666831089054554318281052323840000 00 2632048450621963385564217879562108216922338757527021589770914779049216 000000 2674374039781190535182247433058431623911627168482448386681774871056508 05702656000000 3081998488818077502979646392150768764697262407973928271069996848309788 4292546560000 4079430842677444020458789055284437035377689124323794828380369516462185 2568977408000000 5854058595420455259314085499870932177527127956573251078768444812722023 3389546487676928000000 9562265549579035724936789114248267922015395457399253597102677301093514 221088746428140879872000000 1739718951590537042714251158989667483872007669374448115496657465787730 40131517368586035299090432000000 3512331724090453384614741919634889864232078679806054186280835886792417 959499924105350930517249228800000000 > 1 > 16 > 1584 > 463104 > 299289600 > 361552896000 > 732443959296000 > 2305449150971904000 > 10654390419268829184000 > 6920214578354800558800000 > 61152377325314475294720 > 7098963015274747190071787520 > 106459726394067298796772293345280 > 21744352989317777418537171765166080 > 47498845317423375939485280755676453273600 > 1369194888259957058516432482121960109637632000 > 47707727343353896071849199802676518699529142272000 > 198688065044741506792127293398293547707178657251328000 > 97908297986853596289751162973434570005127864341000880128000 > 5658411485682054563233513036204820116833187371988441418956800000 > 3804418826562281061366609374760846640177306323287429048139264000000 > 2954227420326099129930691812076717959666831089054554318281052323840000 > 00 > 2632048450621963385564217879562108216922338757527021589770914779049216 > 000000 > 2674374039781190535182247433058431623911627168482448386681774871056508 > 05702656000000 > 3081998488818077502979646392150768764697262407973928271069996848309788 > 4292546560000 > 4079430842677444020458789055284437035377689124323794828380369516462185 > 2568977408000000 > 5854058595420455259314085499870932177527127956573251078768444812722023 > 3389546487676928000000 > 9562265549579035724936789114248267922015395457399253597102677301093514 > 221088746428140879872000000 > 1739718951590537042714251158989667483872007669374448115496657465787730 > 40131517368586035299090432000000 > 3512331724090453384614741919634889864232078679806054186280835886792417 > 959499924105350930517249228800000000 > > > 1 > > 16 > > 1584 > > 463104 > > 299289600 > > 361552896000 > > 732443959296000 > > 2305449150971904000 > > 10654390419268829184000 > > 6920214578354800558800000 > > 61152377325314475294720 > > 7098963015274747190071787520 > > 106459726394067298796772293345280 > > 21744352989317777418537171765166080 > > 47498845317423375939485280755676453273600 > > 1369194888259957058516432482121960109637632000 > > 47707727343353896071849199802676518699529142272000 > > 198688065044741506792127293398293547707178657251328000 > > 97908297986853596289751162973434570005127864341000880128000 > > 5658411485682054563233513036204820116833187371988441418956800000 > > 3804418826562281061366609374760846640177306323287429048139264000000 > > > 2954227420326099129930691812076717959666831089054554318281052323840000 > > 00 > > > 2632048450621963385564217879562108216922338757527021589770914779049216 > > 000000 > > > 2674374039781190535182247433058431623911627168482448386681774871056508 > > 05702656000000 > > > 3081998488818077502979646392150768764697262407973928271069996848309788 > > 4292546560000 > > > 4079430842677444020458789055284437035377689124323794828380369516462185 > > 2568977408000000 > > > 5854058595420455259314085499870932177527127956573251078768444812722023 > > 3389546487676928000000 > > > 9562265549579035724936789114248267922015395457399253597102677301093514 > > 221088746428140879872000000 > > > 1739718951590537042714251158989667483872007669374448115496657465787730 > > 40131517368586035299090432000000 > > > 3512331724090453384614741919634889864232078679806054186280835886792417 > > 959499924105350930517249228800000000 > > > 1 > 16 > 1584 > 463104 > 299289600 > 361552896000 > 732443959296000 > 2305449150971904000 > 10654390419268829184000 > 6920214578354800558800000 > 61152377325314475294720 > 7098963015274747190071787520 > 106459726394067298796772293345280 > 21744352989317777418537171765166080 > 47498845317423375939485280755676453273600 > 1369194888259957058516432482121960109637632000 > 47707727343353896071849199802676518699529142272000 > 198688065044741506792127293398293547707178657251328000 > 97908297986853596289751162973434570005127864341000880128000 > 5658411485682054563233513036204820116833187371988441418956800000 > 3804418826562281061366609374760846640177306323287429048139264000000 > 2954227420326099129930691812076717959666831089054554318281052323840000 > 00 > 2632048450621963385564217879562108216922338757527021589770914779049216 > 000000 > 2674374039781190535182247433058431623911627168482448386681774871056508 > 05702656000000 > 3081998488818077502979646392150768764697262407973928271069996848309788 > 4292546560000 > 4079430842677444020458789055284437035377689124323794828380369516462185 > 2568977408000000 > 5854058595420455259314085499870932177527127956573251078768444812722023 > 3389546487676928000000 > 9562265549579035724936789114248267922015395457399253597102677301093514 > 221088746428140879872000000 > 1739718951590537042714251158989667483872007669374448115496657465787730 > 40131517368586035299090432000000 > 3512331724090453384614741919634889864232078679806054186280835886792417 > 959499924105350930517249228800000000 > Something is wrong. Your first answers are correct but the others have mistakes. For instance, if n=11, the correct answer is 610152377325314475294720000000 i use O(n^4) and got AC in .062 s, if you have a better algo, plz explain to me, plz ,plz, plz .... sorry for my poor english. GOOD LUCK!!! The matter is that when I submit my pro, it got crash. But when I run it on my computer, it is OK. And the most unbelievable thing is : finally, I decide to hand in the result made by my pro, it got AC! I faint...... I can only find 5 routes when there are 2 cities on each island : 1 2 1 3 2 3 1 2 3 1 2 3 1 2 3 1 3 2 1 2 3 2 1 3 1 3 2 1 2 3 Who can tell me the other 11 routes? Edited by author 13.04.2004 06:02 Edited by author 13.04.2004 06:02 there are 3N -> 6 cities (2 on each island) not just 3... eight solutions are 1 3 5 4 6 2 1 3 6 4 5 2 1 4 5 3 6 2 1 4 6 3 5 2 1 5 3 6 4 2 1 5 4 6 3 2 1 6 3 5 4 2 1 6 4 5 3 2 the other 8 are simetrical hope I was useful. thank you very much! Now I understand the problem.And I found the 16 routes:(2k and 2k-1 are on the same island,k=1,2,3) 1 3 5 2 4 6 1 3 5 2 6 4 1 3 6 2 4 5 1 3 6 2 5 4 1 4 5 2 3 6 1 4 5 3 2 6 1 4 6 2 3 5 1 4 6 3 2 5 1 5 2 4 6 3 1 5 3 2 4 6 1 5 3 6 2 4 1 5 4 6 2 3 1 6 2 4 5 3 1 6 3 2 4 5 1 6 3 5 2 4 1 6 4 5 2 3 And I think your routes are not correct:the tourist must go back but he can't travel from 2 to 1.Thank you all the same! Is there any maths formula? Thanks. > Is there any maths formula? > Thanks. > > Is there any maths formula? > > Thanks. [code deleted] Edited by moderator 08.01.2020 17:28 |
|
|