QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#301936#4825. Even and Odd CombinationsLoging#0 0ms0kbC++20718b2024-01-10 14:37:402024-01-10 14:37:40

Judging History

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

  • [2024-01-10 14:37:40]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-01-10 14:37:40]
  • 提交

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("");
	}
	fflush(stdout);
	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;
}

詳細信息

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: