QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#783573 | #6429. Let's Play Curling | surenjamts# | WA | 0ms | 3512kb | C++20 | 1.3kb | 2024-11-26 10:42:55 | 2024-11-26 10:42:56 |
Judging History
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'