QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#301931#4825. Even and Odd CombinationsLoging#0 0ms0kbC++20700b2024-01-10 14:35:152024-01-10 14:35:15

Judging History

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

  • [2024-01-10 14:35:15]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [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...

input:


output:


result: