diff --git a/README b/README index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b48b2334e4ce90e08ce8ce800bc996bba5366909 100644 --- a/README +++ b/README @@ -0,0 +1,14 @@ +makeで実行ファイルsolverができます. +MAKEFILE + g++ -o solve solver.cpp main.cpp io.c router/router.cpp -std=c++11 + +./solver < QUESTIONFILEで実行され解答のみを出力します. + +必要ヘッダ + + + + +"solver.h" +"io.h" +"router/router.hpp" \ No newline at end of file diff --git a/router/router.cpp b/router/router.cpp index a5a6af66f7219f0ddf27daeb07cb90b099d1e209..1c87419caa10bf9af59523a282a92cda6f77a3b2 100644 --- a/router/router.cpp +++ b/router/router.cpp @@ -73,7 +73,7 @@ int router(short int size_x, short int size_y, short int line_num, short int boa lfsr_random_init(seed); // Step 1 - cout << "1st routing ..." << endl; + //cout << "1st routing ..." << endl; for(i = 0; i < line_num; i++) { if(adjacents[i]) continue; #ifdef PRINT_SEARCH @@ -90,7 +90,7 @@ int router(short int size_x, short int size_y, short int line_num, short int boa ap_uint<1> overlap_checks[MAX_CELLS]; // Step 2 - cout << "rip-up routing ..." << endl; + //cout << "rip-up routing ..." << endl; short int last_target = -1; ap_uint<16> round; for(round = 1; round <= ROUND_LIMIT; round++) { diff --git a/solve b/solve index 9c02f14a613cee5b1ffadad581b61201d245d20f..6e58acf23ab151dcd6679f52951a47aed3e70020 100644 Binary files a/solve and b/solve differ diff --git a/solver.cpp b/solver.cpp index b278bbca9ee4dbb7db0c680ab53c2449a4e44b95..ffbb35d857ac9d308c7d83e62c92617657fcf8b3 100644 --- a/solver.cpp +++ b/solver.cpp @@ -5,8 +5,10 @@ #include"solver.h" #include"io.h" #include -#include -#include +//#include +#include +#include +//#include #include "router/router.hpp" /* #include */ /* #include */ @@ -38,9 +40,9 @@ void show_blocks(){ int data[4][4]; int i,j,k; for(i=1;i0;index--){ - std::cout << done_block[index]; + //std::cout << done_block[index]; if(done_block[index]==0){ next=index; break; } } - std::cout << endl; + //std::cout << endl; if(index==0) break; // if all blocks are searched } if(index==-1) break; // if all blocks are searched @@ -310,7 +312,7 @@ void put_mino(){ - printf("\n\nstart making order of height\n"); + //printf("\n\nstart making order of height\n"); for(int i=1;i<=blocks;i++){//init status check_block[i]=0; done_block[i]=0; @@ -445,7 +447,7 @@ void put_mino(){ //if(x==1)break; }//end of while ture for height - printf("width is \n"); + /*printf("width is \n"); for(int i=0;i1;j--){ - if(check_put_mino(next,j,mino_y)){ - mino_x=j; - }else{ - break; - } - } - }else{ - for(int j=mino_y-1;j>1;j--){ - if(check_put_mino(next,mino_x,j)){ - mino_y=j; - }else{ - break; - } - } - - } - data_mino(next,mino_x,mino_y); - }*/ } void make_board_str(int size_x,int size_y){ for(int y = 0; y < size_y; y++) { @@ -552,7 +529,7 @@ void make_small(){ } W=maxw+2; H=maxh+2; - cout << "W is " << W << " H is " << H << endl; + //cout << "W is " << W << " H is " << H << endl; return; } @@ -569,14 +546,14 @@ void make_answer(){ int line(){ make_board_str(W,H); - std::cout << lfsr <> move_order; int move=0,check_line=0,mino_dir,flag=0,check_num=0; - std::cout << "start move2line" << std::endl; + //std::cout << "start move2line" << std::endl; for(int i=1;i<=blocks;i++){ move_order.push_back(make_pair(block_data[i][0][0]+block_data[i][0][1],i)); } @@ -789,7 +766,7 @@ int move2line(){ check_line=set_line(move_order[i].second); check_num=set_num(move_order[i].second,check_line); if(check_line==0) continue; - cout << "move " << move_order[i].second<< " line " <=end) break; } if(flag){ @@ -917,7 +894,7 @@ void resize(){ } w=maxw-minw+1; h=maxh-minh+1; - cout << "w is "<< w << "h is " << endl; + //cout << "w is "<< w << "h is " << endl; return; } @@ -994,7 +971,7 @@ void solve(void){ printf("too large\n"); return; } - std::cout << "height is " << H <<" width is "<< W << std::endl; + //std::cout << "height is " << H <<" width is "<< W << std::endl; init_mino(); put_mino(); @@ -1013,7 +990,7 @@ void solve(void){ } } if(check_space==0 && check_line==0){ - cout << "no more reshape" << endl; + //cout << "no more reshape" << endl; } //resize(); }