Commit b5163502 authored by makoto.nishizawa's avatar makoto.nishizawa

change solver

parent ad6fb437
TARGET = sim all: main.cpp io.c solver.cpp router/router.cpp
OBJS = $(CPPS:.cpp=.o) g++ -o solve solver.cpp main.cpp io.c router/router.cpp -std=c++11
CPPS = $(wildcard *.cpp)
CXX = g++ o: main.o io.o solver.o
CXXFLAGS = -O3 -DSOFTWARE g++ -o solve main.o io.o solver.o
all: $(TARGET) main.o: main.cpp
g++ -c main.cpp
$(TARGET): $(OBJS)
$(CXX) -o $@ $(OBJS) io.o: io.c
g++ -c io.c
clean:
rm *.o solver.o: solver.cpp
rm $(TARGET) g++ -c solver.cpp -std=c++11
TARGET = sim
OBJS = $(CPPS:.cpp=.o)
CPPS = $(wildcard *.cpp)
CXX = g++
CXXFLAGS = -O3 -DSOFTWARE
all: $(TARGET)
$(TARGET): $(OBJS)
$(CXX) -o $@ $(OBJS)
clean:
rm *.o
rm $(TARGET)
This diff is collapsed.
...@@ -101,17 +101,11 @@ void read_problem(void){ ...@@ -101,17 +101,11 @@ void read_problem(void){
void print_answer(void){ void print_answer(void){
printf("\n --ANSWER-- \n"); //comment out this row printf("\n --ANSWER-- \n"); //comment out this row
int i,j; int i,j;
h=H;
w=W;
printf("SIZE %dX%d\n",w,h); printf("SIZE %dX%d\n",w,h);
for(i=0;i<h;i++){ for(i=0;i<h;i++){
for(j=0;j<w;j++){ for(j=0;j<w;j++){
if(board_data[j][i]!=-1){ printf("%3d",board_data[j][i]);
printf("%d",board_data[j][i]); if(j==w-1)
}else{
printf("*");
}
if(j==h-1)
printf("\n"); printf("\n");
else else
printf(","); printf(",");
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#define MAXBLOCK 5184 // 72*72 #define MAXBLOCK 5184 // 72*72
#define MAXLINE 2592 // 72*72/2 #define MAXLINE 2592 // 72*72/2
#define MAXW 72 #define MAXW 120
#define MAXH 72 #define MAXH 120
extern short int W, H; // (問題で設定された) 盤面サイズ上限 extern short int W, H; // (問題で設定された) 盤面サイズ上限
......
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
/* Last Change: 2019/05/21 (Tue) 14:44:03. */ /* Last Change: 2019/05/21 (Tue) 14:44:03. */
#include"io.h" #include"io.h"
#include"solver.h" #include"solver.h"
#include <stdio.h>
int main(void){ int main(void){
read_problem(); read_problem();
H=40;
W=40;
solver(); solver();
print_answer(); print_answer();
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
using namespace std; using namespace std;
#define ROUND_LIMIT 32768 // Max=65534(=2^16-2) #define ROUND_LIMIT 8192//4096//32768 // Max=65534(=2^16-2)
#define PRINT_BOARD #define PRINT_BOARD
//#define PRINT_SEARCH // for router debug //#define PRINT_SEARCH // for router debug
......
No preview for this file type
This diff is collapsed.
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment