QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#301931 | #4825. Even and Odd Combinations | Loging# | 0 | 0ms | 0kb | C++20 | 700b | 2024-01-10 14:35:15 | 2024-01-10 14:35:15 |
answer
#include<cstdio>
#define M 55
bool mark[M];
int main(){
int T;
scanf("%d",&T);
while(T--){
int n,K;
scanf("%d%d",&n,&K);
for(int i=1;i<=n;i++)mark[i]=false;
for(int i=1;i<=K;i++){
int x;
scanf("%d",&x);
mark[x]=true;
}
printf("%d %d\n",n,n-K);
for(int i=1;i<=n;i++){
if(mark[i])continue;
printf("%d ",i);
}
puts("");
}
scanf("%d",&T);
while(T--){
int n,K;
scanf("%d%d",&n,&K);
for(int i=1;i<=n;i++)mark[i]=false;
for(int i=1;i<=K;i++){
int x;
scanf("%d",&x);
mark[x]=true;
}
printf("%d %d\n",n,n-K);
for(int i=1;i<=n;i++){
if(mark[i])continue;
printf("%d ",i);
}
puts("");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Stage 1: Program answer Time Limit Exceeded
input:
6 3 0 2 1 1 3 3 1 2 3 3 1 1 3 1 2 3 1 3
output:
3 3 1 2 3 2 1 2 3 0 3 2 2 3 3 2 1 3 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2 3 2 1 2...