ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1063. Domino Puzzle

please give a hint!
Posted by Ilya Semenov (NSU) 4 Mar 2001 13:28
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!
Posted by Petko Minkov 4 Mar 2001 18:21
> 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! (-)
Posted by Ilya Semenov (NSU) 5 Mar 2001 10:53
Re: Shame on me!! I should have carefully read the output format specification! (-)
Posted by Denis Koshman 1 Aug 2008 15:30
The graph should be connected only with regard to non-isolated nodes.