/ /

记录详情

Wrong Answer


  
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Wrong Answer Read -4112, expect 967. 6ms 432.0 KiB
#2 Wrong Answer Read -92, expect 1. 3ms 400.0 KiB
#3 Wrong Answer Read -4242, expect 8. 9ms 400.0 KiB
#4 Wrong Answer Read -3465, expect 145. 6ms 432.0 KiB
#5 Wrong Answer Read -1125, expect 4. 3ms 384.0 KiB
#6 Wrong Answer Read -2307, expect 7. 7ms 396.0 KiB
#7 Wrong Answer Read -5738, expect 24. 8ms 396.0 KiB
#8 Wrong Answer Read -15921, expect 37. 12ms 416.0 KiB
#9 Wrong Answer Read -2808, expect 5. 7ms 404.0 KiB
#10 Wrong Answer Read 0, expect 139. 2ms 384.0 KiB

代码

#include<iostream>
using namespace std;
int main()
{
	int m,n;
	cin>>m>>n;
	int i,j;
	int a[m],b[n],temp,sum=n,k;
	for(i=0;i<m;i++)
	{
		cin>>a[i];
	}
	for(i=0;i<n;i++)
	{
		cin>>b[i];
	}
	for(i=1;i<m;i++)
	{
		for(j=0;j<=m-i-1;j++)
		{
			if(a[j]<a[j+1])
			{
				temp=a[j];
				a[j]=a[j+1];
				a[j+1]=temp;
			}
		}
	}
		for(i=1;i<n;i++)
	{
		for(j=0;j<=n-i-1;j++)
		{
			if(b[j]<b[j+1])
			{
				temp=b[j];
				b[j]=b[j+1];
				b[j+1]=temp;
			}
		}
	}
	for(j=0;j<m;j++)
	{
		for(i=0;i<n;i++)
		{
		if(a[j]>=b[i]&&b[i]>0)
		{
		for(k=0;k<n;k++)
		{
			if(b[k]==b[i])
			{
				sum--;b[k]=0;
			}
		}
		}	
		}
	}
	cout<<sum;
}

信息

递交者
类型
递交
题目
P1009 苹果摘陶陶
题目数据
下载
语言
C++
递交时间
2021-08-11 18:44:07
评测时间
2021-08-11 18:44:07
评测机
分数
0
总耗时
68ms
峰值内存
432.0 KiB