社区讨论
极其坑逼的结果
P1505[国家集训队] 旅游参与者 5已保存回复 6
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 6 条
- 当前快照
- 1 份
- 快照标识符
- @mi4eeug5
- 此快照首次捕获于
- 2025/11/18 17:56 4 个月前
- 此快照最后确认于
- 2025/11/18 17:56 4 个月前
Why?
CPP#include<cstdio>
#include<algorithm>
using namespace std;
int apple[201],taotao[201];
int main()
{
int n,m;
scanf("%d%d",&n,&m);
int left=m;
for (int i=0;i<n;++i)
scanf("%d",&apple[i]);
for (int i=0;i<m;++i)
scanf("%d",&taotao[i]);
sort(apple,apple+n);
sort(taotao,taotao+m);
for (int i=n-1;i>0;--i)
for (int j=m-1;j>0;--j)
{
if (apple[i]>taotao[j])
{
left--;
taotao[j]=301;
break;
}
}
printf("%d",left);
return 0;
}
回复
共 6 条回复,欢迎继续交流。
正在加载回复...