QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#294386#4825. Even and Odd Combinationsucup-team1631#0 0ms0kbPython3488b2023-12-30 13:16:462023-12-30 13:16:48

Judging History

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

  • [2023-12-30 13:16:48]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2023-12-30 13:16:46]
  • 提交

answer

from sys import stdin
input=lambda :stdin.readline()[:-1]

def solve():
  n,k=map(int,input().split())
  a=list(map(int,input().split()))
  IN=[0]*(n+1)
  for i in a:
    IN[i]=1
  ans=[]
  if n%2==1:
    for i in range(1,n+1):
      if IN[i]==0:
        ans.append(i)
  else:
    for i in range(1,n):
      if IN[i]==0:
        ans.append(i)
    if IN[n]==1:
      ans.append(n)
  print(n,len(ans))
  print(*ans)
    



for _ in range(int(input())):
  solve()

詳細信息

Test #1:

score: 0
Stage 1: Program answer Dangerous Syscalls

input:

6
3 0
2 1
1
3 3
1 2 3
3 1
1
3 1
2
3 1
3

output:

3 1
3

input:


output:


result: