HBC223803[NOIP1999]邮票面值设计,深度优先搜索(DFS),NOIP复赛,搜索JourneytoUn'Goro题解

上官魅 算法基础篇 33 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
Recently, you've taken a trip to Un'Goro. A small road in Un'Goro has attracted your eyes. The road consists of n{n}n steps, each colored either red or blue. When you go from the i{i}ith step to the j{j}jth, you count the number of red steps you've stepped. You will be satisfied if the number is odd. ``What is the maximum number of pairs (i,j){}(i,j) , such that I'll be satisfied if I walk from the i{i}ith step to the j{j}jth?'' you wonder. Also, how to construct all colorings such that the number of pairs is maximized?

Recently, you've taken a trip to Un'Goro. A small road in Un'Goro has attracted your eyes. The road consists of n{n}n steps, each colored either red or blue. When you go from the i{i}ith step to the j{j}jth, you count the number of red steps you've stepped. You will be satisfied if the number is odd. ``What is the maximum number of pairs (i,j){(i, j)}(i,j) (1≤i≤j≤n)(1 leq i leq j leq n)(1≤i≤j≤n), such that I'll be satisfied if I walk from the i{i}ith step to the j{j}jth?'' you wonder. Also, how to construct all colorings such that the number of pairs is maximized?

HBC223803[NOIP1999]邮票面值设计,深度优先搜索(DFS),NOIP复赛,搜索JourneytoUn'Goro题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)

标签: HBC223803[NOIP1999]邮票面值设计 深度优先搜索(DFS) NOIP复赛 搜索JourneytoUn'Goro题解