24点 爆搜
作者:
Han_6
,
2022-02-21 22:33:14
,
所有人可见
,
阅读 205
#include<iostream>
#include<vector>
using namespace std;
const int N=4;
int a[N];
char op[N]={'+','-','x','/'};
int vis[N];
int vis2[N];
vector<vector<int>> turn;
vector<vector<char>> turn2;
void dfs(vector<int> path)
{
if(path.size()==N){
turn.push_back(path);
return ;
}
for(int i=0;i<N;i++){
if(!vis[i]){
vis[i]=1;
path.push_back(a[i]);
dfs(path);
path.pop_back();
vis[i]=0;
}
}
}
void dfs2(vector<char> path)
{
if(path.size()==3){
turn2.push_back(path);
return;
}
for(int i=0;i<N;i++){
path.push_back(op[i]);
dfs2(path);
path.pop_back();
}
}
int cal(vector<int> num,vector<char> op)
{
int res=num[0];
int j=1;
for(int i=0;i<op.size();i++){
switch(op[i]){
case '+':
res+=
}
}
}
int main()
{
while(cin>>a[0]>>a[1]>>a[2]>>a[3]){
vector<int> tmp;
dfs(tmp);
vector<char> tmp2;
dfs2(tmp2);
for(int i=0;i<tmp.size();i++){
for(int j=0;j<tmp2.size();j++){
}
}
}
return 0;
}