zoukankan      html  css  js  c++  java
  • 【USACO 2019 February Bronze】Measuring Traffic 题解

    这是老师放出来的题解:

    Let’s first focus on predicting the range of possible rates of traffic at the end of the highway (past mile N). To do this, we start with a large possible range [a,b] (initially set to [−999999999,+999999999]) and narrow / modify it as we scan through the different highway components from miles 1…N. Every time we see a sensor reading directly from the highway, this clips the possible range [a,b] to the range given by the sensor. Every time we see an on-ramp with range [a′,b′], the new range of possible traffic flows is [a+a′,b+b′]. Similarly, when we see an off-ramp with range [a′,b′], the new range of possible traffic flow values is [a−b′,b−a′] (after this update, we set the lower end of the range to zero if it goes negative, since we can’t have a negative rate of traffic flow).

    Predicting the range of possible initial flows is similar and essentially symmetric, where we scan backwards and keep track of a working range [a,b] that is narrowed / modified appropriately by each highway feature.

    翻译后:
    让我们首先关注预测高速公路末端(N英里)可能的交通量范围。为此,我们从一个较大的可能范围[a,b]开始(最初设置为[-999999999,+999999999]),并在扫描1…N英里的不同高速公路组件时缩小/修改它。每次我们看到传感器直接从高速公路读取数据时,这会将可能的范围[a,b]剪辑到传感器给定的范围。每当我们看到范围为[a′,b′的入口匝道时,可能的交通流的新范围为[a+a′,b+b′。类似地,当我们看到范围为[a′,b′的出口匝道时,可能的交通流值的新范围为[a-b′,b-a′(在这次更新之后,如果范围的下限变为负值,我们将其设置为零,因为我们不能有负的交通流速率)。

    预测可能的初始流量范围是相似的,并且基本上是对称的,我们向后扫描并跟踪一个工作范围[a,b],该工作范围被每个公路特征适当地缩小/修改。

  • 相关阅读:
    JVM-Java程序性能监控-初级篇
    一段获取app性能指标的py脚本
    一段从TXT导入excel的py脚本
    matplotlib根据Y轴数量伸缩画图的py脚本
    jsonpath读取json数据格式公用方法!!!
    python安装插件包注意事项
    Jenkins持续集成
    Jenkins简介&邮箱配置
    unittest框架扩展(基于代码驱动)自动化-下
    unittest框架扩展(自动生成用例)自动化-上
  • 原文地址:https://www.cnblogs.com/2020-zhy-jzoj/p/13159893.html
Copyright © 2011-2022 走看看