# codechef Cleaning Up 解决问题的方法

After a long and successful day of preparing food for the banquet, it is time to clean up. There is a list of n jobs to do before the kitchen can be closed for the night. These jobs are indexed from 1 to n.

Most of the cooks have already left and only the Chef and his assistant are left to clean up. Thankfully, some of the cooks took care of some of the jobs before they left so only a subset of the n jobs remain. The Chef and his assistant divide up the remaining
jobs in the following manner. The Chef takes the unfinished job with least index, the assistant takes the unfinished job with the second least index, the Chef takes the unfinished job with the third least index, etc. That is, if the unfinished jobs were listed
in increasing order of their index then the Chef would take every other one starting with the first job in the list and the assistant would take every other one starting with the second job on in the list.

The cooks logged which jobs they finished before they left. Unfortunately, these jobs were not recorded in any particular order. Given an unsorted list

of finished jobs, you are to determine which jobs the Chef must complete and which jobs his assitant must complete before closing the kitchen for the

evening.

### Example

```Input:
3
6 3
2 4 1
3 2
3 2
8 2
3 8

Output:
3 6
5
1

1 4 6
2 5 7```

```#pragma once
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <stdio.h>
#include <iostream>
using namespace std;

int CleaningUp()
{
int T, n, m, j = 0;
cin>>T;

while (T--)
{
cin>>n>>m;
bool finJobs[1001] = {0};
vector<int> chefJobs, assiJobs;
for (int i = 0; i < m; i++)
{
scanf("%d", &j);
finJobs[j] = true;
}
bool turn = true;
for (int i = 1; i <= n; i++)
{
if (!finJobs[i])
{
if (turn) chefJobs.push_back(i);
else assiJobs.push_back(i);
turn = !turn;
}
}
for (int i = 0; i < (int)chefJobs.size(); i++)
{
printf("%d ", chefJobs[i]);
}
putchar(‘\n‘);
for (int i = 0; i < (int)assiJobs.size(); i++)
{
printf("%d ", assiJobs[i]);
}
putc(‘\n‘, stdout);
}
return 0;
}```

## codechef Cleaning Up 题解

After a long and successful day of preparing food for the banquet, it is time to clean up. There is a list of n jobs to do before the kitchen can be closed for the night. These jobs are indexed from 1 to n. Most of the cooks have already left and onl

## 《成为技术领导者-掌握全面解决问题的方法》读后感

<成为技术领导者-掌握全面解决问题的方法>的作者是美国作家Gerald M.Weinberg,译者余晟. 我花了大约一周的时间将本书阅读完成的,购买本书的也是一个很巧合的,因为看到书名包含了技术(联想到了编程技术,因为作者从事过软件开发),且浏览了目录像是有技巧性的知识包含其中,于是就购买了,结果阅读的过程当中,我才发现本书跟编程技术.技巧没有多少关系,而副标题才是准确表达本书的核心,全书分为定义.创新.激励.组织.转变五个部分,详细入微的讨论了一个技术领导要解决问题的各种方法,让你看到,技术

## DB2 sql报错后查证原因与解决问题的方法

1.对于执行中的报错,可以在db2命令行下运行命令 : db2=>? SQLxxx 查看对应的报错原因及解决方法. 2.错误SQL0206N SQLSTATE=42703  检测到一个未定义的列.属性或参数名.  SQL0206N  "SQL_COU_ALL" is not valid in the context where it is used.  SQLSTATE=42703      db2 => ? "42703"          db2 =