QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#783573#6429. Let's Play Curlingsurenjamts#WA 0ms3512kbC++201.3kb2024-11-26 10:42:552024-11-26 10:42:56

Judging History

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

  • [2024-11-26 10:42:56]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3512kb
  • [2024-11-26 10:42:55]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
#define S second
#define F first
#define int long long
void solve(){
    int n,m;
    cin>>n>>m;
    vector<pair<int,int>> v;
    int a[n], b[m];
    set<int> s;
    for(int i=0; i<n; i++){
        cin>>a[i];
        //if(s.count(a[i])) continue;
        //pisda++;
        //v.push_back({a[i],1});
    }
    for(int i=0; i<m; i++){
        cin>>b[i];
        //v.push_back({b[i],2});
        //s.insert(b[i]);
    }
    int pisda=0;
    for(int i=0; i<m; i++){
        //cin>>b[i];
        v.push_back({b[i],2});
        s.insert(b[i]);
    }
    for(int i=0; i<n; i++){
        //cin>>a[i];
        if(s.count(a[i])) continue;
        pisda++;
        v.push_back({a[i],1});
    }
    if(pisda==0){
        cout<<"Impossible"<<endl;
        return;
    }
    int str=0;
    int ans=0;
    sort(v.begin(),v.end());
    for(pair<int,int> i: v){
            cout<<i.first<<" "<<i.second<<endl;
        if(i.second==1){
            str++;
            ans=max(ans,str);
        }
        else{
            str=0;
        }
    }
    cout<<ans<<endl;
}
signed main(){
    int t;
    cin>>t;
    while(t--) solve();
}

詳細信息

Test #1:

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

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:

1 2
2 1
3 1
4 2
2
1 2
2 1
3 2
3 2
4 2
5 1
7 1
7 1
10 2
3
Impossible

result:

wrong answer 1st lines differ - expected: '2', found: '1 2'