Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to implement Chip testing by integrating SpringBoot with MybatisPlus

Shulou Source: shulou.com Published: 2022-05-31 23:52:30 09月10日 Update

This article will explain in detail how SpringBoot integrates MybatisPlus to achieve chip testing. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.

problem description

There are n (2≤n≤20) chips, some good and some bad, and it is known that there are more good chips than bad chips.

Each chip can be used to test other chips. When testing other chips with good chips, it can correctly give whether the tested chip is good or bad. When testing other chips with bad chips, good or bad test results will be randomly given (that is, this result has nothing to do with the actual quality of the chip under test).

Given the test results for all chips, ask which chips are good.

input format

The first line of input data is an integer n, indicating the number of chips.

The second row to the n+1 row are n*n tables, with n data in each row. Each data in the table is 0 or 1, and the data in the ith row and the jth column (1≤i, j≤n) in these n rows indicates the test result obtained when testing the jth chip with the ith chip, 1 indicates good, 0 indicates bad, and i=j is always 1 (and does not indicate the test result of the chip pair itself). The chip cannot test itself).

output format

Output all good chip numbers in descending order

problem-solving ideas

This topic focuses on thinking, figuring out the principle, programming is very simple!

One condition in the question is very important: we know that there are more good chips than bad chips.

So take any chip, look at all the chips, and if the number of ones is greater than zero, the chip is good.

The idea found, then how to find all the chips in the program to a chip evaluation sum?

In fact, it is very simple. The first column of the array actually indicates the evaluation of the jth chip on the first chip. In other words, directly determine the number of 1 and 0 in the first column. If the number of 1 is large, then the first chip is good.

Listing #includeusing namespace std;int main(){ int n=0; cin>>n; //Enter n,n greater than 2, less than 20 int a[n][n];for(int i=0;ia[i][j]; //Enter test result}for(int j=0;j

Tags: Chips tests results number data input articles evaluation integration that is ideas more formats programs output good practical important from small to big one line Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MySQL OPPO Reno Redmi Apple