codeforces 746 B. Decoding【水题】

深入探索前端调试神器vConsole vConsole作为一款前端调试神器,为前端开发者提供了一个便捷的调试解决方案。通过本文的介绍和示例,相信你已经对vConsole有了更深入的了解。然而,vConsole的功能远不止于此,它还有许多高级用法和技巧等待你去发掘。讨论:你在前端开发中是如何使用vConsole的?你有没有发现vConsole的一些隐藏功能或技巧?欢迎在评论区分享你的经验和见解!💝💝💝欢迎来到我的博客,很高兴能够在这里和您见面! 阅读详情
B. Decoding
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, info. If the word consists of single letter, then according to above definition this letter is the median letter.

Polycarp encodes each word in the following way: he writes down the median letter of the word, then deletes it and repeats the process until there are no letters left. For example, he encodes the word volga as logva.

You are given an encoding s of some word, your task is to decode it.

Input

The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word.

The second line contains the string s of length n consisting of lowercase English letters — the encoding.

Output

Print the word that Polycarp encoded.

Examples
input
5
logva
output
volga
input
2
no
output
no
input
4
abba
output
baba
Note

In the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter gwhich was at the second position, the word became va. Then he wrote down the letter v, then the letter a. Thus, the encoding looked likelogva.

In the second example Polycarp encoded the word no. He wrote down the letter n, the word became o, and he wrote down the letter o. Thus, in this example, the word and its encoding are the same.

In the third example Polycarp encoded the word baba. At first, he wrote down the letter a, which was at the position 2, after that the word looked like bba. Then he wrote down the letter b, which was at the position 2, his word looked like ba. After that he wrote down the letterb, which was at the position 1, the word looked like a, and he wrote down that letter a. Thus, the encoding is abba.


/*
    题意:给定一个长度为n的字符串,它是经过转化的得来的字符串,转化规则是每次把字符串的
          中间字符输出(如果有两个则输出左边的字符),输出以后删掉。问原来的字符串是什么。
    类型:水题
    分析:写几个字符串找找规律就行了
*/
#include<iostream>
#include<string>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 2005;
char s[maxn];
int main()
{
    int n;
    scanf("%d",&n);
    scanf("%s",s+1);
    if(n&1){
        for(int i=n-1;i>=2;i-=2){
            printf("%c",s[i]);
        }
        for(int i=1;i<=n;i+=2){
            printf("%c",s[i]);
        }
    }
    else{
        for(int i=n-1;i>=1;i-=2){
            printf("%c",s[i]);
        }
        for(int i=2;i<=n;i+=2){
            printf("%c",s[i]);
        }
    }
    puts("");
    return 0;
}


SAP ABAP SM50 的另类用途 - ABAP 工作进程对数据库表读取操作的检测 今天是2020年五一国际劳动节,Jerry祝大家劳动节快乐。 虽然五一国际劳动节来源于一百多年前国外无产阶级的一次大罢工,但由于国情原因,国内很多行业的从业人员,好像天生就是劳碌命。比如程序员行业。 2014年五一劳动节,我在和一个不是总能重现的SAP CRM incident做斗争。详情参考Jerry之前的文章记一次SAP开发工程师给微软Azure报incident的体验. 当时处理完这个复杂... 阅读详情

相关推荐

Python对接海康威视机器视觉工业相机

工业相机只允许单条连接,也就是说MVS如果连接了相机,python代码就无法获取数据,此时必须。相机工具类(读者直接复制)HKCamera_class.py。博主这里出现了一个警告:获取不到相机参数。四、使用Pycharm打开Python代码示例文件夹。三、找到MVS示例代码(代码在MVS的安装位置)二、解压并安装MVS客户端。一、下载MVS客户端。安装一下opencv。

Good Luck 2万+

洛谷 CF1B Spreadsheets(字符串模拟,细节)

题目链接: Spreadsheets - 洛谷 “简单”的字符串模拟,一看就会,一写就废。 思路: 要进行两种坐标表示方式的转换,首先可以把任务分成两部分:1.判断输入是哪种表示方式,2.输出另一种表示方式。 首先是判断部分:Excel型和RXCY型都既有字母又有数字,不是很好处理。经过思考之后,发现可以这样判断:第一个字符是R,第二个字符是数字,并且后面有一个C,则是RXCY型,否则是Excel型。 然后是表示方式的转换,其中字母转数字很简单,数字转字母稍微难一点。详见代码。 代码:

