计算机软件能力认证考试CCF-202312-1 仓库规划

#自己跑的测试没问题,不知道为啥就是不能满分

原理比较绕,就是让数组中一行不断地与其他行进行比较,最终得到各自的索引

cpp 复制代码
#include <iostream>
using namespace std;
int main()
{
    int n;int m;
	cin>>n>>m;
int array[n][m];
if (m>0&&m<=10&&n>0&&n<=1000/* condition */)
{

  for (int i = 1; i <= n; i++) 
    {
        for (int j = 1; j <=m; j++) 
            cin>>array[i][j];
    }

for(int i=1;i<=n;i++)
	{
		bool A=false;
		for(int j=1;j<=n;j++)
		{
			bool B=true;
			if(i==j) continue;
			for(int k=1;k<=m;k++)
			{
				if(array[j][k]>array[i][k])
				{
					continue;
				}
				else 
				{
					B=false;
					break;
				}
			}
			if(B)
			{
				A=true;
				cout<<j<<endl;
				break;
			}
			
		
		}
		if(!A)
		{
			cout<<0<<endl;
		}
		
	}

	}
	else cout<<"error";
	exit;
return 0;
}
相关推荐
好记性+烂笔头1 分钟前
hot100_108. 将有序数组转换为二叉搜索树
算法·leetcode·职场和发展
thinkMoreAndDoMore7 分钟前
深度学习(3)-TensorFlow入门(常数张量和变量)
开发语言·人工智能·python
tt55555555555512 分钟前
每日一题——主持人调度(二)
c语言·数据结构·算法·leetcode·八股文
技术蔡蔡29 分钟前
Android字节码处理-函数耗时统计揭秘
算法·面试
qing_04060337 分钟前
数据结构——二叉搜索树
数据结构·c++·二叉树·二叉搜索树
蓝桉8021 小时前
图片爬取案例
开发语言·数据库·python
Felven1 小时前
B. Skibidus and Ohio
算法
逸狼1 小时前
【JavaEE进阶】Spring DI
java·开发语言
yonuyeung1 小时前
代码随想录算法【Day54】
java·数据结构·算法
Ljw...1 小时前
DeepSeek+Kimi生成高质量PPT
数据库·c++·powerpoint·ppt·deepseek