19 lines
366 B
C++
19 lines
366 B
C++
#pragma once
|
|
|
|
#include "clusters.hpp"
|
|
|
|
template <typename Field>
|
|
auto solve(Field const & field){
|
|
for(auto&& p : field.all_positions()){
|
|
if(!field.empty(p)) goto analyse;
|
|
}
|
|
return true;
|
|
|
|
analyse:
|
|
for(auto&& c : all_clusters(field)){
|
|
if(c.size() < 2) continue;
|
|
auto new_field = make_empty(field, c);
|
|
if(solve(new_field)) return true;
|
|
}
|
|
return false;
|
|
}
|