QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#748660#6429. Let's Play Curlingzhaomumu1218WA 1ms5996kbC++14813b2024-11-14 21:00:292024-11-14 21:00:29

Judging History

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

  • [2024-11-14 21:00:29]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5996kb
  • [2024-11-14 21:00:29]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int maxn=100010,maxm=100010;
int n,m,a[maxn],b[maxm],ans,len;
map<int,int>mp;
struct node{
    int z,y;
    bool operator<(const node t)const{
        return z<t.z;
    }
}x[maxn+maxm];
void solve(){
    mp.clear();
    len=ans=0;
    scanf("%lld%lld",&n,&m);
    for(int i=1;i<=n;i++) scanf("%lld",a+i);
    for(int i=1;i<=m;i++) scanf("%lld",b+i),mp[b[i]]=1,x[++len]=(node){b[i],2};
    for(int i=1;i<=n;i++) if(mp[a[i]]==0) x[++len]=(node){a[i],1};
    sort(x+1,x+1+len);
    int u=0;
    for(int i=1;i<=len;i++){
        if(x[i].y==1) u++;
        else u=0;
        ans=max(ans,u);
    }
    printf("%lld\n",ans);
}
signed main(){
    int T;
    scanf("%lld",&T);
    while(T--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 5996kb

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'