总结:为什么你看到题想不出来怎么写呢,我想不到这道题还会用到dfs的思想,顶多能知道可能会有贪心,还是得多做题。
这道题让我想起来导弹拦截和借教室,记得有空做做!!不要研究难题,把基本算法研究透03了!!!别死磕,要灵活!
0326重写!accept!!!
#include<algorithm>
#include<iostream>
#include<cstring>
#include<queue>
using namespace std;
struct node{
int l;
int d;
int t;
};
node a[55];
int n;
int T;
bool vis[55];
bool dfs(int u, int last){
if(u == n) return true;
for(int i=0;i<n