我需要帮助找到一个尽可能有效的算法来检查是否可以通过仅用一个矩阵翻转矩阵的行和列来达到给定的二进制矩阵.每当你翻转一行或一个col时,0变为1,所有1变为0
通过翻转1的矩阵的行和列来确定是否可以到达给定二进制矩阵的算法
例如,可以通过翻转第二行然后翻转第二列来达到此矩阵:
+---+---+---+
| 1 | 0 | 1 |
+---+---+---+
| 0 | 1 | 0 |
+---+---+---+
| 1 | 0 | 1 |
+---+---+---+
Run Code Online (Sandbox Code Playgroud)
但这个矩阵不可能是你做的任何翻转
+---+---+---+
| 1 | 0 | 0 |
+---+---+---+
| 0 | 1 | 0 |
+---+---+---+
| 0 | 0 | 1 |
+---+---+---+
Run Code Online (Sandbox Code Playgroud) 我尝试运行spring boot应用程序,它将返回静态文件夹中的HTML静态文件,问题是:每次加载页面:127.0.0.1我得到的是字符串“ bakara”,而不是HTML文件bakara.html 。当我加载127.0.0.1/bakara.html时,我得到了bakara.html文件
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>il.mda.ks</groupId>
<artifactId>mdaForm</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>mdaForm</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!-- This is a web application -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Tomcat embedded container -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<!-- JSTL for JSP -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<!-- Need this to compile JSP --> …Run Code Online (Sandbox Code Playgroud)