QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#740285#6429. Let's Play CurlingDengDuckWA 0ms3956kbC++14514b2024-11-13 08:29:272024-11-13 08:29:27

Judging History

你现在查看的是最新测评结果

  • [2024-11-13 08:29:27]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3956kb
  • [2024-11-13 08:29:27]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
const int Inf=1.2e9;
int n,m,A[N],B[N];
inline void Work()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)scanf("%d",&A[i]);
	for(int i=1;i<=m;i++)scanf("%d",&B[i]);
	sort(A+1,A+n+1);
	sort(B+1,B+m+1);
	B[0]=-1,B[m+1]=Inf;
	int Mx=0;
	for(int i=1;i<=m+1;i++)
	{
		int K=lower_bound(A+1,A+n+1,B[i])-upper_bound(A+1,A+n+1,B[i-1]);
		Mx=max(Mx,K);
	}
	printf("%d\n",Mx);
}
int main()
{
	int T;scanf("%d",&T);
	while(T--)Work();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3956kb

input:

3
2 2
2 3
1 4
6 5
2 5 3 7 1 7
3 4 3 1 10
1 1
7
7

output:

2
3
0

result:

wrong answer 3rd lines differ - expected: 'Impossible', found: '0'