bunny_1024的博客 703

LSS(Lift, Splat, Shoot)算法解析

**LSS(Lift, Splat, Shoot)** 是一个比较经典的自下而上的构建BEV特征的3D目标检测算法,通过将图像特征反投影到3D空间生成伪视锥点云,通过`Efficientnet`算法提取云点的深度特征和图像特征并对深度信息进行估计,最终将点云特征转换到BEV空间下进行特征融合和后续的语义分割任务。 本篇按照LSS代码的运行逻辑,结合论文对LSS算法进行解析。

超爱吃小蛋糕的66的博客 8700

CodeForces 746B Decoding

B. Decoding time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp is mad about coding, that is why he wri

Calm微笑 781

AI算力网络与通信领域流量分析:优化策略探讨_副本

今天的AI就像一个"超级吃货",每天要"吃"掉海量数据、“消耗"巨量算力——训练一个千亿参数的大模型,可能需要上万块GPU同时工作数周,其间产生的数据传输量足以填满数百万个1TB硬盘。这些GPU和计算节点通过网络连接形成"AI算力网络”,而数据在节点间的流动就是"通信流量"。如果把算力比作AI的"肌肉",那流量就是"血液"——血液不通畅,肌肉再强也使不上劲。

AI天才研究院 1214

S7-1200控制S120变频器

