【codeforces 765B】Code obfuscation
来源:互联网 发布:淘宝卖农副产品挣钱吗 编辑:程序博客网 时间:2024/05/22 04:54
【题目链接】:http://codeforces.com/contest/765/problem/B
【题意】
让你把每个变量都依次替换成a,b,c,….d这些字母;
且要按顺序先用a再用b….c.d.e….z
【题解】
模拟一下这个过程就好了;
每次看看最左边那个字母是什么(当然之前已经模拟过的除外);
看看是不是当前枚举到的字母;
不是的话就错误;
【完整代码】
#include <bits/stdc++.h>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1#define LL long long#define rep1(i,a,b) for (int i = a;i <= b;i++)#define rep2(i,a,b) for (int i = a;i >= b;i--)#define mp make_pair#define pb push_back#define fi first#define se second#define rei(x) scanf("%d",&x)#define rel(x) scanf("%I64d",&x)typedef pair<int,int> pii;typedef pair<LL,LL> pll;const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};const double pi = acos(-1.0);const int N = 500+100;char s[N];bool bo[N];int len;int main(){ //freopen("F:\\rush.txt","r",stdin); scanf("%s",s+1); len = strlen(s+1); for (char now = 'a';now <= 'z' ;now++) { int j = -1; rep1(i,1,len) if (!bo[i]) { j = i; break; } if (j==-1) return puts("YES"),0; if (s[j]!=now) return puts("NO"),0; rep1(i,1,len) if (s[i]==now) bo[i] = true; } puts("YES"); return 0;}
0 0
- 【codeforces 765B】Code obfuscation
- cf397 B. Code obfuscation
- CF 397 B. Code obfuscation
- Codeforces Round #397(Div. 1 + Div. 2 combined)B. Code obfuscation【水题】
- Code obfuscation
- PLSQL Source Code Obfuscation
- DCO ( Dynamic Code Obfuscation )理解
- Protect Python Code with Bytecode Obfuscation
- Codeforces 614B Gena's Code
- codeforces 614B Geda's Code
- CodeForces - 614B Gena's Code
- CodeForces 614B Gena's Code
- codeforces 614 B Gena's Code
- CodeForces 614B Gena's Code
- Codeforces Problem 614B Gena's Code
- codeforces 768 B Code For 1 (数学)
- Codeforces 768B Code For 1
- 【codeforces 768B】Code For 1
- js 高程学习总结 第六章(2)
- 移动HTML5前端性能优化总结
- LintCode 62-背包问题
- SQL优化经验总结34条
- QT输入输出(四)之 QProcess
- 【codeforces 765B】Code obfuscation
- 学习记录第二天
- 文件输入输出&文件模式
- filter笔记(2)
- js实现排序算法(冒泡、选择、插入、二分插入、快速、希尔)
- qt mingw版本编译报错:incorrect register `%rax' used with `l' suffix
- 分类和聚类的区别
- 121. Best Time to Buy and Sell Stock -Easy
- spring boot mybatis 简单整合使用