BAPC - Runway Planning

博客介绍机场跑道编号规则,编号由跑道方向度数除以10并四舍五入得到,通常取两方向中较小编号(非零)。跑道使用受风向影响,新建跑道编号应唯一。还给出输入输出格式及解题思路,即输入度数经计算后输出跑道编号。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Most airports have multiple runways. To identify runways, they are given a number indicat- ing the direction of the runway. Such a runway number is obtained by dividing the heading of the runway in degrees by ten, rounding the result, and optionally prefixing it with a ‘0’ if the result has only a single digit. For example, a runway with a heading of 82° is indicated by the number 08.If you are paying attention, you might think “a runway can be used in both directions, and therefore has two headings, but it is only assigned one runway number.” You are correct: normally a runway is identified by two numbers, based on the direction in which the runway is used. To simplify matters, we only concern ourselves with the smallest of these two num- bers, except if it is zero; we then use 18 instead. The runway numbers thus range from 01 to 18.

Now, you might think, “what if two runways have the same heading?” In that case, the characters ‘L’ and ‘R’ are appended to the number of the left and right runway, respectively. But what if three runways have the same heading? Then, the character ‘C’ is appended to the center runway. “But”, I can hear you ask, “what if four runways have the same heading?” If you really want to know, look up how Dallas/Fort Worth International Airport solved this problem after the contest. At any rate, we do not concern ourselves with multiple runways having the same heading in this problem, so you can forget all you read in this paragraph.

The runway in use is mostly determined by the current direction of the wind. It is pre- ferred to take off and land with headwind. If it is not possible to have the wind coming from straight ahead, its direction should be as close to that as possible. For example, if an airport has the runways 05 and 15, and the wind has a heading of 70°, taking off and landing using runway 05 is preferred, since the heading of that runway is closest to the heading of the wind.

Now, consider an airport already having one or more runways, and planning the con- struction of a new runway. Obviously, this runway should have a unique runway number: not only would we otherwise have a problem outside the boundaries of our restricted runway numbering outlined above, but, most importantly, this increases the probability of being able to take off or land with headwind.

The engineers at the airport under consideration have already determined the heading of the new runway, but still need you to determine the runway number. Note that the engineers are not very considerate with their input to your problem. They give you one heading of the runway, but it can be either the lowest or the highest heading of the runway. Be sure to give the lowest of the two runway numbers, as discussed in the second paragraph of this problem statement, even if you are given the highest of the two headings from the engineers.

输入格式

On the first line one positive number: the number of test cases, at most 100. After that per test case:

  • one line with a single integer hh (1 \leq h \leq 3601≤h≤360): the heading of the new runway in degrees.

输出格式

Per test case:

  • one line with the runway number of the newly constructed runway.

样例输入

4
82
115
316
4

样例输出

08
12
14
18

题意:

          签到题,没什么好说的,输入X度,将X加5(四舍五入),除以10,取模18,如果为零置为18,输出。

AC代码:

#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    while(n--)
    {
        int m;
        cin>>m;
        m=((m+5)/10)%18;
        if(m==0) m=18;
        printf("%02d\n",m);
    }
}


    

03-19
<think>好的,我现在需要处理用户关于BAPC包的信息查询。首先,用户可能指的是与生物信息学或数据分析相关的R包,比如Bioconductor中的某个包。但不确定具体是哪个,因为BAPC可能有多种缩写。 接下来,我应该检查常见的R包名称。Bioconductor里确实有一个名为“BAPC”的包,全称可能是Bayesian Age-Period-Cohort Modeling。这通常用于时间趋势分析,比如流行病学或人口统计学中的年龄-时期-队列模型。 然后,我需要确认这个包的功能。根据文档,BAPC包提供了贝叶斯方法来拟合APC模型,支持MCMC采样、模型诊断和结果可视化。用户可能想了解如何安装、基本用法或应用场景。 另外,用户提到“包的相关信息”,可能包括安装方法、依赖项、示例代码以及相关文献引用。需要确保提供的安装命令正确,比如使用BiocManager安装。同时,给出一个简单的示例代码能帮助用户快速上手。 还要考虑用户可能的后续问题,比如参数调优、结果解释或与其他包的比较。因此,在相关问题部分,可以包括这些方向,帮助用户深入探索。 最后,确保回答符合格式要求:行内公式用$,独立公式用$$,正确的中文回答,生成相关问题,引用标识正确。检查LaTeX语法无误,比如模型公式的正确书写。确认所有信息准确,引用来源可靠,如Bioconductor官网和相关文献。</think>关于BAPC包(Bayesian Age-Period-Cohort Modeling)的信息,这是一个用于时间趋势分析的R语言工具包,主要用于流行病学和人口统计学中的年龄-时期-队列模型分析[^1]。 ### 核心功能 1. 支持贝叶斯框架下的APC模型拟合 2. 提供MCMC采样方法进行参数估计 3. 包含模型诊断和可视化工具 4. 支持预测和不确定性量化 ### 安装方法 ```r if (!require("BiocManager")) install.packages("BiocManager") BiocManager::install("BAPC") ``` ### 基础使用示例 ```r library(BAPC) data(apcdata) model <- bapc(apcdata, predict.periods = 10, niter = 10000, nburn = 2000) plot(model) ``` 该包的核心模型可表示为: $$Y_{ijk} \sim Poisson(\mu_{ijk})$$ $$\log(\mu_{ijk}) = \alpha + \beta_i^{age} + \beta_j^{period} + \beta_k^{cohort}$$[^2]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值