#include <iostream>
#include <string>
using namespace std;
const int MAXN = 300010;
char cat[MAXN];
string s;
int main()
{
cin >> s;
int cnt = 0;
cat[cnt] = s[0];
for(int i = 1; i < s.size(); i++){
if(cat[cnt] == s[i]){
if(!cnt) {
cat[cnt] = s[i + 1];
i++;
}
else cnt--;
}
else cat[++cnt] = s[i];
}
cat[++cnt] = '\0';
cout << cat << endl;
return 0;
}
CodeForces 81A
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
Codeforces Round #479 (Div. 3)(A-F)題解
Harris-H
2020-07-07 12:04:43
codeforece 18c
revstar_
2020-07-06 17:53:24
Codeforces Round #178 (Div. 2) B .Shaass and Bookshelf
revstar_
2020-07-06 17:53:24
codeforce492 B. Vanya and Lanterns
revstar_
2020-07-06 17:53:24
constructive algorithms:Codeforces Round #654 (Div. 2):B. Magical Calendar
仝竞奇
2020-07-06 01:51:28
Codeforces Round #262 (Div. 2) 460C. Present
王宸敏
2020-07-04 08:02:36
Codeforces 551C GukiZ hates Boxes 二分答案
九野的博客
2020-07-02 09:29:48
Codeforces 577E Ann and Half-Palindrome 字典樹
九野的博客
2020-07-02 09:29:48
Codeforces 551E GukiZ and GukiZiana 分塊
九野的博客
2020-07-02 09:29:48
Greedy Arkady CodeForces - 965C (C++/Python)
DeathYmz
2020-06-28 17:01:26
CodeForces 805B 構造
胖亚亚
2020-06-28 11:08:46
Codeforece#219(DIV2) C題
twobqn123
2020-06-26 18:05:16
1A--Theatre Square
YeKYLI
2020-06-25 00:42:30
CodeForces 295B
YeKYLI
2020-06-25 00:42:30