QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#740286 | #6429. Let's Play Curling | DengDuck | Compile Error | / | / | C++14 | 552b | 2024-11-13 08:30:25 | 2024-11-13 08:30:26 |
Judging History
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();
}
Details
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]); | ~~~~~^~~~~~~~~~~~