|
|
back to boardplease give a hint! I only use bruteforce and I constantly get WA at first easy tests (execution time is 0.01). All the test I was able to imagine passed OK with no corrections to the code... I assume dominoe graph is ok when 1) there are no more than two 'even' verteces AND 2) the graph is connected. in main() I call func(0) where func(int) is (simplified) void func(int p) { if(p==6) return; if(ok()) save_this(); for(i=1;i<=6;i++)for(j=i;j<=6;j++) { place_dominoe(i,j); func(p+1); remove_dominoe(i,j); } } Re: please give a hint! > I only use bruteforce and I constantly get WA at first easy > tests (execution time is 0.01). > All the test I was able to imagine passed OK with no > corrections to the code... > > I assume dominoe graph is ok when 1) there are no more than > two 'even' verteces AND 2) the graph is connected. > > in main() I call func(0) > where func(int) is (simplified) > > void func(int p) { > if(p==6) return; > if(ok()) save_this(); > for(i=1;i<=6;i++)for(j=i;j<=6;j++) { > place_dominoe(i,j); > func(p+1); > remove_dominoe(i,j); > } > } > if the graph is connected and two odd(!) or no odd vertices, so the graph is Euler one. Shame on me!! I should have carefully read the output format specification! (-) Re: Shame on me!! I should have carefully read the output format specification! (-) The graph should be connected only with regard to non-isolated nodes. |
|
|