(P1657选书)https://www.luogu.com.cn/problem/P1657
一、题面
二、详细代码及思路
#include<iostream>
using namespace std;
const int N = 25;
int num[N][3], mark[N];
int n; int ans = 0;
void dfs(int step) {
//如果到了n个学生就直接可以输出了,应为是从1开始的到n,n+1并不会进行搜索
if (step == n + 1) {
++ans;
return;
}
//对于第一志愿进行查找,如果第一志愿还没有被选走,