【day60】

有n(2≤n≤20)块芯片,有好有坏,已知好芯片比坏芯片多。

每个芯片都能用来测试其他芯片。用好芯片测试其他芯片时,能正确给出被测试芯片是好还是坏。而用坏芯片测试其他芯片时,会随机给出好或是坏的测试结果(即此结果与被测试芯片实际的好坏无关)。

给出所有芯片的测试结果,问哪些芯片是好芯片。

cpp 复制代码
#include<iostream>
#include<vector>
using namespace std;
vector<int>ans;
int n;
int a[20][20];
bool found;
bool rightchip(int row) {
	if (ans.empty())return true;
	for (int i = 0; i < n; i++) {
			if (a[ans[0]][i] != a[row][i])return false;
	}
	return true;
}
void dfs(int cur,int target) {
	if (found)return;
	if (target == 0) {
		for (int c : ans)cout << c+1 << " ";
		cout << endl;
		found = true;
		return;
	}
	//1、剩余的芯片小于还需要达成的目标数
	//2、最后一块芯片已经检查完了
	if (n - cur < target || cur == n)return;
	//不选
	if (!found)dfs(cur + 1, target);
	//选
	if (rightchip(cur)) {
		ans.push_back(cur);
		dfs(cur + 1, target - 1);
		ans.pop_back();
	}
}
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			cin >> a[i][j];
		}
	}
	for (int i = n; i > n / 2; i--) {
		ans.clear();
		found = false;
		dfs(0, i);
		if (found)break;
	}
	return 0;
}

Generative artificial intelligence refers to a class of AI technologies that can generate new content such as text, images, and audio. Unlike traditional discriminative models, generative models learn the distribution of data and produce new samples based on learned patterns. In recent years, with the advancement of deep learning techniques, generative models have achieved significant progress in many fields. For instance, generative adversarial networks and large language models are capable of producing high-quality images and natural language text. These technologies have broad application prospects in areas such as content creation, intelligent assistants, and virtual reality. However, generative AI also introduces challenges such as the spread of misinformation and copyright protection issues. Therefore, how to strengthen regulation while promoting technological development has become an important research topic.

生成式人工智能是AI科技的一种分类,能生成新内容,比如文本、图像和音频。与传统分类模型不同,生成式模型学习数据的分布情况,然后生成以已学习的模式为基础的新样本。在近些年,随着深度学习技术的进步,生成式模型在许多领域已达到非凡的成就。生成式对抗网络和大型语言模型能生成高质量图像和自然语言文本。这些技术拓宽了许多领域的应用前景,比如文本创造、智能助手和虚拟现实。生成式AI同样带来许多挑战,比如不实信息的扩散和版权保护议题。因此,如何去加强。管理当推动科技进步已经成为重要的研究主题。


相关推荐
贾斯汀玛尔斯1 天前
每天学一个算法--LSM-Tree(Log-Structured Merge Tree)
java·算法·lsm-tree
浅念-1 天前
刷穿LeetCode:BFS 解决 Flood Fill 算法
数据结构·c++·算法·leetcode·职场和发展·bfs·宽度优先
做cv的小昊1 天前
【TJU】研究生应用统计学课程笔记(8)——第四章 线性模型(4.1 一元线性回归分析)
笔记·线性代数·算法·数学建模·回归·线性回归·概率论
贾斯汀玛尔斯1 天前
每天学一个算法--倒排索引(Inverted Index)
算法·inverted-index
小e说说1 天前
打破偏科困境:这些学习软件助孩子重燃学习热情
算法
月昤昽1 天前
autoCAD二次开发 4.正多边形与collection区分
算法·c#·二次开发·autocad二次开发
休息一下接着来1 天前
C++ 固定容量环形队列实现
c++·算法
im_AMBER1 天前
手撕hot100之矩阵!看完这篇就AC~
javascript·数据结构·线性代数·算法·leetcode·矩阵
笨笨饿1 天前
#79_NOP()嵌入式C语言中内联汇编宏的抽象封装模式研究
linux·c语言·网络·驱动开发·算法·硬件工程·个人开发