CodeForces 525B Pasha and String 水题
来源:互联网 发布:sql重复数据有多少条 编辑:程序博客网 时间:2024/05/18 20:09
对每一个翻转[a,|s|-a+1],在a和|s|-a+1都打标记。
所以遇到一次标记就翻转。
所以遇到奇数次标记就认为是已经翻转过,偶数次标记相当于没翻转。
#include <cstdio>#include <cstring>#define FOR(i,j,k) for(i=j;i<=k;i++)char s[200001];int c[200001];int main() {scanf("%s", s + 1);int i, n = strlen(s + 1), m, x;scanf("%d", &m);FOR(i,1,m) scanf("%d",&x),c[x]++,c[n-x+2]--;FOR(i,2,n) c[i]+=c[i-1];FOR(i,1,n) putchar((c[i]&1)?s[n-i+1]:s[i]);return 0;}
0 0
- CodeForces 525B Pasha and String 水题
- codeforces-525B Pasha and String
- codeforces 525B Pasha and String
- codeforces 525b Pasha and String
- Codeforces 525B Pasha and String 【思维】
- codeforces B. Pasha and String
- Codeforces--525B--Pasha and String(思维)
- Codeforces Round#297 B. Pasha and String
- B. Pasha and String
- B. Pasha and String
- codeforces 557B Pasha and Tea-水题
- CF 525B Pasha and String
- coderforce 525B. Pasha and String
- Codeforces Round #297 (Div. 2) B. Pasha and String
- Codeforces Round #297 (Div. 2)B Pasha and String
- Codeforces Round #297 (Div. 2) B - Pasha and String
- Codeforces #297 (Div. 2) B. Pasha and String (贪心
- Codeforces 525B. Pasha and String【线段树 区间更新 单点查询】
- 第一篇 开始
- 求二进制数中1的个数
- “string.h”头文件
- 欢迎使用CSDN-markdown编辑器
- freemarker模板使用(邮件模板)
- CodeForces 525B Pasha and String 水题
- Xcode7.1环境下上架App到AppStore 流程 (三)
- 面向对象和基于对象
- 插件待研究的问题
- Classic network server architecture model
- IDA 下载链接
- UML之类图
- 双端链表
- c++(父类与子类,继承)