Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nszw-solver
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
adc2019
nszw-solver
Commits
7be869e7
Commit
7be869e7
authored
Aug 26, 2019
by
Kento HASEGAWA
Browse files
Options
Browse Files
Download
Plain Diff
Merge master
parents
849bed35
7ed29987
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
5 deletions
+18
-5
README.md
README.md
+3
-0
main.cpp
main.cpp
+6
-2
solver.cpp
solver.cpp
+8
-2
solver.h
solver.h
+1
-1
No files found.
README.md
View file @
7be869e7
# 2019/08/26 追記
配線失敗時にボードを出力しないように変更しました
# 実行方法
# 実行方法
```
```
cd nszw-solver
cd nszw-solver
...
...
main.cpp
View file @
7be869e7
...
@@ -6,8 +6,12 @@
...
@@ -6,8 +6,12 @@
int
main
(
void
){
int
main
(
void
){
read_problem
();
read_problem
();
solver
();
if
(
solver
()){
print_answer
();
printf
(
"success!"
);
print_answer
();
}
else
{
printf
(
"failed..."
);
}
return
0
;
return
0
;
}
}
...
...
solver.cpp
View file @
7be869e7
...
@@ -26,6 +26,8 @@ short int board_str[900];
...
@@ -26,6 +26,8 @@ short int board_str[900];
short
int
line_board
[
72
][
72
];
short
int
line_board
[
72
][
72
];
short
int
mino_board
[
72
][
72
];
short
int
mino_board
[
72
][
72
];
short
int
put_data
[
72
][
72
];
short
int
put_data
[
72
][
72
];
short
int
success
=
0
;
short
int
answerw
=
0
,
answerh
=
0
;
vector
<
int
>
mino_order
;
vector
<
int
>
mino_order
;
void
reset_board
(
void
){
void
reset_board
(
void
){
...
@@ -49,6 +51,8 @@ void show_blocks(){
...
@@ -49,6 +51,8 @@ void show_blocks(){
}
}
void
read_data
(
void
){
void
read_data
(
void
){
answerw
=
W
;
answerh
=
H
;
//show_blocks();
//show_blocks();
return
;
return
;
}
}
...
@@ -552,6 +556,7 @@ int line(){
...
@@ -552,6 +556,7 @@ int line(){
if
(
status
){
if
(
status
){
//std::cout << "success to line" << std::endl;
//std::cout << "success to line" << std::endl;
make_answer
();
make_answer
();
success
=
1
;
}
else
{
}
else
{
//std::cout << "failed to line" << std::endl;
//std::cout << "failed to line" << std::endl;
}
}
...
@@ -1010,11 +1015,12 @@ void solve(void){
...
@@ -1010,11 +1015,12 @@ void solve(void){
return
;
return
;
}
}
void
solver
(
void
){
int
solver
(
void
){
read_data
();
read_data
();
solve
();
solve
();
/* shape(); */
/* shape(); */
//translate();
//translate();
return
;
if
(
w
>
answerw
||
h
>
answerh
)
success
=
0
;
return
success
;
}
}
solver.h
View file @
7be869e7
...
@@ -5,6 +5,6 @@
...
@@ -5,6 +5,6 @@
#define MAXSIZE 128
#define MAXSIZE 128
void
solver
(
void
);
int
solver
(
void
);
#endif // _SOLVER_H_
#endif // _SOLVER_H_
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment