Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
4b07cf8b
Commit
4b07cf8b
authored
Feb 07, 2015
by
Mathieu Giraud
Browse files
core/dynprog.cpp: dp.backtrack(), format output, display score
parent
a2ddb84f
Changes
1
Hide whitespace changes
Inline
Side-by-side
algo/core/dynprog.cpp
View file @
4b07cf8b
...
...
@@ -407,14 +407,15 @@ void DynProg::backtrack()
str3
=
string
(
str3
.
rbegin
(),
str3
.
rend
());
ostringstream
back
;
back
<<
i
<<
"
>>
"
<<
str1
.
substr
(
0
,
BACKSIZE
-
8
)
<<
endl
;
back
<<
"
"
<<
str2
.
substr
(
0
,
BACKSIZE
-
8
)
<<
endl
;
back
<<
j
<<
"
>>
"
<<
str3
.
substr
(
0
,
BACKSIZE
-
8
)
<<
endl
<<
endl
;
back
<<
setw
(
3
)
<<
i
<<
" "
<<
str1
.
substr
(
0
,
BACKSIZE
-
8
)
<<
endl
;
back
<<
setw
(
3
)
<<
" "
<<
"
"
<<
str2
.
substr
(
0
,
BACKSIZE
-
8
)
<<
endl
;
back
<<
setw
(
3
)
<<
j
<<
" "
<<
str3
.
substr
(
0
,
BACKSIZE
-
8
)
<<
endl
<<
endl
;
for
(
size_t
k
=
0
;
(
BACKSIZE
-
8
+
k
*
BACKSIZE
)
<
str1
.
length
()
;
k
++
){
back
<<
str1
.
substr
(
BACKSIZE
-
8
+
k
*
BACKSIZE
,
BACKSIZE
)
<<
endl
;
back
<<
str2
.
substr
(
BACKSIZE
-
8
+
k
*
BACKSIZE
,
BACKSIZE
)
<<
endl
;
back
<<
str3
.
substr
(
BACKSIZE
-
8
+
k
*
BACKSIZE
,
BACKSIZE
)
<<
endl
<<
endl
;
}
back
<<
"score: "
<<
best_score
<<
endl
;
first_i
=
i
;
first_j
=
j
;
...
...
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