diff --git a/main.cpp b/main.cpp index 3b67d95f9f6fc57a33f2d21b6667e341d3605f87..7c3cad0f3c436556d0936107332c35881cae7c0a 100644 --- a/main.cpp +++ b/main.cpp @@ -6,8 +6,12 @@ int main(void){ read_problem(); - solver(); - print_answer(); + if(solver()){ + printf("success!"); + print_answer(); + }else{ + printf("failed..."); + } return 0; } diff --git a/solve b/solve index 6e58acf23ab151dcd6679f52951a47aed3e70020..1e3d56667516d49782cbb78b7f75adef388a2239 100644 Binary files a/solve and b/solve differ diff --git a/solver.cpp b/solver.cpp index ffbb35d857ac9d308c7d83e62c92617657fcf8b3..5017f10db7d2febf4484b8bf5e7a911d5cc75635 100644 --- a/solver.cpp +++ b/solver.cpp @@ -26,6 +26,7 @@ short int board_str[900]; short int line_board[72][72]; short int mino_board[72][72]; short int put_data[72][72]; +short int success=0; vector mino_order; void reset_board(void){ @@ -552,6 +553,7 @@ int line(){ if(status){ //std::cout << "success to line" << std::endl; make_answer(); + success=1; }else{ //std::cout << "failed to line" << std::endl; } @@ -1010,11 +1012,11 @@ void solve(void){ return; } -void solver(void){ +int solver(void){ read_data(); solve(); /* shape(); */ //translate(); - return; + return success; } diff --git a/solver.h b/solver.h index e90033da802910604ece9941affa4f6f945b0882..1045636ead71eded19d0839d4bf16fcf959b7862 100644 --- a/solver.h +++ b/solver.h @@ -5,6 +5,6 @@ #define MAXSIZE 128 -void solver(void); +int solver(void); #endif // _SOLVER_H_