博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UVA 1146 Now or later
阅读量:4618 次
发布时间:2019-06-09

本文共 2677 字,大约阅读时间需要 8 分钟。

The Terminal Radar Approach CONtrol (TRACON) controls aircraft approaching and departing

when they are between 5 and 50 miles of the airport. In this final scheduling process, air traffic
controllers make some aircraft wait before landing. Unfortunately this “waiting” process is complex
as aircraft follow predetermined routes and their speed cannot be changed. To reach some degree of
flexibility in the process, the basic delaying procedure is to make aircraft follow a holding pattern that
has been designed for the TRACON area. Such patterns generate a constant prescribed delay for an
aircraft (see Figure 1 for an example). Several holding patterns may exist in the same TRACON.
In the following, we assume that there is a single runway and that when an aircraft enters the
TRACON area, it is assigned an early landing time, a late landing time and a possible holding pattern.
The early landing time corresponds to the situation where the aircraft does not wait and lands as
soon as possible. The late landing time corresponds to the situation where the aircraft waits in the
prescribed holding pattern and then lands at that time. We assume that an aircraft enters at most
one holding pattern. Hence, the early and late landing times are the only two possible times for the
landing.
The security gap is the minimal elapsed time between consecutive landings. The objective is to
maximize the security gap. Robert believes that you can help.

题目大意:每架飞机可以选择早起飞和晚起飞,早起飞和晚起飞都有一个时间点,求一个安排方案,使得起飞时间的距离的最小值最大

对于最小值最大,显然二分答案,然后我们对于矛盾的建边,跑2-SAT即可

#include 
#include
#include
#include
#include
#include
#define RG register#define il inline#define iter iterator#define Max(a,b) ((a)>(b)?(a):(b))#define Min(a,b) ((a)<(b)?(a):(b))using namespace std;const int N=4005,M=16000005;int gi(){ int str=0;char ch=getchar(); while(ch>'9' || ch<'0')ch=getchar(); while(ch>='0' && ch<='9')str=(str<<1)+(str<<3)+ch-48,ch=getchar(); return str;}int n,L[N],R[N],num=0,head[N],to[M],nxt[M];bool mark[N];void init(int x,int y,bool tx,bool ty){ x=((x-1)<<1)+tx;y=((y-1)<<1)+ty; nxt[++num]=head[x];to[num]=y;head[x]=num;}void Clear(){ memset(head,0,sizeof(head));num=0; memset(mark,0,sizeof(mark));}int st[N],top=0;bool dfs(int x){ if(mark[x])return true; if(mark[x^1])return false; mark[x]=true;st[++top]=x; for(int i=head[x];i;i=nxt[i]) if(!dfs(to[i]))return false; return true;}bool solve(){ int lim=(n<<1); for(int i=0;i
>1; if(check(mid))ans=mid,l=mid+1; else r=mid-1; } printf("%d\n",ans);}int main(){ while(~scanf("%d",&n))work(); return 0;}

转载于:https://www.cnblogs.com/Yuzao/p/7477171.html

你可能感兴趣的文章
2018 leetcode
查看>>
各浏览器对 onbeforeunload 事件的支持与触发条件实现有差异
查看>>
PHP中获取当前页面的完整URL
查看>>
所谓输入掩码技术,即只有数字键起作用
查看>>
Display对象,Displayable对象
查看>>
安装oracle11G,10G时都会出现:注册ocx时出现OLE初始化错误或ocx装载错误对话框
查看>>
生产环境下正则的应用实例(一)
查看>>
在CentOS7命令行模式下安装虚拟机
查看>>
Arduino可穿戴开发入门教程Arduino开发环境介绍
查看>>
Windows平台flex+gcc词法分析实验工具包
查看>>
3.Python基础 序列sequence
查看>>
Chapter 4 Syntax Analysis
查看>>
vi/vim使用
查看>>
讨论Spring整合Mybatis时一级缓存失效得问题
查看>>
Maven私服配置Setting和Pom文件
查看>>
Linux搭建Nexus3.X构建maven私服
查看>>
Notepad++使用NppFTP插件编辑linux上的文件
查看>>
NPOI 操作Excel
查看>>
MySql【Error笔记】
查看>>
vue入门
查看>>