全WA了,求大佬QAQ
查看原帖
全WA了,求大佬QAQ
880791
dudu18楼主2023/4/8 14:11
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int m,n,pos=1,cnt=0,tmp;
	int flag=1;
	cin>>m>>n;
	int *a=new int[m+1]();
	for(int i;i<=n;i++)
		a[i]=-1;	
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=m;j++)
		{
		cin>>tmp;
		if(tmp==a[j])
			{
				flag=0;
				break;
			}
		}
	if(flag)
	{
		a[pos]==tmp;
		cnt++;
		pos++;
		if(pos>m)
		{
			pos=1; 
		}
	}		
	}
	cout<<cnt; 
	return 0;
}
2023/4/8 14:11
加载中...