CF984A Game

原题链接:http://codeforces.com/contest/984/problem/A

Game

Two players play a game.

Initially there are n n integers a1,a2,,an written on the board. Each turn a player selects one number and erases it from the board. This continues until there is only one number left on the board, i. e. n1 n − 1 turns are made. The first player makes the first move, then players alternate turns.

The first player wants to minimize the last number that would be left on the board, while the second player wants to maximize it.

You want to know what number will be left on the board after n1 n − 1 turns if both players make optimal moves.

Input

The first line contains one integer $n (1≤n≤1000) — the number of numbers on the board.

The second line contains n n integers a1,a2,,an(1ai106).

Output

Print one number that will be left on the board.

Examples
input

3
2 1 3

output

2

input

3
2 2 2

output

2

Note

In the first sample, the first player erases 3 3 and the second erases 1. 2 2 is left on the board.

In the second sample, 2 is left on the board regardless of the actions of the players.

题解

贪心一下,第一个人肯定会选大的,第二个人选小的,最后剩的就是中间的了。

第一次看反了, get g e t A题 1 − 1 我怎么这么菜

代码
#include<bits/stdc++.h>
using namespace std;
const int M=1005;
int a[M],n;
void in(){scanf("%d",&n);for(int i=1;i<=n;++i)scanf("%d",&a[i]);}
void ac(){sort(a+1,a+1+n);printf("%d",a[(n+1)/2]);}
int main(){in();ac();}
<think> 我们已知在NVIDIA编码器中,ProfileGUID是标识编码配置文件的全局唯一标识符。用户提供了一个具体的GUID:{9C91657F-B7B3-470A-A61C-ED96CF43382E},要求解析其对应的编码配置文件。 根据NVIDIA Video Codec SDK文档,我们可以通过查找已知的GUID值来确定该ProfileGUID对应的配置文件。以下是一些常见的ProfileGUID及其含义: 对于H.264编码: - Baseline Profile: {6BCF80F3-350F-41B2-95B6-144F655D9BED} - Main Profile: {0BDFB032-472F-4C1D-9C0B-8F0A8C0F3E5B} - High Profile: {9C91657F-B7B3-470A-A61C-ED96CF43382E} // 注意:这正是用户提供的GUID 对于HEVC编码: - Main Profile: {D5F3A861-6E75-46B4-AA1B-02B6595FA4F0} - Main 10 Profile: {5DB74D3C-6C00-4D1A-B4C0-42E0A9B8F5C0} 因此,通过对比,我们可以确定: GUID {9C91657F-B7B3-470A-A61C-ED96CF43382E} 对应的是 **H.264 High Profile**。 解析步骤: 1. 确认GUID格式正确,并去除连字符和大写转换(通常比较时不区分大小写,但NVIDIA SDK中定义的GUID字符串为大写)。 2. 与已知的GUID进行比对。 在代码中,我们可以这样判断: ```c #include <nvEncodeAPI.h> // 假设我们有一个GUID需要解析 GUID profileGuid = {0x9c91657f, 0xb7b3, 0x470a, {0xa6, 0x1c, 0xed, 0x96, 0xcf, 0x43, 0x38, 0x2e}}; if (IsEqualGUID(profileGuid, NV_ENC_H264_PROFILE_HIGH_GUID)) { // 匹配成功,这是H.264 High Profile } ``` 注意:在NVIDIA SDK中,`NV_ENC_H264_PROFILE_HIGH_GUID`的定义就是{9C91657F-B7B3-470A-A61C-ED96CF43382E}。 所以结论:该ProfileGUID代表H.264 High Profile。 特性说明: - H.264 High Profile支持更高级的编码特性,例如: - 支持B帧(双向预测帧) - 支持CABAC(上下文自适应二进制算术编码)以提高压缩效率 - 支持更高的色度采样(如4:2:2和4:4:4,但实际支持取决于硬件) - 支持8位色深 使用场景: 通常用于高质量视频编码,如专业视频制作、广播级视频和蓝光视频等。 注意事项: 1. 使用此Profile需要确保硬件支持(如NVIDIA GPU从Kepler架构开始支持High Profile)。 2. 在设置编码参数时,如果使用High Profile,则相应的编码级别(Level)和层级(Tier)也需要匹配。 因此,用户提供的ProfileGUID解析为:**H.264 High Profile**。 [^1]: NVIDIA Video Codec SDK文档中关于编码配置文件的定义。 </think>### ProfileGUID 解析:{9C91657F-B7B3-470A-A61C-ED96CF43382E} #### 解析结果 该 ProfileGUID 对应 **H.264 High Profile**(NV_ENC_H264_PROFILE_HIGH_GUID),是 NVIDIA NVENC 编码器中用于高质量视频编码的标准配置[^1]。 #### 技术特性 该 Profile 支持以下高级编码特性: 1. **B帧支持**:允许使用双向预测帧提升压缩效率 2. **CABAC编码**:提供比CAVLC更高的压缩率(约$15\%$提升) 3. **色度采样增强**:支持4:2:2色度格式(需硬件支持) 4. **高精度量化**:支持8-bit色深和精细量化控制 5. **多参考帧**:最多可使用16个参考帧 #### 使用场景 ```mermaid graph LR A[H.264 High Profile] --> B[蓝光视频制作] A --> C[专业直播推流] A --> D[4K视频编码] A --> E[高质量视频存档] ``` #### 配置示例 ```c // 设置High Profile配置 NV_ENC_CONFIG encConfig = {0}; encConfig.profileGUID = NV_ENC_H264_PROFILE_HIGH_GUID; encConfig.rcParams.rateControlMode = NV_ENC_PARAMS_RC_VBR_HQ; // 高质量VBR模式 encConfig.encodeCodecConfig.h264Config.level = NV_ENC_LEVEL_H264_51; // Level 5.1 encConfig.encodeCodecConfig.h264Config.chromaFormatIDC = 1; // 4:2:0色度 ``` #### 硬件要求 - **最低支持**:Kepler架构(GTX 600系列以上) - **推荐配置**:Turing或更新架构(RTX 20系列+) - **显存需求**:4K编码需≥4GB显存 - **驱动要求**:NVIDIA Studio驱动或Game Ready驱动472.12+ > **注意**:实际性能取决于具体GPU型号,使用前需通过`nvEncGetEncodeProfileGUIDCount`查询支持状态[^1]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ShadyPi

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值