②:硬件目录下,添加实物S120设备进行组态(其它现场设备--PROFINET IO--DRIVES......②:双击S120进行IP地址和设备名称设置(注:此处要与STATER软件设置S120一致)M10.0接通时,电机开始运行,M10.0断开,电机停止,调试完成。①:将S7-1200与S120进行通讯连线。④:STATER软件下设置与组态一致的报文。①:点击添加新设备,按实物进行设备组态。②:打开OB1,编写启动停止程序。①:查看S120报文地址。②:模块下添加DO矢量。③:子模块下添加报文。

weixin_38261173的博客 4874

codeforces 746 Decoding

Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median

asd1637579311的博客 277

《生化危机9:安魂曲》D加密免BIOS破解方案详解

数字版权管理(DRM)技术通过加密手段保护软件版权,Denuvo(D加密)作为主流方案常应用于3A游戏。其原理是通过实时验证机制阻止未授权访问,但可能影响性能表现。本文以《生化危机9》为例,解析一种免BIOS修改的D加密绕过方案,该方案通过授权启动器模拟正版验证流程,保持系统零侵入性。实测表明,该方法在GTX 1060至RTX 3070等多硬件平台均能稳定运行,支持MOD扩展且兼容Reshade画质增强,为玩家提供开箱即用的绿色版体验。

weixin_33898233的博客 935

Decoding CodeForces - 746B

Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median

QQ:690217293 506

在WSL2中配置代理(Windows)

通过按照上述步骤在WSL2中配置代理,我们可以轻松地在Windows子系统Linux中使用代理服务器访问互联网。请确保提供正确的代理服务器地址和端口号,并根据实际情况进行修改。在WSL2中使用代理是一个常见的需求,它允许我们在Windows子系统Linux中通过代理服务器访问互联网。本文将详细介绍如何在WSL2中配置代理,并提供相应的源代码示例。如果返回的IP地址与代理服务器所在地不同,说明代理正常工作。希望本文能对你有所帮助!如有其他问题,请随时向我提问。替换为实际的代理服务器地址和端口号。

FcUnity的博客 4361

为JETSON TX2开发板部署YoloV5

参考资料一:nvidia为JETSON Tx2编译的pytorch 参考资料二:Jetson软件包下载 参考资料三:Tx2安装工具的使用 参考资料四: Jetson烧录工具 参考资料五: B站下载的行人视频 一、升级TX2系统版本到最新版(JetPack4.6) 我拿到的板子的版本太低了,在工作的过程中会有很多问题,因此要先升级到最新版 下载参考资料四中的烧录工具,在Ubuntu18.04中安装,只能,必须,一定是Ubuntu18.04 安装完成后使用非root用户启动SDK Manger,登录Nvi.

贱贱的剑 5890

CF16A Flag(#模拟 -1.7)

题意翻译 根据一项新的ISO标准,每一个国家的国旗应该是一个n×m的格子场,其中每个格子最多有10种不同的颜色。并且国旗应该有条纹:旗帜的每一行应包含相同颜色的方块,相邻的行的颜色应该是不同的。Berland政府要求你找出他们的国旗是否符合新的ISO标准。 输入格式: 输入的第一行包含数n和m( ( 1&lt;=n,m&lt;=100 ),其中n为行数,m为列数。接下来 是对旗的描述:以下...

A.pro的博客 440

Unity大世界流式加载:工业级架构与优化秘籍

游戏大厂Unity大世界流式加载框架全景解析:从《原神》《和平精英》等标杆案例出发,深入剖析工业级流式加载的完整技术架构。文章系统介绍了大世界分区块管理、异步加载机制、资源优化策略、多平台适配方案,以及业务联动与团队协作流程。重点阐述了Addressable与AssetBundle应用、空间触发器设计、性能自适应等核心技术,并展望AI预测加载、云游戏等未来方向。全面展现了大厂如何通过流式加载技术实现无缝开放世界体验的技术路径与实践经验。

本博客聚焦游戏开发技巧、创业实战心得及大学热门课程干货。这里既有技术深度,也有思维广度,无论你是开发者、创业者还是高校学子,都能在这里找到适合自己的成长之路! 617

【codeforces 746B】 Decoding

Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls themedian letterin a word the letter which is in the middle of the word. If the word's length is even, the med...

词庸 543

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

【Codeforces 746B Decoding】 + 构造

B. Decoding time limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputPolycarp is mad about coding, that is why he writes Sveta encoded message

楚江枫 816

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

746B Decoding

题目链接: http://codeforces.com/problemset/problem/746/B 题解: 水题我是直接暴力模拟做的这道题目的。 代码:#include <cmath> #include <vector> #include <map> #include <stack> #include <cstring> #include <iostream> #include <a

silver_bone的博客 407

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

CodeForces - 746B Decoding(思维题)

题目 加密方式是每次取原串的中位数位置(如果有两个就取左边那个) 然后取出这个字母来,缀在新串后面 现在给你一个已经加密好的串, 求原串,即将串解密 思路来源 钱神 题解 模拟加密过程, 每次取中位数位置的那个实际位置 将该位置赋对应的加密串的位置的字母 不断将n缩短,直至全部加密完 心得 算是用vector实现了一下list叭 vector这个东西无所不能  能二分...

小衣同学的博客 290

746 B. Decoding codeforces

#include using namespace std; int main() { int n; char str[2005],str1[2005]; scanf("%d",&n); scanf("%s",str); int len=strlen(str); for(int i=len-1;i>=0;i--) { str[

ScorpioN___的博客 469

C - Decoding CodeForces - 746B(双向队列)

Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word’s length is even, the median...

weixin_44694282的博客 191

Codeforces Round #386 (Div. 2) 746B Decoding 【模拟】

题目传送门:点击打开链接B. Decodingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp is mad about coding, that is why he writes Sveta encoded messages. ...

Emiya丶的博客 664

Codeforces #386 B 746B Decoding

这个题应该算是一个模拟题,虽然想AC不难。但是,我想用好的姿势AC。

ccutyear的博客 792

【75.28%】【codeforces 764B】Decoding

time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Polycarp is mad about coding, that is why he writes Sveta encoded messages. H...

AWCXV 1188

Codeforces Round #386 (Div. 2) B. Decoding

B. Decoding time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Polycarp is mad about coding, that is why he writes Sveta encoded messages. He

kuronekonano的博客 319

decoding算法总结

依存树中的解码算法: 我想把每种算法的大概流程都记录下来,以及优缺点,暂时先放在这里 1. dynamic programming 2. maximum spanning tree 3. beam search算法

Deep Learning and NLP Farm 1178

字符串函数的模拟

一些字符串函数的模拟,strlen函数的模拟,strcpy函数模拟,strcat函数模拟,strcmp函数模拟,strstr函数模拟

qq_70313784的博客 501

模拟实现字符串的基本操作

模拟实现字符串的基本操作 1.字符串比较 1.1 equals 区分大小写的比较 equalsIgnoreCase 不区分大小写的比较 String str1 = "hello world"; String str2 = "Hello World"; System.out.println(str1.equals(str2));//false System.out.println(str1.equa...

weixin_44945537的博客 440
上一篇: codeforces 746 A.Compote【水题】
下一篇: codeforces 746 C. Tram【水题】
Joefery
博客等级 码龄11年 20粉丝 128原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值