Originally Posted by
whiteflags
It's impossible, here is proof by exhaustive search.
Code:
#include <stdio.h>
void MarkDirty(bool* , int);
int CountClean(bool*);
int main(){
bool Dirty[25];
for(int a = 0;a<25;a++){
for(int b = 0;b<25;b++){
for(int c = 0;c<25;c++){
for(int d = 0;d<25;d++){
for(int e = 0;e<25;e++){
if(a!=b && a!=c && a!=d && a!=e && b!=c && b!=d && b!=e && c!=d && c!=e && d!=e){
// every wolf is in a unique location
for(int x = 0;x<25;x++) Dirty[x] = false;
MarkDirty(Dirty , a);
MarkDirty(Dirty , b);
MarkDirty(Dirty , c);
MarkDirty(Dirty , d);
MarkDirty(Dirty , e);
if(CountClean(Dirty) > 2){
printf("Solution at %d %d %d %d %d\n" , a , b , c , d , e);
}
}
}
}
}
}
}
return 0;
}
void MarkDirty(bool* Dirty, int Cell){
int Row = Cell - (Cell % 5);
for(int x = Row;x<Row + 5;x++) Dirty[x] = true;
for(int x = 0;x<5;x++) Dirty[(Cell + (x*5)) % 25] = true;
for(int x = 0;x<5;x++) Dirty[(Cell + (x*5) + x) % 25] = true;
for(int x = 0;x<5;x++) Dirty[(Cell + (x*5) - x) % 25] = true;
return;
}
int CountClean(bool* Dirty){
int Count = 0;
for(int x = 0;x<25;x++){
if(!Dirty[x]) Count++;
}
return Count;
}