665C. Simple Strings
生活随笔
收集整理的這篇文章主要介紹了
665C. Simple Strings
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
C. Simple Strings:題目
思路:簡單的離譜,就相同就換就行,哪有dp的事啊 #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<ll> a((int)6e5); vector<ll> b((int)6e5); string str; int main() {cin>>str;int len = str.length();for (int i=1;i<len;i++){if (str[i]==str[i-1]){if (str[i-1]=='z') str[i] = 'a';else str[i] = str[i-1]+1;if (i<len-1&&str[i]==str[i+1]){if (str[i+1]=='z') str[i] = 'a';else str[i]++;}}}cout<<str<<endl; }總結(jié)
以上是生活随笔為你收集整理的665C. Simple Strings的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 13 代码分割之import静动态导入
- 下一篇: 黑苹果hackintosh wifi驱动