Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement Chip testing by integrating SpringBoot with MybatisPlus

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report