buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define INF 210000000 #define int long long int gcd(int a, int b) { int amari = a % b; int c = b; if (amari == 0) { return ...
#include <algorithm> #include <initializer_list> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; #define INF 210000000 #define int long long int gcd(int a, int b) { int amari = a % b; int c = b; i...
[["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["-", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["+", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["-", 0, 57, 64, 1, 0, 2, 63, 118, 119, 120], ["+", 0, 57, 64, 1, 0, 2, 63, 118, 119, 120], ["-", 0, 9, 0, 1, 0, 2, 63, 118, 119, 120],...
1
222
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace s...
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace s...
[["+", 0, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25]...
1
3,909
#include <bits/stdc++.h> #include <string.h> using namespace std; int main() { string s, ss = ""; int k = 0; cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] == 'B') { k--; if (k < 0) k = 0; } else ss[k++] = s[i]; } cout << ss; return 0; }
#include <algorithm> #include <bits/stdc++.h> #include <string.h> using namespace std; int main() { string s, ss = ""; int k = 0; cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] == 'B') { k--; if (k < 0) k = 0; } else ss[k++] = s[i]; } for (int i = 0; i < k; i++) ...
[["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 88], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 24], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 49, 22], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 7, ...
1
96
import java.util.*; class Main { public static void main(String[] args) { String answer = ""; Scanner scan = new Scanner(System.in); String s = scan.next(); int l = s.length(); String[] moji = new String[l - 1]; for (int i = 0; i < l; i++) { moji[i] = String.valueOf(s.charAt(i)); } ...
import java.util.*; class Main { public static void main(String[] args) { String answer = ""; Scanner scan = new Scanner(System.in); String s = scan.next(); int l = s.length(); String[] moji = new String[l]; for (int i = 0; i < l; i++) { moji[i] = String.valueOf(s.charAt(i)); } ...
[["-", 49, 200, 51, 227, 497, 505, 0, 16, 17, 33], ["-", 49, 200, 51, 227, 497, 505, 0, 16, 12, 499], ["+", 75, 57, 75, 57, 64, 196, 0, 503, 39, 78], ["+", 75, 57, 64, 196, 0, 503, 49, 200, 141, 22], ["+", 75, 57, 64, 196, 0, 503, 49, 200, 0, 32], ["+", 75, 57, 75, 57, 64, 196, 0, 503, 0, 35], ["+", 75, 57, 64, 196, 0,...
3
221
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define dbg(x) cerr << #x " = " ...
#include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; #define dbg(x) cerr << #x " = " ...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 88], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 24], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 49, 22], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 7, 10, ...
1
165
#include <iostream> #include <vector> using namespace std; int main(int argc, char const *argv[]) { vector<char> c; string s; cin >> s; for (char i : s) { if (i == '0' || i == '1') { c.push_back(i); } else if (i == 'B') { c.pop_back(); } } if (c.empty()) { cout << ""; } else...
#include <iostream> #include <vector> using namespace std; int main(int argc, char const *argv[]) { vector<char> c; string s, s1 = ""; cin >> s; for (char i : s) { if (i == '0' || i == '1') { c.push_back(i); } else if (i == 'B') { if (!c.empty()) c.pop_back(); else co...
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 5, 0, 62], ["+", 75, 76, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 15, 339, 5...
1
133
s = list(input()) ans = [] for i in s: if i == '0': ans.append('0') elif i == '1': ans.append('1') else: ans.pop() print("".join(ans))
s = list(input()) ans = [] for i in s: if i == '0': ans.append('0') elif i == '1': ans.append('1') else: if len(ans) == 0: pass else: ans.pop() print("".join(ans))
[["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 121], ["+", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 667, 60], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 102],...
5
64
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1; for (int i = 0; i < s1.size(); i++) { if (s1.at(i) == '0') s2 += '0'; if (s1.at(i) == '1') s2 += '1'; else if (s2.size() != 0) s2.erase(s2.size() - 1); } cout << s2 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2; cin >> s1; for (int i = 0; i < s1.size(); i++) { if (s1.at(i) == '0') s2 += '0'; if (s1.at(i) == '1') s2 += '1'; if (s1.at(i) == 'B') if (s2.size() != 0) s2.erase(s2.size() - 1); } cout << s2 << e...
[["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 7, 8, 9, 0, 57, 0, 121], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+",...
1
109
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <set> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { string s; cin >> s; string ans = ""; REP(i, s.size()) { if (s[i] == '0') ...
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <set> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { string s; cin >> s; string ans = ""; REP(i, s.size()) { if (s[i] == '0') ...
[["+", 0, 57, 75, 76, 0, 57, 64, 9, 0, 45], ["+", 75, 76, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24...
1
122
#include <bits/stdc++.h> using namespace std; int main(void) { string str; cin >> str; string ans = ""; for (int i = 0; i < str.size(); i++) { if (str[i] == '0') ans += '0'; if (str[i] == '1') ans += '1'; if (str[i] == 'B') { if (!str.empty()) ans.pop_back(); } } ...
#include <bits/stdc++.h> using namespace std; int main(void) { string str; cin >> str; string ans = ""; for (int i = 0; i < str.size(); i++) { if (str[i] == '0') ans += '0'; if (str[i] == '1') ans += '1'; if (str[i] == 'B') { if (ans.empty()) { continue; } else { ...
[["-", 64, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["-", 15, 339, 51, 91, 28, 2, 63, 118, 28, 22], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 28, 22], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 45], ["+", 64, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["+", 64, 9, 0, 57, 64, 9, 0, 116, 0, 35], ["+", 0, 57, 64, 9, 0, 57, 64, 9, 0, 46], ["+", ...
1
117
#include <bits/stdc++.h> using namespace std; int main(void) { string str; cin >> str; string ans = ""; for (int i = 0; i < str.size(); i++) { if (str[i] == '0') ans += '0'; if (str[i] == '1') ans += '1'; if (str[i] == 'B') { if (!str.empty()) ans.pop_back(); } } ...
#include <bits/stdc++.h> using namespace std; int main(void) { string str; cin >> str; string ans = ""; for (int i = 0; i < str.size(); i++) { if (str[i] == '0') ans += '0'; if (str[i] == '1') ans += '1'; if (str[i] == 'B' and ans != "") ans.pop_back(); } cout << ans << end...
[["-", 0, 7, 8, 9, 0, 57, 15, 339, 0, 25], ["-", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["-", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["-", 64, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["-", 15, 339, 51, 91, 28, 2, 63, 118, 28, 22], ["-", 15, 339, 51, 91, 28, 2, 63, 118, 17, 131], ["-", 1...
1
117
s=input() ans=[] for i in range(len(s)): if s[i]=='0': ans.append(0) elif s[i]=='1': ans.append(1) else: ans.pop() for j in range(len(ans)): print(ans[j],end='')
s=input() ans=[] for i in range(len(s)): if s[i]=='0': ans.append(0) elif s[i]=='1': ans.append(1) elif ans==[]: continue else: ans.pop() for j in range(len(ans)): print(ans[j],end='')
[["+", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 0, 22], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 667, 60], ["+", 0, 57, 75, 665, 15, 666, 0, 634, 0, 70], ["+", 0, 57, 75, 665, 15, 666, 0, 634, 0, 73], ["+", 0, 7, 8, 196, 0, 57, 75, 665, 0, 102], ["+", 0, 57, 75, 665, 64, 196, 0, 116, ...
5
82
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int len = s.size(); string output; int i; while (i < len) { if (s.at(i) == '0') { output.push_back('0'); } else if (s.at(i) == '1') { output.push_back('1'); } else if (s.at(i) == 'B') { if (s.size() ...
#include <bits/stdc++.h> #include <vector> using namespace std; int main() { string s; cin >> s; int len = s.size(); string output; int i = 0; while (i < len) { if (s.at(i) == '0') { output.push_back('0'); } else if (s.at(i) == '1') { output.push_back('1'); } else if (s.at(i) == 'B')...
[["+", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 79]...
1
139
s = input() r = [] for i in range(len(s)): if s[i] == "0": r.append("0") elif s[i] == "1": r.append("1") elif s[0] == "B": continue elif s[i] == "B" and len(r) != 0: del r[-1] else: continue print("".join(r))
s = input() r = [] for i in range(len(s)): if s[i] == "0": r.append("0") elif s[i] == "1": r.append("1") elif s[i] == "B" and len(r) != 0: del r[-1] else: continue print("".join(r))
[["-", 0, 57, 75, 665, 15, 666, 0, 206, 206, 612], ["-", 0, 57, 75, 665, 15, 666, 0, 206, 0, 73], ["-", 8, 196, 0, 57, 75, 665, 15, 666, 667, 60], ["-", 0, 57, 75, 665, 15, 666, 0, 557, 0, 654], ["-", 0, 57, 75, 665, 15, 666, 0, 557, 0, 6], ["-", 0, 57, 75, 665, 15, 666, 0, 557, 0, 655], ["-", 0, 7, 8, 196, 0, 57, 75, ...
5
103
#include <cstdio> #include <cstring> int main() { char key[10]; char s[10]; int x = 0; scanf("%s", key); for (int i = 0; i < strlen(key); i++) { if (key[i] == 'B') { if (x != 0) x--; } else { s[x] = key[i]; x++; } } printf("%s", s); return 0; }
#include <cstdio> #include <cstring> int main() { char key[10]; char s[10]; int x = 0; scanf("%s", key); for (int i = 0; i < strlen(key); i++) { if (key[i] == 'B') { if (x != 0) x--; } else { s[x] = key[i]; x++; } } s[x] = '\0'; printf("%s", s); return 0; }
[["+", 8, 9, 0, 1, 0, 11, 31, 69, 28, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 73], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 103, 0, 104], ["+", 8, 9, 0, 1, 0, 11, 12, 103, 0, 44], ["+", 0, 30, 0, ...
1
105
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int len = s.length(); string ans(""); for (int i = 0; i < len; ++i) { if (s[i] == '0') { ans += '0'; } else if (s[i] == '1') { ans += '1'; } else { ans.pop_back(); } } cout << ...
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int len = s.length(); string ans(""); for (int i = 0; i < len; ++i) { if (s[i] == '0') { ans += '0'; } else if (s[i] == '1') { ans += '1'; } else if (s[i] == 'B' && ans != "") { ans.pop...
[["+", 75, 76, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 16, 31, 69, 28, 22], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 22], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 57, 15, 339, 51, 16, 31, 16,...
1
110
#include <algorithm> #include <cmath> #include <iostream> #include <string> using namespace std; int main(void) { string s; cin >> s; int count = 0; while (count != s.length()) { count = 0; for (int i = 0; i < s.length(); i++) { cout << i << endl; if (s[i] == 'B') { if (i == 0) ...
#include <algorithm> #include <cmath> #include <iostream> #include <string> using namespace std; int main(void) { string s; cin >> s; int count = 0; while (count != s.length()) { count = 0; for (int i = 0; i < s.length(); i++) { if (s[i] == 'B') { if (i == 0) s.erase(s.begin());...
[["-", 8, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["-", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 7, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
168
#include <bits/stdc++.h> using namespace std; int a[10], x; char c; int main(void) { while (cin >> c) { if (c == '0') a[x++] = 0; else if (c == '1') a[x++] = 1; else { if (x) x--; } } if (x) { printf("%d", a[0]); for (int i = 1; i < x; i++) printf(" %d", a[i...
#include <bits/stdc++.h> using namespace std; int a[10], x; char c; int main(void) { while (cin >> c && c != '\0') { if (c == '0') a[x++] = 0; else if (c == '1') a[x++] = 1; else { if (x) x--; } } if (x) { for (int i = 0; i < x; i++) printf("%d", a[i]); prin...
[["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 98], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 52, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 15, 339, 51, 16, 12, 16, 12, 103, 0, 104], ["+", 15, 339, 51, 16, 12, 16, 12, 103, 0, 44], ["-", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-...
1
126
#include <bits/stdc++.h> using namespace std; typedef long long int llint; typedef long int lint; typedef vector<char> vchar; typedef vector<int> vint; typedef vector<vector<int>> vvint; typedef vector<vector<char>> vvchar; #define vsort(v) sort((v).begin(), (v).end()) #define vrsort(v) sort((v).rbegin(), (v).rend()) #...
#include <bits/stdc++.h> using namespace std; typedef long long int llint; typedef long int lint; typedef vector<char> vchar; typedef vector<int> vint; typedef vector<vector<int>> vvint; typedef vector<vector<char>> vvchar; #define vsort(v) sort((v).begin(), (v).end()) #define vrsort(v) sort((v).rbegin(), (v).rend()) #...
[["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, 25], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 25], ["+"...
1
231
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define print(s) cout << s << endl using namespace std; const int INF = 1e9; typedef long long ll; const ll LINF = 1e18; const ll MOD = 1e9 + 7; // const lint MOD = 998244353; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define print(s) cout << s << endl using namespace std; const int INF = 1e9; typedef long long ll; const ll LINF = 1e18; const ll MOD = 1e9 + 7; // const lint MOD = 998244353; ...
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, ...
1
261
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { string s; cin >> s; string ans; REP(i, s.size()) { if (s[i] == 'B' && i != 0) ans.pop_back(); else ans += s[i]; } cout << ans << endl; }
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { string s; cin >> s; string ans; REP(i, s.size()) { if (s[i] == 'B') { if (ans.size() != 0) ans.pop_back(); } else ans += s[i]; } cout << ans << endl; }
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 8, 9, 0, 9, 0, 57, 15, 339, 0, 25], ["+", 8, 9, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 3...
1
78
// ABC043_B #include <algorithm> #include <bitset> // static_cast<std::bitset<8>> #include <cctype> // std::isdigit() #include <climits> // INT_MIN #include <cmath> #include <functional> // std::greater<T>() #include <iomanip> // std::setprecision() #include <iostream> #include <iterator> #include <map> #include <...
// ABC043_B #include <algorithm> #include <bitset> // static_cast<std::bitset<8>> #include <cctype> // std::isdigit() #include <climits> // INT_MIN #include <cmath> #include <functional> // std::greater<T>() #include <iomanip> // std::setprecision() #include <iostream> #include <iterator> #include <map> #include <...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 9, 0, 45], ["-", 0, 14, 8, 9, 0, 9, 0, 5...
1
244
#include <iostream> #include <string> int main() { std::string s; std::cin >> s; // std::cout << "size of s: " << s.size() << std::endl; std::string::iterator itr = s.begin(); while (!s.empty() && s.end() != itr) { if ('B' == *itr) { if (s.begin() == itr) { s.erase(itr); } else { ...
#include <iostream> #include <string> int main() { std::string s; std::cin >> s; std::string::iterator itr = s.begin(); while (!s.empty() && s.end() != itr) { if ('B' == *itr) { if (s.begin() == itr) { s.erase(itr); } else { itr = s.erase(itr - 1, itr + 1); //--itr; ...
[["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13], ["-", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["-", 75, 76, 0, 9, 0, 1, 0, 27, 17, 68], ["-", 75, 76, 0, 9, 0, 1, 0, 27, 28, 22]]
1
118
/* include */ #include <bits/stdc++.h> /* using */ using namespace std; /* main constructor */ struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(12); } } fast; /* template */ template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; r...
/* include */ #include <bits/stdc++.h> /* using */ using namespace std; /* main constructor */ struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(12); } } fast; /* template */ template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; r...
[["-", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["-", 8, 9, 0, 43, 39, 344, 3, 347, 0, 18], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["-", 8, 9, 0, 43, 39, 344, 3, 347, 0, 47], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 100, ...
1
385
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define Abs(x) ((x) < 0 ? (x) * -1 : (x)) #define rep(x, y) for ((x) = 0; (x) < (y); (x)++) #define repin(x, y) for ((x) = 0; (x) <= (y); (x)++) #define nep(x, y) for ((x) = (y)-1; 0 <= (x); (x)--) #define nepi(x, y,...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define Abs(x) ((x) < 0 ? (x) * -1 : (x)) #define rep(x, y) for ((x) = 0; (x) < (y); (x)++) #define repin(x, y) for ((x) = 0; (x) <= (y); (x)++) #define nep(x, y) for ((x) = (y)-1; 0 <= (x); (x)--) #define nepi(x, y,...
[["+", 75, 76, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 75, 76, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0,...
1
517
s = list(input()) w =[] for i in s: if i == "B": w.pop(-1) else: w.append(i) print("".join(w))
s = list(input()) w =[] for i in s: if i == "B": if len(w) !=0: w.pop(-1) else: w.append(i) print("".join(w))
[["+", 8, 196, 0, 57, 64, 196, 0, 57, 0, 121], ["+", 64, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 667, 79], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 0, 612]...
5
49
#include <iostream> #include <string> using namespace std; int main() { string s, h; cin >> s; for (int i = 0; i < s.length(); ++i) { if (s[i] == '0') h += "0"; else if (s[i] == '1') h += "1"; else h.erase(--h.end()); } cout << h << endl; }
#include <iostream> #include <string> using namespace std; int main() { string s, h; cin >> s; for (int i = 0; i < s.length(); ++i) { if (s[i] == '0') h += "0"; else if (s[i] == '1') h += "1"; else if (s[i] == 'B' && h.length() != 0) h.erase(--h.end()); } cout << h << endl; }
[["+", 75, 76, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 16, 31, 69, 28, 22], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 70], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 22], ["+", 51, 16, 31, 16, 31, 69, 341, 342, 0, 73], ["+", 0, 57, 15, 339, 51, 16, 31, 16,...
1
97
#include <bits/stdc++.h> #define int long long using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s; cin >> s; stack<char> me; for (int i = 0; i < s.length(); i++) { if (s[i] == '0') me.push(s[i]); else if (s[i] == '1') me.push(s[i]); ...
#include <bits/stdc++.h> #define int long long using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s; cin >> s; stack<char> me; for (int i = 0; i < s.length(); i++) { if (s[i] == '0') me.push(s[i]); else if (s[i] == '1') me.push(s[i]); ...
[["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21]...
1
188
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e9, MOD = 1e9 + 7; const double EPS = 1e-9, PI = 3.141592653589793; #define Cin(x) cin >> x #define Cin2(x, y) cin >> x >> y #define Cin3(x, y, z) cin >> x >> y >> z #define Cin4(w, x, y, z) cin >> w >> x >> y >> z #define Cout(x) cout...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e9, MOD = 1e9 + 7; const double EPS = 1e-9, PI = 3.141592653589793; #define Cin(x) cin >> x #define Cin2(x, y) cin >> x >> y #define Cin3(x, y, z) cin >> x >> y >> z #define Cin4(w, x, y, z) cin >> w >> x >> y >> z #define Cout(x) cout...
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 5, 0, 62], ["-", 75, 76, 0, 57, 75, 76, 0, 57, 0, 121], ["-", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["-", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ...
1
297
#include <stdio.h> #include <string.h> int main(void) { int i, j; char s[11]; char end[1]; end[0] = '\0'; scanf("%s", s); strcat(s, end); for (i = 0; i <= 9; i++) { if (s[i] == 'B' && i != 0) { j = i; i -= 2; printf("i!=0で%s→", s); for (j; j <= 9; j++) { s[j - 1] = s[j...
#include <stdio.h> #include <string.h> int main(void) { int i, j; char s[11]; char end[1]; end[0] = '\0'; scanf("%s", s); strcat(s, end); for (i = 0; i <= 9; i++) { if (s[i] == 'B' && i != 0) { j = i; i -= 2; fprintf(stderr, "i!=0で%s→", s); for (j; j <= 9; j++) { s[j -...
[["-", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 2, 63, 22], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
0
252
A = [] for a in input(): if a == '0' or a == '1': A.append(a) else: del A[-1] print(''.join(A))
A = [] for a in input(): if a == '0' or a == '1': A.append(a) elif len(A) > 0: del A[-1] print(''.join(A))
[["-", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 7, 8, 196, 0, 57, 75, 665, 0, 683], ["+", 0, 57, 75, 665, 15, 666, 0, 652, 63, 22], ["+", 75, 665, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 75, 665, 15, 666, 0, 652, 3, 4, 0, 22], ["+", 75, 665, 15, 666, 0, 652, 3, 4, 0, 25], ["+", 8, 196, 0, 57, 75, 665, 15, 666, 667, 4...
5
48
#include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <list> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #include <cmath> using namespace std; int main() { string s; cin >> s; string out; for (auto a : s) { i...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <list> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #include <cmath> using namespace std; int main() { string s; cin >> s; string out; for (auto a : s) { i...
[["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25...
1
94
#include <iostream> #include <string> using namespace std; int main() { string s, ans; cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] == '0') ans += '0'; else if (s[i] == '1') ans += '1'; else ans.erase(ans.end() - 1); } cout << ans << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string s, ans; cin >> s; for (int i = 0; i < s.length(); i++) { if (s[i] == '0') ans += '0'; else if (s[i] == '1') ans += '1'; else if (ans.length() > 0) ans.erase(ans.end() - 1); } cout << ans << endl; r...
[["+", 75, 76, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0,...
1
101
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { string s, ans; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == 'B') { ans.pop_back(); } else { ans += s[i]; } } cout << ans << endl; }
#include <bits/stdc++.h> typedef long long ll; using namespace std; int main() { string s, ans; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == 'B') { if (ans.size() > 0) ans.pop_back(); } else { ans += s[i]; } } cout << ans << endl; }
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25]...
1
81
#include <algorithm> #include <iostream> #include <string.h> #include <vector> using namespace std; int main(void) { char a[100], b[100]; cin >> a; int len = strlen(a); int j = 0; for (int i = 0; i < len; i++) { if (a[i] == '0') { b[j] = '0'; j++; } if (a[i] == '1') { b[j] = '...
#include <algorithm> #include <iostream> #include <string.h> #include <vector> using namespace std; int main(void) { char a[100], b[100]; cin >> a; int len = strlen(a); int j = 0; for (int i = 0; i < len; i++) { if (a[i] == '0') { b[j] = '0'; j++; } if (a[i] == '1') { b[j] = '...
[["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 88], ["+", 0, 30, 0, 14, 8, 9, 0, 7, 0, 24], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 49, 22], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 7, 15,...
1
144
s = input() ans = [] for x in s: if x == "0" or x == "1": ans.append(x) else: ans.pop() print("".join(ans))
s = input() ans = [] for x in s: if x == "0" or x == "1": ans.append(x) else: if len(ans) > 0: ans.pop() print("".join(ans))
[["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 121], ["+", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 0, 612], ...
5
50
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string S; cin >> S; string ans; for (int i = 0; i < S.length(); i++) { if (S[i] == '0') { ans += '0'; } if (S[i] == '1') { ans += '1'; } if (S[i] == 'B') { ans...
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string S; cin >> S; string ans; for (int i = 0; i < S.length(); i++) { if (S[i] == '0') { ans += '0'; } if (S[i] == '1') { ans += '1'; } if (S[i] == 'B' && ans.lengt...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 28, 22], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 17, 131], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 119, 120], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12...
1
121
#include <cstdio> char c, s[15]; int main() { int t = 0; while (scanf("%c", &c) && c != '\n') { if (c == 'B' && t != 0) t--; else if (c == 'B' && t == 0) continue; else s[t++] = c; } printf("%s", s); return 0; }
#include <cstdio> char c, s[15]; int main() { int t = 0; while (scanf("%c", &c) && c != '\n') { if (c == 'B' && t != 0) s[--t] = '\0'; else if (c == 'B' && t == 0) continue; else s[t++] = c; } printf("%s", s); return 0; }
[["-", 8, 9, 0, 57, 64, 1, 0, 27, 28, 22], ["+", 0, 57, 64, 1, 0, 11, 31, 69, 28, 22], ["+", 64, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["+", 0, 11, 31, 69, 341, 342, 0, 27, 28, 22], ["+", 64, 1, 0, 11, 31, 69, 341, 342, 0, 73], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 1, 0, 11, 12, 103, 0, 104], ["+", 0...
1
92
s = input() ans=[] for i in range(len(s)): if(s[i] == '0' or s[i] == '1'): ans.append(s[i]) else: del ans[-1] for i in range(len(ans)): print(ans[i], end ="")
s = input() ans=[] for i in range(len(s)): if(s[i] == '0' or s[i] == '1'): ans.append(s[i]) else: if(len(ans) != 0): del ans[-1] for i in range(len(ans)): print(ans[i], end ="")
[["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 121], ["+", 75, 76, 8, 196, 0, 57, 15, 23, 0, 24], ["+", 0, 57, 15, 23, 0, 666, 0, 652, 63, 22], ["+", 15, 23, 0, 666, 0, 652, 3, 4, 0, 24], ["+", 15, 23, 0, 666, 0, 652, 3, 4, 0, 22], ["+", 15, 23, 0, 666, 0, 652, 3, 4, 0, 25], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 79], ["+"...
5
81
#include <algorithm> #include <iostream> #include <stack> #include <string> #include <vector> int main() { std::string str; std::cin >> str; std::stack<char> stk; for (std::string::iterator it = str.begin(); it != str.end(); it++) { if (*it == 'B') { if (!stk.empty()) stk.pop(); } else ...
#include <algorithm> #include <iostream> #include <stack> #include <string> #include <vector> int main() { std::string str; std::cin >> str; std::stack<char> stk; for (std::string::iterator it = str.begin(); it != str.end(); it++) { if (*it == 'B') { if (!stk.empty()) stk.pop(); } else ...
[["+", 8, 9, 0, 1, 0, 2, 63, 343, 141, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, ...
1
151
#include <iostream> #include <string> using namespace std; int main(void) { char c[15]; string s; cin >> s; int ind = 1; for (int i = 1; i <= s.size(); i++) { if (s[i - 1] == 'B') ind = max(ind - 1, 1); else { c[ind - 1] = s[i - 1]; ind++; } } for (int i = 1; i <= ind; i++)...
#include <iostream> #include <string> using namespace std; int main(void) { char c[15]; string s; cin >> s; int ind = 0; for (int i = 1; i <= s.size(); i++) { if (s[i - 1] == 'B') ind = max(ind - 1, 0); else { ind++; c[ind - 1] = s[i - 1]; } } for (int i = 1; i <= ind; i++)...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 64, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 64, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 75, 76, 0, 9, 0, 1, 0, 27, 28, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 27, 17, 29], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["-", 0, 57, 75, 76, 0, 9,...
1
124
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) int main() { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int j = 0; char ans[20]; REP(i, s.size()) { if (s[i] == '0') { ...
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) int main() { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; int j = 0; char ans[20]; REP(i, s.size()) { if (s[i] == '0') { ...
[["-", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 31, 22], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 75, 76, 0, 57, 15, 339, ...
1
159
def listToString(_list, split=""): maped_list = map(str, _list) # mapで要素すべてを文字列に mojiretu = split.join(maped_list) return mojiretu s = input() out = [] for i in range(len(s)): if s[i] == "0": out.append("0") elif s[i] == "1": out.append("1") else: out.pop() print(listT...
def listToString(_list, split=""): maped_list = map(str, _list) # mapで要素すべてを文字列に mojiretu = split.join(maped_list) return mojiretu s = input() out = [] for i in range(len(s)): if s[i] == "0": out.append("0") elif s[i] == "1": out.append("1") else: if len(out) > 0: ...
[["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 121], ["+", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 0, 612], ...
5
100
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; int len; char ss[101], ans[101]; int main(void) { scanf("%s", ss); for (int i = 0, slen = strlen(ss); i < slen; ++i) { if (ss[i] == 'B') { if (len > 0) --len; } else { ...
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; int len; char ss[101], ans[101]; int main(void) { scanf("%s", ss); for (int i = 0, slen = strlen(ss); i < slen; ++i) { if (ss[i] == 'B') { if (len) --len; } else { ...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 1, 0, 11, 31, 69, 28, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 70], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 73], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, ...
1
118
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; string a; for (int i = 0; i < s.size(); i++) { if (s[i] == '1') a.push_back('1'); if (s[i] == '0') a.push_back('0'); if (s[i] == 'B') a.pop_back(); } cout << a << endl; return 0; }...
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; string a; for (int i = 0; i < s.size(); i++) { if (s[i] == '1') a.push_back('1'); if (s[i] == '0') a.push_back('0'); if (s[i] == 'B') { if (a.size()) a.pop_back(); } } cou...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 28, 22], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 17, 131], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 2, 3, 4, 0, 24], ["+", ...
1
110
moji = list(input()) ans = [] for i in moji: if i == "0": ans.append("0") elif i == "1": ans.append("1") else: ans.pop() print("".join(ans))
moji = list(input()) ans = [] for i in moji: if i == "0": ans.append("0") elif i == "1": ans.append("1") else: if len(ans) != 0: ans.pop() else: continue print("".join(ans))
[["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 121], ["+", 8, 196, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 667, 79], ["+", 75, 76, 8, 196, 0, 57, 15, 666, 0, 612], ["+", 0, 57, 75, 76, 8, 196, 0, 57, 0, 102],...
5
64
import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; import java.util.InputMismatchException; /** * Built using CHelper plug-in * Actual solution is at the top */ publ...
import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; import java.util.InputMismatchException; /** * Built using CHelper plug-in * Actual solution is at the top */ publ...
[["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 79], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 12, 252], ["+", 0, 7, 8, 196, 0, 57, 15, 15, 0, 25], ["+", 8, 196, 0, 57, 64, 1, 0, 492, 500, 22], ["+", 8, 196, 0, 57, 64, 1, 0, 492, 0, 131], ["+", 8, 196, 0, 57, 64, 1, 0, 492, 141, 22], ["+", 0, 57, 64, 1, 0, 492, 3, 4, 0, 24], ["+", ...
3
670
#include <stdio.h> #include <string.h> int main() { char s[11], cpy[11]; int i = 0, j = 0, cnt; ; scanf("%s", s); for (i = 0; i < strlen(s); i++) { if (s[i] == 'B') { j--; } else { cpy[j] = s[i]; j++; } } for (i = 0; i < j; i++) { printf("%c", cpy[i]); } return 0; }
#include <stdio.h> #include <string.h> int main() { char s[11], cpy[11]; int i = 0, j = 0, cnt; ; scanf("%s", s); for (i = 0; i < strlen(s); i++) { if (s[i] == 'B') { if (i == 0 || j == 0) { continue; } j--; } else { cpy[j] = s[i]; j++; } } for (i = 0; i ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 23, 0, 24], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 17, 60], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 23, 0, 16, 17, 106], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 31, 22], ["+", 0, ...
0
122
#include <bits/stdc++.h> using namespace std; typedef long long ll; deque<char> d; int main() { cin.tie(0); ios::sync_with_stdio(false); freopen("input.txt", "rt", stdin); string str; cin >> str; for (int i = 0; i < str.size(); i++) { if (str[i] != 'B') d.push_back(str[i]); else if (str[i] ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; deque<char> d; int main() { cin.tie(0); ios::sync_with_stdio(false); // freopen("input.txt", "rt", stdin); string str; cin >> str; for (int i = 0; i < str.size(); i++) { if (str[i] != 'B') d.push_back(str[i]); else if (str[...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
155
#include <cstdio> #include <iostream> #include <stack> using namespace std; stack<char> s; string ss; int main() { cin >> ss; for (int i = 0; i < ss.length(); i++) { if (ss[i] == 'B' && !s.empty()) s.pop(); else if (ss[i] != 'B') s.push(ss[i]); } while (!s.empty()) { printf("%c", s.t...
#include <cstdio> #include <deque> #include <iostream> #include <stack> using namespace std; deque<char> s; string ss; int main() { cin >> ss; for (int i = 0; i < ss.length(); i++) { if (ss[i] == 'B' && !s.empty()) s.pop_back(); else if (ss[i] != 'B') s.push_back(ss[i]); } while (!s.empt...
[["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["-", 36, 36, 0, 30, 0, 43, 39, 344, 141, 78], ["+", 36, 36, 0, 30, 0, 43, 39, 344, 141, 78], ["-", 0, 57, 64, 1, 0, 2, 63, 118, 119, 120], ["+", 0, 57, 64, 1, 0, 2, 63, 118, 119, 120], ["-", 0, 2, 3, 4, 0, 2, 63, 118, 119, 1...
1
128
#include <algorithm> #include <iostream> #include <string> #include <vector> typedef unsigned int UINT; using namespace std; void insert(string &text, char ch) { text += ch; } void backkey(string &text) { text.pop_back(); } void edit(string &text, char ch) { if (ch == 'B') backkey(text); else insert(text,...
#include <algorithm> #include <iostream> #include <string> #include <vector> typedef unsigned int UINT; using namespace std; void insert(string &text, char ch) { text += ch; } void backkey(string &text) { if (text.length() == 0) return; text.pop_back(); } void edit(string &text, char ch) { if (ch == 'B') ...
[["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25],...
1
123
#include <bits/stdc++.h> #define MAX_N 100001 #define INF_INT 2147483647 #define INF_LL 9223372036854775807 #define REP(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long int ll; typedef pair<ll, ll> P; void init(int n); int find(int n); void unite(int x, int y); bool same(int x, int y); ll...
#include <bits/stdc++.h> #define MAX_N 100001 #define INF_INT 2147483647 #define INF_LL 9223372036854775807 #define REP(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long int ll; typedef pair<ll, ll> P; void init(int n); int find(int n); void unite(int x, int y); bool same(int x, int y); ll...
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 5, 0, 62], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0...
1
279
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; string ans; int len = s.size(); for (int i = 0; i < len; i++) { if (s[i] == '0') ans += '0'; else if (s[i] == '1') ans += '1'; else ans.pop_back(); ...
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; string ans; int len = s.size(); for (int i = 0; i < len; i++) { if (s[i] == '0') ans += '0'; else if (s[i] == '1') ans += '1'; else { if (ans.size()...
[["+", 75, 76, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24]...
1
101
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; int main() { string s; int i, n; cin >> s; n = 0; while (s[n] != '\0') { n++; } i = 0; while (s[i]...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; int main() { string s; int i, n; cin >> s; n = 0; while (s[n] != '\0') { n++; } i = 0; while (s[i]...
[["+", 8, 9, 0, 1, 0, 11, 12, 103, 0, 104], ["+", 64, 9, 0, 1, 0, 11, 12, 103, 0, 104], ["-", 0, 11, 31, 69, 341, 342, 0, 16, 17, 33], ["-", 0, 11, 31, 69, 341, 342, 0, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0...
1
201
#include <bits/stdc++.h> using namespace std; int main() { string ans, s; cin >> s; for (int i = 0; i < s.size(); i++) { if (ans.size() != 0 && s[i] == 'B') { ans.pop_back(); } else { ans += s[i]; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string ans, s; cin >> s; for (int i = 0; i < s.size(); i++) { if (ans.size() != 0 && s[i] == 'B') { ans.pop_back(); } else if (s[i] != 'B') { ans += s[i]; } } cout << ans << endl; }
[["+", 8, 9, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 75, 76, 0, 57, 15, 339, 51, 16,...
1
84
#include <iostream> using namespace std; int main(int argc, char const *argv[]) { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; string ans; for (int i = 0; i < s.length(); ++i) { if (s[i] == 'B') { ans.pop_back(); } else { ans.push_back(s[i]); } } cout << ans << ...
#include <iostream> using namespace std; int main(int argc, char const *argv[]) { cin.tie(0); ios::sync_with_stdio(false); string s; cin >> s; string ans; for (int i = 0; i < s.length(); ++i) { if (s[i] == 'B') { if (ans.length() > 0) { ans.pop_back(); } } else { ans.push_...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25]...
1
108
//おまじない #include <algorithm> #include <iostream> #include <string> #include <vector> #define INF 1e9 + 7 #define roop(i, m, n) for (int i = m; i < n; i++) #define mroop(i, m, n) for (int i = m; i < n; i--) #define NO cout << "NO" << endl; #define YES cout << "YES" << endl; #define No cout << "No" << endl; #define Yes c...
//おまじない #include <algorithm> #include <iostream> #include <string> #include <vector> #define INF 1e9 + 7 #define roop(i, m, n) for (int i = m; i < n; i++) #define mroop(i, m, n) for (int i = m; i < n; i--) #define NO cout << "NO" << endl; #define YES cout << "YES" << endl; #define No cout << "No" << endl; #define Yes c...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, ...
1
212
#include <algorithm> #include <bitset> #include <complex> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <utility> #include <vector> using namespace std; //#define int long long #define reps(i, s, n) for (int(i) = (s...
#include <algorithm> #include <bitset> #include <complex> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string.h> #include <string> #include <utility> #include <vector> using namespace std; //#define int long long #define reps(i, s, n) for (int(i) = (s...
[["+", 8, 9, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 104], ["+", 0, 57, 15, 339, 51, 16, 12, 103, 0, 125], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 2...
1
646
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string ans = ""; for (int i = 0; i < s.size(); i++) { if (s.at(i) == '0') ans += '0'; if (s.at(i) == '1') ans += '1'; else { if (s != "") ans.pop_back(); } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string ans = ""; for (int i = 0; i < s.size(); i++) { if (s.at(i) == '0') ans += '0'; if (s.at(i) == '1') ans += '1'; if (s.at(i) == 'B' && ans != "") ans.pop_back(); } cout << ans << endl; }
[["-", 0, 7, 8, 9, 0, 57, 75, 76, 0, 95], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 51, 16, 31, 16, 31, 2, 63, 118, 17, 131], ["+", 51, 16, 31, 16, 31, 2, 63, 118, 119, 120], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 24], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 22], ["+", 51, 16, 31, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 57...
1
105
#include <iostream> #include <vector> using namespace std; int main() { string str; cin >> str; vector<int> a; for (int i = 0; i < str.size(); i++) { if (str[i] == '0') { a.push_back(0); } else if (str[i] == '1') { a.push_back(1); } else { a.pop_back(); } } for (int j ...
#include <iostream> #include <vector> using namespace std; int main() { string str; cin >> str; vector<int> a; for (int i = 0; i < str.size(); i++) { if (str[i] == '0') { a.push_back(0); } else if (str[i] == '1') { a.push_back(1); } else if (a.size() > 0) { a.pop_back(); } ...
[["+", 75, 76, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0,...
1
128
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <map> #include <set> #include <string> #include <vector> #define X first #define Y second #define vsort(v) sort((v).begin(), (v).end()) #define vrev(v) reverse((v).begin(), (v).end()) // INT_MAX // INT_MIN // LLONG_MAX // LLONG_MIN ...
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <map> #include <set> #include <string> #include <vector> #define X first #define Y second #define vsort(v) sort((v).begin(), (v).end()) #define vrev(v) reverse((v).begin(), (v).end()) // INT_MAX // INT_MIN // LLONG_MAX // LLONG_MIN ...
[["+", 8, 9, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 2...
1
144
s = list(input()) a = [] for i in s: if i == "0" or i == "1" : a += [i] elif: a != [] del a[-1] print(a)
s = list(input()) a = [] for i in s: if i == "0" or i == "1" : a += [i] elif a != []: del a[-1] print("".join(a))
[["-", 8, 196, 0, 57, 75, 665, 0, 683, 0, 22], ["-", 0, 7, 8, 196, 0, 57, 75, 665, 0, 102], ["+", 0, 7, 8, 196, 0, 57, 75, 665, 0, 102], ["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 654], ["+", 3, 4, 0, 652, 63, 319, 500, 557, 0, 655], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 0, 652, 3, 4, 0, 652, 63, 319, 319,...
5
52
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; ++i) #define FOR(i, a, b...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; ++i) #define FOR(i, a, b...
[["+", 0, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, 25],...
1
164
#include <bits/stdc++.h> using namespace std; int main() { int i; string a = ""; vector<char> vi; vector<char>::iterator it; cin >> a; for (i = 0; i < sizeof(a); i++) { if (a[i] == '1') { vi.push_back(a[i]); } if (a[i] == '0') { vi.push_back(a[i]); } if (a[i] == 'B') { ...
#include <bits/stdc++.h> using namespace std; int main() { int i; string a; vector<char> vi; vi.clear(); vector<char>::iterator it; cin >> a; for (i = 0; i < a.size(); i++) { // cout << a[i] << endl; if (a[i] == '1') { vi.push_back(a[i]); } if (a[i] == '0') { vi.push_back(a[i])...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 8, 9, 0, 43, 49, 50, 51, 5, 0, 62], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 30, 0, 14, 8, 9, 0, 1...
1
165
/* |\_/| |* *| \_+_/ */ #include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { cin.tie(0); // cout と cin の同期を切る ios::sync_with_stdio(false); /* cの stdioストリーム (printfとか)と*/ stack<int> st; queue<int> que; string str; cin >> str; for (int i = 0; i <...
/* |\_/| |* *| \_+_/ */ #include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { cin.tie(0); // cout と cin の同期を切る ios::sync_with_stdio(false); /* cの stdioストリーム (printfとか)と*/ stack<int> st; stack<int> st2; string str; cin >> str; for (int i = 0; i <...
[["-", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["+", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["-", 0, 52, 15, 339, 51, 2, 63, 118, 28, 22], ["+", 0, 52, 1...
1
191
#include <bits/stdc++.h> using namespace std; int a, b, c, d; int main() { string s, t; vector<int> v; cin >> s; for (int i = 0; i < s.size(); ++i) { if (s[i] == '0') { v.push_back(0); } if (s[i] == '1') { v.push_back(1); } if (s[i] == 'B') { v.pop_back(); } } fo...
#include <bits/stdc++.h> using namespace std; int a, b, c, d; int main() { string s, t; vector<int> v; cin >> s; for (int i = 0; i < s.size(); ++i) { if (s[i] == '0') { v.push_back(0); } if (s[i] == '1') { v.push_back(1); } if (s[i] == 'B') { if (v.size() != 0) { ...
[["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25]...
1
142
#include <bits/stdc++.h> using namespace std; #define rp(i, n) for (int i = 0; i < n; i++) #define rep(i, m, n) for (int i = m; i <= n; i++) #define lrp(i, n) for (long long i = 0; i < n; i++) #define lrep(i, m, n) for (long long i = m; i <= n; i++) #define all(a) a.begin(), a.end() #define pb push_back typedef vecto...
#include <bits/stdc++.h> using namespace std; #define rp(i, n) for (int i = 0; i < n; i++) #define rep(i, m, n) for (int i = m; i <= n; i++) #define lrp(i, n) for (long long i = 0; i < n; i++) #define lrep(i, m, n) for (long long i = m; i <= n; i++) #define all(a) a.begin(), a.end() #define pb push_back typedef vecto...
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 79], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 8, 9, 0, 1, 0, ...
1
252
#include <iostream> #include <string> using namespace std; int main(int argc, char const *argv[]) { string s, ans; cin >> s; for (size_t i = 0; i < s.size(); i++) { if (s[i] == '0' || s[i] == '1') ans.push_back(s[i]); else ans.pop_back(); } cout << ans << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main(int argc, char const *argv[]) { string s, ans; cin >> s; for (size_t i = 0; i < s.size(); i++) { if (s[i] == '0' || s[i] == '1') ans.push_back(s[i]); else { if (ans.size() == 0) continue; else ans.pop_b...
[["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 0,...
1
98
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; const long long mod = 1e9 + 7; const int N = 2e5 + 7; string str, res; int g[15]; int top = -1; int main() { cin >> str; for (int i = 0; i < str.size(); i++) { top++; if (str[i] == '0') g[top] = 0; ...
#include <algorithm> #include <cstdio> #include <iostream> #include <string> using namespace std; const long long mod = 1e9 + 7; const int N = 2e5 + 7; string str, res = ""; int g[15]; int top = -1; int main() { cin >> str; for (int i = 0; i < str.size(); i++) { top++; if (str[i] == '0') g[top] = 0;...
[["+", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["+", 0, 30, 0, 43, 49, 50, 51, 5, 0, 62], ["-", 0, 11, 12, 23, 0, 16, 31, 103, 0, 104], ["-", 0, 11, 12, 23, 0, 16, 31, 103, 0, 125], ["-", 8, 1, 0, 11, 12, 23, 0, 16, 17, 72], ["-", 12, 23, 0, 16, 12, 69, 341, 342, 0, 22], ["+", 12, 23, 0, 16, 31, 69, 341, 342, 0, 22], ["+...
1
163
#include <algorithm> #include <array> #include <bitset> #include <chrono> #include <cmath> #include <complex> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <str...
#include <algorithm> #include <array> #include <bitset> #include <chrono> #include <cmath> #include <complex> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <str...
[["+", 0, 9, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["+", 75, 76, 0, 57, 15, 339, 51, 16,...
1
419
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <string> #include <vector> #define INF typedef long long ll; int main() { std::string str; std::vector<int> ans; std::cin >> str; for (int i = 0; i < str.length(); i++) { if (str[i] == '0') { ans.push_back(0); ...
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <string> #include <vector> #define INF typedef long long ll; int main() { std::string str; std::vector<int> ans; std::cin >> str; for (int i = 0; i < str.length(); i++) { if (str[i] == '0') { ans.push_back(0); ...
[["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 28, 22], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 17, 131], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 119, 120], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 12, 16, ...
1
165
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <string> #include <vector> int main() { std::string s, ans; std::cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == '0') { ans.push_back('0'); } else if (s[i] == '1') { ans.push_back('...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <string> #include <vector> int main() { std::string s, ans; std::cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == '0') { ans.push_back('0'); } else if (s[i] == '1') { ans.push_back('...
[["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 17, 131], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, 25],...
1
120
#include <bits/stdc++.h> #define FOR(i, x, y) for (int i = x; i < y; i++) using namespace std; int main() { vector<char> editor; char c; while (cin >> c) { if (c == '0') editor.push_back('0'); else if (c == '1') editor.push_back('1'); else editor.pop_back(); } for (auto x : edito...
#include <bits/stdc++.h> #define FOR(i, x, y) for (int i = x; i < y; i++) using namespace std; int main() { vector<char> editor; char c; while (cin >> c) { if (c == '0') editor.push_back('0'); else if (c == '1') editor.push_back('1'); else if (editor.size()) editor.pop_back(); } ...
[["+", 75, 76, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 28, 22], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 17, 131], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 2, 3, 4, 0, 24], ["+", 0, 57, 15, 339, 51, 2, 3, 4, 0, 25],...
1
96
#include <algorithm> #include <iostream> #include <math.h> #include <string> using namespace std; int main() { string s; cin >> s; string ans; for (int i = 0; i < s.size(); i++) { if (s[i] == '1') { ans = ans + "1"; } if (s[i] == '0') { ans = ans + "0"; } if (s[i] == 'B') { ...
#include <algorithm> #include <iostream> #include <math.h> #include <string> using namespace std; int main() { string s; cin >> s; string ans; for (int i = 0; i < s.size(); i++) { if (s[i] == '1') { ans = ans + "1"; } if (s[i] == '0') { ans = ans + "0"; } if (s[i] == 'B' && ans....
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 28, 22], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 17, 131], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 119, 120], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12...
1
118
#include <iostream> #include <string> using std::cin; using std::cout; using std::endl; using std::string; int main() { string s; string res; cin >> s; for (char x : s) { if (x == '0') res += '0'; else if (x == '1') res += '1'; else res.pop_back(); } cout << res << endl; ...
#include <iostream> #include <string> using std::cin; using std::cout; using std::endl; using std::string; int main() { string s; string res; cin >> s; for (char x : s) { if (x == '0') res += '0'; else if (x == '1') res += '1'; else if (x == 'B' && res != "") res.pop_back(); }...
[["+", 75, 76, 0, 57, 75, 76, 0, 57, 0, 121], ["+", 0, 57, 75, 76, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["+", 15, 339, 51, 16, 31, 16, 12, 103, 0, 104], ["+", 15, 339, 51, 16, 31, 16, 12, 103, 0, 125], ["+", 75, 76, 0, 57, 15, 339, 51, 16,...
1
94
#include <iostream> #include <string> using namespace std; int main() { string s, ans; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == 'B') { if (ans.empty() != 0) { ans.pop_back(); } } else { ans += s[i]; } } cout << ans << endl; return (0); }
#include <iostream> #include <string> using namespace std; int main() { string s, ans; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == 'B') { if (ans.empty() != 1) { ans.erase(ans.size() - 1); } } else { ans += s[i]; } } cout << ans << endl; return (0);...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 64, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 64, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["+", 3, 4, 0, 16, 31, 2, 63, 118, 28, 22], ["+", 3, 4, 0, 16, 31, 2, 63, 118, 17, 131], ["+", 3, 4, 0, 16, 31, 2, 63, 118, 119, 120], ["...
1
95
#include <stdio.h> #define MAX 11 int main(void) { char s[MAX], ans[MAX]; int i, j = 0, k; scanf("%s", s); for (i = 0; s[i] != '\0'; i++) { if (s[i] == 'B') { if (j > 0) j--; } else { ans[j] = s[i]; j++; } } for (k = 0; k < j; k++) printf("%c\n", ans[k]); retu...
#include <stdio.h> #define MAX 11 int main(void) { char s[MAX], ans[MAX]; int i, j = 0; scanf("%s", s); for (i = 0; s[i] != '\0'; i++) { if (s[i] == 'B') { if (j > 0) j--; } else { ans[j] = s[i]; j++; } } for (i = 0; i < j; i++) printf("%c", ans[i]); printf("\n...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 14, 8, 9, 0, 7, 10, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 26, 27, 28, 22], ["+", 0, 14, 8, 9, 0, 7, 2...
0
128
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <stac...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <stac...
[["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 9, 0, 57, 64, 1, 0, 11, 31, 22], ["+", 0, 9,...
1
330
#include <cstring> #include <iostream> using namespace std; int main() { int n, i, sign = 0, sum = 0; char p[1000]; char q[1000]; int x[1000] = {0}; cin >> p; for (i = 0; i < strlen(p); i++) { if (p[i] == 'B') { sum--; } else { q[sum++] = p[i]; } } for (i = 0; i < sum; i++) { ...
#include <cstring> #include <iostream> using namespace std; int main() { int n, i, sum = 0; char p[100]; char q[100]; int x[100] = {0}; cin >> p; for (i = 0; i < strlen(p); i++) { if (p[i] == 'B') { if (sum - 1 >= 0) { sum--; } } else { q[sum++] = p[i]; } } for (i ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 4...
1
130
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <string> typedef long long ll; using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); string res; int cnt_B = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == 'B') { cnt_B++; } ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <string> typedef long long ll; using namespace std; int main() { string s; cin >> s; reverse(s.begin(), s.end()); string res; int cnt_B = 0; for (int i = 0; i < s.size(); i++) { if (s[i] == 'B') { cnt_B++; } ...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 107], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 75, 76, 0, 57, 64, 9, 0, 1, 0, 35], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 57, 64, 9, 0...
1
129
a = [] a = gets.split("") b =[] for i in 0..a.length-1 if a[i] == "B" b.pop else b.push(a[i].to_i) end end puts b.join("")
a = [] a = gets.split("") b =[] for i in 0..a.length-1 if a[i] == "B" b.pop else b.push(a[i]) end end puts b.join
[["-", 75, 95, 0, 652, 3, 4, 0, 652, 17, 131], ["-", 75, 95, 0, 652, 3, 4, 0, 652, 735, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 62], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
4
61
#include <bits/stdc++.h> #define INF (1 << 30) #define INFLL (1ll << 60) #define EPS (1e-10) using namespace std; map<int, int> mp; typedef pair<int, int> P; typedef long long ll; static const int MAX = 100000; static const int NMAX = 50; static const int MMAX = 50; stack<char> S; int main() { string s; cin >> s; ...
#include <bits/stdc++.h> #define INF (1 << 30) #define INFLL (1ll << 60) #define EPS (1e-10) using namespace std; map<int, int> mp; typedef pair<int, int> P; typedef long long ll; static const int MAX = 100000; static const int NMAX = 50; static const int MMAX = 50; vector<char> S; int main() { string s; cin >> s;...
[["-", 36, 36, 0, 30, 0, 43, 39, 344, 141, 78], ["+", 36, 36, 0, 30, 0, 43, 39, 344, 141, 78], ["-", 0, 57, 64, 1, 0, 2, 63, 118, 119, 120], ["+", 0, 57, 64, 1, 0, 2, 63, 118, 119, 120], ["-", 8, 1, 0, 16, 12, 2, 63, 118, 17, 131], ["-", 8, 1, 0, 16, 12, 2, 63, 118, 119, 120], ["-", 8, 1, 0, 16, 12, 2, 3, 4, 0, 24], ["...
1
194
#include <algorithm> #include <iomanip> #include <iostream> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) int main() { string s; cin >> s; int b = 0; REP(i, s.length()) { if (s[i - b] == 'B') { s.erase(s.begin() + i - b); b++; i...
#include <algorithm> #include <iomanip> #include <iostream> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) int main() { string s; cin >> s; int b = 0; int len = s.length(); REP(i, len) { if (s[i - b] == 'B') { s.erase(s.begin() + i - b); ...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35...
1
124
#include <iostream> #include <string> using namespace std; int main() { string command = ""; string ans = ""; int number = 0; cin >> command; for (int i = 0; i < command.size(); i++) { if (command.substr(i, 1) == "0") ans.append("0"); if (command.substr(i, 1) == "1") ans.append("1"); i...
#include <iostream> #include <string> using namespace std; int main() { string command = ""; string ans = ""; cin >> command; for (int i = 0; i < command.size(); i++) { if (command.substr(i, 1) == "0") ans.append("0"); if (command.substr(i, 1) == "1") ans.append("1"); if (command.substr(...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 91, 17, 111], ["+", 51, 16, 1...
1
130
#include <algorithm> #include <functional> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) using namespace std; typedef long long int lli; int main() { string S; cin ...
#include <algorithm> #include <functional> #include <iostream> #include <queue> #include <set> #include <string> #include <vector> #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) using namespace std; typedef long long int lli; int main() { string S; cin ...
[["+", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 74, 0, 24], ["+", 0, 43, 49, 50, 51, 74, 39, 77, 39, 40], ["+", 8, 9, 0, 43, 49, 50, 51, 74, 0, 25], ["+", 49, 50, 51, 74, 51, 2, 63, 118, 28, 22], ["+", 49, 50, ...
1
158
#include <algorithm> #include <cstdio> #include <iostream> #include <list> #include <sstream> #include <string> //#include <stdio.h> using namespace std; int main() { string S; cin >> S; list<char> ans; for (int i = 0; i < S.size(); i++) { if (S[i] == '1' or S[i] == '0') { ans.push_back(S[i]); ...
#include <algorithm> #include <cstdio> #include <iostream> #include <list> #include <sstream> #include <string> //#include <stdio.h> using namespace std; int main() { string S; cin >> S; list<char> ans; for (int i = 0; i < S.size(); i++) { if (S[i] == '1' or S[i] == '0') { ans.push_back(S[i]); ...
[["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 28, 22], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 17, 131], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 119, 120], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 12, 16, ...
1
149
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; template <class S, class T> ostream &operator<<(ostream &out, const pair<S, T> &o) { out << "(" << o.first << "," << o.second << ")"; return out; } /* ...
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; template <class S, class T> ostream &operator<<(ostream &out, const pair<S, T> &o) { out << "(" << o.first << "," << o.second << ")"; return out; } /* ...
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 52, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 14, 8, 9, 0, 1, 0, ...
1
408
S = list(input()) L = [] for i, ch in enumerate(S): if ch != 'B': L.append(ch) elif len(L) > 0: del L[i - 1] R = ''.join(L) print(R)
S = list(input()) L = [] for i, ch in enumerate(S): if ch != 'B': L.append(ch) elif len(L) > 0: L = L[:-1] print(''.join(L))
[["-", 0, 57, 75, 665, 64, 196, 0, 688, 0, 702], ["+", 75, 665, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 75, 665, 64, 196, 0, 1, 0, 662, 0, 32], ["-", 64, 196, 0, 688, 0, 206, 206, 657, 31, 22], ["+", 0, 1, 0, 662, 12, 206, 206, 663, 0, 102], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662,...
5
63
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <set> #include <vector> using namespace std; #define loop(i, n) for (int i = 0; i < (n); i++) #define loops(i, f, n) for (int i = (f); i < (n); i++) #define INF 9999999 int main() { vector<char> ans; string s; cin >> s; loop(i, ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <set> #include <vector> using namespace std; #define loop(i, n) for (int i = 0; i < (n); i++) #define loops(i, f, n) for (int i = (f); i < (n); i++) #define INF 9999999 int main() { vector<char> ans; string s; cin >> s; loop(i, ...
[["+", 75, 76, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 2, 3, 4, 0, 24], ["+", 0, 57, 15, 339, 51, 2, 3, 4, 0, 25], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 5...
1
141
#include <iostream> #include <string> using namespace std; int main() { string s; string ans = ""; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == '1') ans += "1"; else if (s[i] == '0') ans += "0"; else if (s[i] == 'B') { if (ans != "") { string ansnew = ""; ...
#include <iostream> #include <string> using namespace std; int main() { string s; string ans = ""; cin >> s; for (int i = 0; i < s.size(); i++) { if (s[i] == '1') ans += "1"; else if (s[i] == '0') ans += "0"; else if (ans != "") { string ansnew = ""; for (int i = 0; i < ans....
[["-", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 22], ["-", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 0, 57, 15, 339, 51, 16, 12, 103, 0, 104], ["-", 0, 57, 15, 339, 51, 16, ...
1
151
#include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <str...
#include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <str...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 91, 17, 111], ["+", 51, 16, 12, 91, 28, 2, 63, 118, 28, 22], ["+", 51, 16, 12, 91, 28, 2, 63, 118, 17, 131], ["+", 51, 16, 12, 91, 28, 2, 63, 118, 119, 120], ["+", 51, 16, 12, 91, 28, 2, 3, 4, 0, 24], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 2...
1
273
#include <algorithm> #include <climits> #include <iostream> #include <string> #include <vector> using namespace std; char s[10]; int main() { cin >> s; string ans; for (int i = 0; i < 10; ++i) { if (s[i] == '0' || s[i] == '1') { ans += s[i]; } if (s[i] == 'B') { ans.pop_back(); } } ...
#include <algorithm> #include <climits> #include <iostream> #include <string> #include <vector> using namespace std; char s[10]; int main() { cin >> s; string ans; for (int i = 0; i < 10; ++i) { if (s[i] == '0' || s[i] == '1') { ans += s[i]; } if (s[i] == 'B' && ans.size() != 0) { ans.pop_...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 28, 22], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 17, 131], ["+", 51, 16, 12, 16, 31, 2, 63, 118, 119, 120], ["+", 51, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12...
1
106
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); string s, ans; cin >> s; for (auto the : s) { switch (the) { case '0': ans.append("0"); break; case '1': ans.append("1"); break; case 'B': ans.pop_back(); ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); string s, ans; cin >> s; for (auto the : s) { switch (the) { case '0': ans.append("0"); break; case '1': ans.append("1"); break; case 'B': if (ans.length()) ...
[["+", 0, 99, 8, 9, 0, 100, 0, 57, 0, 121], ["+", 8, 9, 0, 100, 0, 57, 15, 339, 0, 24], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 28, 22], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 17, 131], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 119, 120], ["+", 0, 57, 15, 339, 51, 2, 3, 4, 0, 24], ["+", 0, 57, 15, 339, 51, 2, 3, 4, 0, 25], ["...
1
103
#include <bits/stdc++.h> using namespace std; int main() { char a[105]; int b, ans = 0, flag = 0; string display; cin >> a; b = strlen(a); for (int i = 0; i < b + 1; i++) { if (a[i] == '0' && flag == 0 || a[i] == '1' && flag == 0) { flag = 1; display = a[i]; } else if (flag == 1 && a[i...
#include <bits/stdc++.h> using namespace std; int main() { char a[105]; int b, ans = 0, flag = 0; string display; cin >> a; b = strlen(a); for (int i = 0; i < b; i++) { if (a[i] == '0' && flag == 0 || a[i] == '1' && flag == 0) { flag = 1; display = a[i]; } else if (flag == 1 && a[i] !...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 2, 63, 118, 28, 22]...
1
159
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <utility> using namespace std; //#define local int main() { #ifdef local freopen("input.txt", "r", stdin); // freopen("output.txt","w",stdout); #endif char s[20], s1[20] = ""; cin >> s; i...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <utility> using namespace std; //#define local int main() { #ifdef local freopen("input.txt", "r", stdin); // freopen("output.txt","w",stdout); #endif char s[20], s1[20] = ""; cin >> s; i...
[["+", 8, 9, 0, 7, 15, 16, 31, 69, 28, 22], ["+", 0, 7, 15, 16, 31, 69, 341, 342, 0, 70], ["+", 0, 7, 15, 16, 31, 69, 341, 342, 0, 73], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 7, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64...
1
126
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string s = ""; string u; cin >> u; int len = u.length(); for (int i = 0; i < len; i++) { int l = s.length(); if (u[i] == '0') { ...
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string s = ""; string u; cin >> u; int len = u.length(); for (int i = 0; i < len; i++) { int l = s.length(); if (u[i] == '0') { ...
[["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 25], ["+", 75, 76, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 75, 7...
1
137
#include <iostream> using namespace std; int main(int argc, char const *argv[]) { string s; cin >> s; string ans = ""; for (int i = 0; i < s.length(); i++) { if (s[i] == '0') { ans += "0"; } else if (s[i] == '1') { ans += "1"; } else { ans.pop_back(); } } cout << ans << e...
#include <iostream> using namespace std; int main(int argc, char const *argv[]) { string s; cin >> s; string ans = ""; for (int i = 0; i < s.length(); i++) { if (s[i] == '0') { ans += "0"; } else if (s[i] == '1') { ans += "1"; } else { if (ans != "") { ans.pop_back(); ...
[["+", 0, 57, 75, 76, 0, 9, 0, 57, 0, 121], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 0, 57, 15, 339, 51, 16, 12, 5, 0, 62], ["+", 75, 76, 0, 9, 0, 57, 15, 339, 0, 25], ["+", 75, 76, 0, 9, 0, 57, 64, 9, 0, 45], ["+", 64, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 75, 76,...
1
111
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string ans; for (int i = 0; i < s.size(); i++) { if (s[i] == '0') ans.push_back('0'); else if (s[i] == '1') ans.push_back('1'); else if (s[i] == 'B') ans.pop_back(); } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string ans; for (int i = 0; i < s.size(); i++) { if (s[i] == '0') ans.push_back('0'); else if (s[i] == '1') ans.push_back('1'); else if (s[i] == 'B' && !ans.empty()) ans.pop_back(); } cout << ...
[["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 0, 57, 15, 339, 51, 16, 12, 91, 17, 111], ["+", 51, 16, 12, 91, 28, 2, 63, 118, 28, 22], ["+", 51, 16, 12, 91, 28, 2, 63, 118, 17, 131], ["+", 51, 16, 12, 91, 28, 2, 63, 118, 119, 120], ["+", 51, 16, 12, 91, 28, 2, 3, 4, 0, 24], ["+", 0, 57, 75, 76, 0, 57, 15, 339, ...
1
107
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <str...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <str...
[["+", 0, 338, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 57, 0, 121], ["+", 0, 57, 64, 9, 0, 57, 15, 339, 0, 24], ["+", 64, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["+", 15, 339, 51, 91, 28, 2, 63, 118, 119, 120], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, 24], ["+", 15, 339, 51, 91, 28, 2, 3, 4, 0, 25], ["+", ...
1
287
S = input() s = ['' for c in S] i = 0 for c in S: if c == '0' or c == '1': s[i] = c i += 1 else: s[i]='' if i > 0: i -= 1 print(''.join(s))
S = input() s = ['' for c in S] i = 0 for c in S: if c == '0' or c == '1': s[i] = c i += 1 else: if i > 0: i -= 1 s[i]='' print(''.join(s))
[["-", 8, 196, 0, 1, 0, 662, 31, 206, 51, 22], ["-", 8, 196, 0, 1, 0, 662, 31, 206, 0, 70], ["-", 8, 196, 0, 1, 0, 662, 31, 206, 206, 22], ["-", 8, 196, 0, 1, 0, 662, 31, 206, 0, 73], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 8, 196, 0, 1, 0, 662, 12, 557, 0, 654], ["-", 8, 196, 0, 1, 0, 662, 12, 557, 0, 655], ...
5
72