QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#740286#6429. Let's Play CurlingDengDuckCompile Error//C++14552b2024-11-13 08:30:252024-11-13 08:30:26

Judging History

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

  • [2024-11-13 08:30:26]
  • 评测
  • [2024-11-13 08:30:25]
  • 提交

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);
	}
	if(Mx==0)return puts("Impossible");
	printf("%d\n",Mx);
}
int main()
{
	int T;scanf("%d",&T);
	while(T--)Work();
}

詳細信息

answer.code: In function ‘void Work()’:
answer.code:20:29: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
   20 |         if(Mx==0)return puts("Impossible");
      |                         ~~~~^~~~~~~~~~~~~~
answer.code: In function ‘int main()’:
answer.code:25:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   25 |         int T;scanf("%d",&T);
      |               ~~~~~^~~~~~~~~
answer.code: In function ‘void Work()’:
answer.code:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d%d",&n,&m);
      |         ~~~~~^~~~~~~~~~~~~~
answer.code:9:35: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         for(int i=1;i<=n;i++)scanf("%d",&A[i]);
      |                              ~~~~~^~~~~~~~~~~~
answer.code:10:35: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         for(int i=1;i<=m;i++)scanf("%d",&B[i]);
      |                              ~~~~~^~~~~~~~~~~~