submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s977659906 | p04030 | C++ | #include <iostream>
#include<string>
using namespace std;
int main()
{
char a[100], b[100];
int n = 0;
cin >> a;
int s = strlen(a);
for (int i = 0; i < s; i++)
{
if (a[i] == 'B')
{
n--;
if (n < 0)
n = 0;
}
else b[n++] = a[i];
}
cout << b;
} | a.cc: In function 'int main()':
a.cc:9:17: error: 'strlen' was not declared in this scope
9 | int s = strlen(a);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cst... |
s724333030 | p04030 | C | #include<stdio.h>
#include <string.h>
int main(){
char str[10]; //初期の入力
char out[10]={}; //出力用
int l, p=0; //l:長さチェック p;行列の長さ把握
scanf("%s",&str);
l = strlen(str); //入力された文章の長さをチェック
for(i=0;i<l;i++){
if(str[i] == '0'){
out[i] = '0';
p++;
}else if(str[i] == '1'){
... | main.c: In function 'main':
main.c:12:7: error: 'i' undeclared (first use in this function)
12 | for(i=0;i<l;i++){
| ^
main.c:12:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:10: error: expected ';' before '}' token
18 | p++
| ... |
s197610583 | p04030 | C | #include<stdio.h>
#include <string.h>
int main(){
char str[10]; //初期の入力
cahr out[10]; //出力用
int l, p=0; //l:長さチェック p;行列の長さ把握
scanf("%s",&str);
l = strlen(str); //入力された文章の長さをチェック
for(i=0;i<l;i++){
if(str[i] == '0'){
out[i] = '0';
p++;
}else if(str[i] == '1'){
... | main.c: In function 'main':
main.c:6:3: error: unknown type name 'cahr'; did you mean 'char'?
6 | cahr out[10]; //出力用
| ^~~~
| char
main.c:12:7: error: 'i' undeclared (first use in this function)
12 | for(i=0;i<l;i++){
| ^
main.c:12:7: note: each undeclared identifier is rep... |
s357258970 | p04030 | C | #include<stdio.h>
#include <string.h>
int main(){
char str[10]; //初期の入力
cahr out[10]; //出力用
int l, p=0; //l:長さチェック p;行列の長さ把握
scanf("%s",&str);
l = strlen(str); //入力された文章の長さをチェック
for(i=0;i<l;i++){
switch(str[i]){
case 0:
out[i] = 0;
p++;
... | main.c: In function 'main':
main.c:6:3: error: unknown type name 'cahr'; did you mean 'char'?
6 | cahr out[10]; //出力用
| ^~~~
| char
main.c:12:7: error: 'i' undeclared (first use in this function)
12 | for(i=0;i<l;i++){
| ^
main.c:12:7: note: each undeclared identifier is rep... |
s671551222 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
int N = s.size();
for(int i = 0; i < N; i++){
if(s[i] == 'B'){
continue;
}
else{
if(i == N-1){
cout << s[i];
}
else if(s[i+1] == B){
continue;
}
else{
cout << s[i... | a.cc: In function 'int main()':
a.cc:16:25: error: 'B' was not declared in this scope
16 | else if(s[i+1] == B){
| ^
|
s126697086 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
for(int i = 0; i < N; i++){
if(s[i] == 'B'){
continue;
}
else{
if(i == N-1){
cout << s[i];
}
else if(s[i+1] == B){
continue;
}
else{
cout << s[i];
}
}
}... | a.cc: In function 'int main()':
a.cc:7:22: error: 'N' was not declared in this scope
7 | for(int i = 0; i < N; i++){
| ^
a.cc:15:25: error: 'B' was not declared in this scope
15 | else if(s[i+1] == B){
| ^
|
s382495233 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
vector<char> ans();
for(int i = 0; i < s.size(); i++){
if(s.at(i) == '0'){
s.push_back('0');
}
else if(s.at(i) == '1'){
s.push_back('1');
}
else{
if(!s.empty()) s.pop_back();
}
}
for(char... | a.cc: In function 'int main()':
a.cc:7:19: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
7 | vector<char> ans();
| ^~
a.cc:19:17: error: no matching function for call to 'begin(std::__cxx11::basic_string<char>*&)'
19 | for(char c : &s){
... |
s972271164 | p04030 | C++ | /*
ALLAH IS ALMIGHTY ******BISMILLAHIR RAHMANIR RAHIM.****** ALLAH IS ALMIGHTY
```````````````````````````````
AUTHOR: ANISUR RAHAMAN
BSMRSTU(SHIICT)
... | a.cc: In function 'int main()':
a.cc:112:5: error: expected ';' before '}' token
112 | }
| ^
|
s166764284 | p04030 | C | #include <stdio.h>
int main() {
char s[10], string[10], c;
int ii = 0;
scanf("%s", s);
for (int i = 0;i < sizeof(s);i++) {
if (s[i] != 'B') {
c = s[i];
string[ii] = c;//フ対策
ii++;
}
else {
if (ii > 0) ii--:
}
}
string[ii] = '\0';
printf("%s\n", string);
} | main.c: In function 'main':
main.c:13:41: error: expected ';' before ':' token
13 | if (ii > 0) ii--:
| ^
| ;
|
s749651753 | p04030 | C++ | int main() {
string s;
cin >> s;
vector<char> d;
int t =s.size();
for (int i = 0; i <t; ++i) {
if(s[i]=='B'){
if(d.size()){
d.pop_back();}
}
else{d.push_back(s[i]);}
}
for(auto x:d){cout << x;}
} | a.cc: In function 'int main()':
a.cc:2:9: error: 'string' was not declared in this scope
2 | string s;
| ^~~~~~
a.cc:3:9: error: 'cin' was not declared in this scope
3 | cin >> s;
| ^~~
a.cc:3:16: error: 's' was not declared in this scope
3 | cin >> s;
... |
s422741582 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void) {
string s;
vector<char> a;
cin >> s;
for (char c : s) {
if (c == 'B') a.pop_back();
else a.push_back(c)
}
for (char c : s) {
cout << c;
}
} | a.cc: In function 'int main()':
a.cc:10:28: error: expected ';' before '}' token
10 | else a.push_back(c)
| ^
| ;
11 | }
| ~
|
s379298013 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
stack<char>S;
int N=s.size();
for(int i=0;i<N;i++){
if(s.at(i)!='B')
S.push(s.at(i));
else {
if(!S.empty())
S.pop();
}
}int M=S.size();
string ans="";
for(int i=0;i<M;i++){
ans=S.top()+ans;
S.pop(... | a.cc:25:3: error: 'cout' does not name a type
25 | cout<<ans<<endl;
| ^~~~
a.cc:26:4: error: expected unqualified-id before 'return'
26 | return 0;
| ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
27 | }
| ^
|
s233257047 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
stack<char>S;
int N=s.size();
for(int i=0;i<N;i++){
if(s.at(i)!='B')
S.push(s.at(i));
else {
if(!S.empty())
S.pop();
}
}int M=S.size();
string ans="";
for(int i=0;i<M;i++){
ans=S.top()+ans;
S.pop(... | a.cc:21:4: error: stray '#' in program
21 | }#include<bits/stdc++.h>
| ^
a.cc: In function 'int main()':
a.cc:21:5: error: 'include' was not declared in this scope
21 | }#include<bits/stdc++.h>
| ^~~~~~~
a.cc:21:13: error: 'bits' was not declared in this scope
21 | }#include<bits/stdc+... |
s301881952 | p04030 | C | #include <stdio.h>
int main (void ){
char s [ 1111 ]、a [ 1111 ] = {};
int i 、n 、t = 0 ;
scanf ("%s" 、s );
n = strlen (s );
for (i = 0 ; i < n ; i ++){
if (s [ i ] == '1' )
a [ t ++] = '1' ;
if (s [ i ] == '0' )
a [ t ++] = '0' ;
if (s [ i ] == 'B' ){
if (t != 0 )
a [ -t ] = '\ 0' ;
... | main.c:3:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '\U0000ff08void'
3 | int main (void ){
| ^~~~~~
main.c:3:10: error: unknown type name '\U0000ff08void'; did you mean 'void'?
3 | int main (void ){
| ^~~~~~
| void
main.c:4:24: error: stray '\... |
s780055021 | p04030 | C | #include <stdio.h>
int main (void ){
char s [ 1111 ]、a [ 1111 ] = {};
int i 、n 、t = 0 ;
scanf ("%s" 、s );
n = strlen (s );
for (i = 0 ; i < n ; i ++){
if (s [ i ] == '1' )
a [ t ++] = '1' ;
if (s [ i ] == '0' )
a [ t ++] = '0' ;
if (s [ i ] == 'B' ){
if (t != 0 )
a [ -t ] = '\ 0' ;
... | main.c:3:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '\U0000ff08void'
3 | int main (void ){
| ^~~~~~
main.c:3:10: error: unknown type name '\U0000ff08void'; did you mean 'void'?
3 | int main (void ){
| ^~~~~~
| void
main.c:4:24: error: stray '\... |
s157146891 | p04030 | C++ | #include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
vector<char>v;
string s;
cin>>s;
int n=s.length();
v.push_back("");
for(int i=0;i<n;i++)
{
if(s[i+1]!='B' && s[i]!='B')
{
v.push_back(s[i]);
}
}
for(int i=0;i<v.size();i++)
... | a.cc: In function 'int main()':
a.cc:10:12: error: no matching function for call to 'push_back(const char [1])'
10 | v.push_back("");
| ~~~~~~~~~~~^~~~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-g... |
s258551678 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
deque<int> n;
for (int i=0; i<s.size(); i++) {
if (s.at(i)=='0') n.push_back(0);
else if (s.at(i)=='1') n.push_back(1);
else if(!s.empty()) n.pop_back();
}
for (int i=0; i<n.size(); i++) cout << n.at(i);
cou | a.cc: In function 'int main()':
a.cc:14:3: error: 'cou' was not declared in this scope; did you mean 'cos'?
14 | cou
| ^~~
| cos
a.cc:14:6: error: expected '}' at end of input
14 | cou
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s073892985 | p04030 | C++ | #include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define endl '\n'
using namespace std;
main()
{
fast;
string s;
int i;
stack<char> p;
for (i=0;i<s.size();i++)
{
if (s[i]=='0')
p.push(s[i]);
else if (s[i]=='1')
p.push(s[i]);
else if... | a.cc:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
8 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:25:13: error: cannot convert 'std::stack<char>::empty' from type 'bool (std::stack<char>::)() const' to type 'bool'
25 | while (!p.empty)
| ^~~~~
... |
s907741954 | p04030 | C++ | #include<iostream>
#include<stack>
#include<vector>
using namespace std;
int main(){
string str;
cin>>str;
stack<int>stc;
for(int i=0;i<str.size();i++){
if(str[i]=='0') stc.push(0);
if(str[i]=='1') stc.push(1);
if(str[i]=='B'&& stc.size()>0){
stc.pop();
}
}
vector<int>is;
while(!stc.empt... | a.cc: In function 'int main()':
a.cc:41:2: error: 'reverse' was not declared in this scope
41 | reverse(is.begin(),is.end());
| ^~~~~~~
|
s113014886 | p04030 | C++ | #include <bits/stdc++.h>
/*
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <ctype.h>
*/
using namespace std;
void init(){
cin.tie(0);
... | a.cc: In function 'int main()':
a.cc:40:14: error: no matching function for call to 'endl()'
40 | cout<<c<<endl();
| ~~~~^~
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
... |
s624509661 | p04030 | C++ | #include <bits/stdc++.h>
#include <string>
using namespace std;
void init(){
cin.tie(0);
cin.sync_with_stdio(0);
}
int main() {
init();
string s,c="";
cin>>s;
for(int i=0;i<s.size();i++){
if(s[i]=='B'){
if(c.size()==0){
continue;
}
else
c.po... | a.cc: In function 'int main()':
a.cc:23:5: error: 'else' without a previous 'if'
23 | else if(s[i]=='1')
| ^~~~
a.cc:23:15: error: 'i' was not declared in this scope
23 | else if(s[i]=='1')
| ^
a.cc: At global scope:
a.cc:33:1: error: 'cout' does not name a type
33 | cout<... |
s042891629 | p04030 | C++ | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a ... | a.cc: In function 'int main()':
a.cc:71:34: error: no matching function for call to 'std::__cxx11::basic_string<char>::erase(std::__cxx11::basic_string<char>::iterator, int)'
71 | ans.erase(ans.end(), 1);
| ~~~~~~~~~^~~~~~~~~~~~~~
In file included from /usr/inclu... |
s806149389 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s, t;
cin >> s;
for (int i=0; i<s.size(); i++) {
if (s.at(i) == '0') t.push_back('0');
else if (s.at(i) == '1') t.push_back('1');
else t.pop_back;
}
cout << t << endl;
} | a.cc: In function 'int main()':
a.cc:12:12: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
12 | else t.pop_back;
| ~~^~~~~~~~
In file inclu... |
s736710192 | p04030 | Java | import java.util.Scanner;
import java.util.Stack;
public class p9 {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
String str=s.nextLine();
Stack<Character> st=new Stack<>();
for(int i=0;i<str.length();i++){
char c=str.charAt(i);
i... | Main.java:4: error: class p9 is public, should be declared in a file named p9.java
public class p9 {
^
1 error
|
s757993089 | p04030 | Java | import java.util.Scanner;
import java.util.Stack;
public class p9 {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
String str=s.nextLine();
Stack<Character> st=new Stack<>();
for(int i=0;i<str.length();i++){
char c=str.charAt(i);
i... | Main.java:4: error: class p9 is public, should be declared in a file named p9.java
public class p9 {
^
1 error
|
s473074271 | p04030 | C | #include <stdio.h>
int main(){
char a[10];
scanf("%s",&a[10]);
for(int i=0;i<10;i++){
if(a[i]=='B'){
a[i]=a[i-1];
}
}
else{
printf("%s",a[10]);
}
printf("%s",a[10]);
return 0;
} | main.c: In function 'main':
main.c:10:3: error: 'else' without a previous 'if'
10 | else{
| ^~~~
|
s223214243 | p04030 | C | #include <stdio.h>
int main(){
char a[10];
scanf("%s",a[10]);
for(int i=0;i<10;i++){
if(a[i]=='B'){
a[i]=a[i-1];
}
}
else{
printf("%s",a[10]);
}
printf("%s",a[10]);
return 0;
} | main.c: In function 'main':
main.c:10:3: error: 'else' without a previous 'if'
10 | else{
| ^~~~
|
s313214211 | p04030 | C++ | #include<bits/stdc++.h>
#include<bitset>
using namespace std;
#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for(int i=st; i<ed; i++)
#define repn(i, st, ed) for(int i=st; i<=ed; i++)
typedef long long ll;
typedef unsigned long long int llt;
const int N = 5e5... | a.cc: In function 'int main()':
a.cc:105:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
105 | ans.pop();
| ^~~
a.cc: In function 'll fxor(ll)':
a.cc:53:1: warning: control reaches end of non-void function [-Wreturn-type]
53 | }
| ^
|
s891696867 | p04030 | C++ | #include <iostream>
#include <string>
int main()
{
std::string s;
std::cin >> s;
int i;
std::string ans = "";
for (i = 0; i < s.size(); i++) {
if (s[i] == '0' || s[i] == '1') ans += s[i];
if (s[i] == 'B') ans.pop_back;
}
std::cout << ans;
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:26: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
12 | if (s[i] == 'B') ans.pop_back;
| ... |
s530252456 | p04030 | C++ | #include <iostream>
#include <string>
int main()
{
str s;
std::cin >> s;
int i;
std::str ans = "";
for (i = 0; i < s.size(); i++) {
if (s[i] == '0' || s[i] == '1') ans += s[i];
if (s[i] == 'B') ans.pop_back;
}
std::cout << ans;
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:3: error: 'str' was not declared in this scope; did you mean 'std'?
6 | str s;
| ^~~
| std
a.cc:7:15: error: 's' was not declared in this scope
7 | std::cin >> s;
| ^
a.cc:9:8: error: 'str' is not a member of 'std'
9 | std::str... |
s639404822 | p04030 | C++ | #include <iostream>
#include <string>
int main()
{
int s;
char ch;
std::string str = "";
for (i = 0; i < s; i++) {
std::cin >> ch;
if (ch == '1' || ch == '0') str += ch;
if (ch == 'B') str.pop_back();
std::cout << str;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
9 | for (i = 0; i < s; i++) {
| ^
|
s400922152 | p04030 | C++ | #include <iostream>
#include <string>
int main()
{
int s;
char ch;
std::string str = "";
for (i = 0; i < s; i++) {
std::cin >> ch;
if (ch == '1' || ch == '0') s += ch;
if (ch == 'B') s.pop_back();
std::cout << str;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
9 | for (i = 0; i < s; i++) {
| ^
a.cc:12:22: error: request for member 'pop_back' in 's', which is of non-class type 'int'
12 | if (ch == 'B') s.pop_back();
| ^~~~~~~~
|
s946147127 | p04030 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
string s;
cin>>s;
deque<char>q;
rep(i,s.length()){
if(s[i]=='0'||s[i]=='1'){
q.push_back(s[i]);
}
else{
if(q.empty){
co... | a.cc: In function 'int main()':
a.cc:14:23: error: cannot convert 'std::deque<char>::empty' from type 'bool (std::deque<char>::)() const noexcept' to type 'bool'
14 | if(q.empty){
| ^
|
s072667583 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end() // 昇順ソート
#define rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S... | a.cc: In function 'int main()':
a.cc:38:21: error: expected primary-expression before ';' token
38 | cout << t <<;
| ^
|
s899512965 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
#define mod(cans) cans%10**9+7
#define debug(x) cout << "Debug" << x << "\n"
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define cin_pl(n,x) rep(i,n){cin>>x[i];}
#define cins(s,n) rep(i,n)cin>>... | a.cc: In function 'int main()':
a.cc:54:32: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig... |
s694008014 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
#define mod(cans) cans%10**9+7
#define debug(x) cout << "Debug" << x << "\n"
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define cin_pl(n,x) rep(i,n){cin>>x[i];}
#define cins(s,n) rep(i,n)cin>>... | a.cc: In function 'int main()':
a.cc:54:32: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig... |
s725415119 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
string ans = "";
for (int i = 0; i < size.S(); i++) {
if (S[i] == '0') {
ans += "0";
}
else if (S[i] == '1') {
ans += "1";
}
else {
if (ans.size() != 0) {
ans = ans.substr(0,ans.size() - ... | a.cc: In function 'int main()':
a.cc:7:28: error: overloaded function with no contextual type information
7 | for (int i = 0; i < size.S(); i++) {
| ^
|
s600013432 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> v;
string s, s1;
cin >> s;
for (int i=0; i<s.size(); i++) {
if (s[i] == '1' || s[i] == '0')
v.push_back(s[i]);
if (s[i] == 'B' && v.size() > 0)
v.pop_back();
}
for (int i=0; i<v.siz... | a.cc: In function 'int main()':
a.cc:10:24: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
10 | v.push_back(s[i]);
| ~~~~~~~~~~~^~~~~~
In file included from /usr/incl... |
s462429817 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> v;
string s, s1;
cin >> s;
for (int i=0; i<s.size(); i++) {
if (s[i] == '1' || s[i] == '0')
v.push_back(s[i]);
if (s[i] == 'B' && v.size() > 0)
v.pop_back();
}
for (int i=0; i<v.siz... | a.cc: In function 'int main()':
a.cc:10:24: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
10 | v.push_back(s[i]);
| ~~~~~~~~~~~^~~~~~
In file included from /usr/incl... |
s221881278 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> v;
string s;
cin >> s;
for (int i=0; i<s.size(); i++) {
if (s[i] == '1' || s[i] == '0')
v.push_back(s[i]);
if (s[i] == 'B' && v.size() > 0)
v.pop_back();
}
cout << v;
return 0;
... | a.cc: In function 'int main()':
a.cc:10:24: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
10 | v.push_back(s[i]);
| ~~~~~~~~~~~^~~~~~
In file included from /usr/incl... |
s406136525 | p04030 | C++ | #include "bits/stdc++.h"
using namespace std;
int main() {
string S;
cin >> S;
string answer = 0;
for (int i = 0; i < S.size(); i++) {
if (S[i] == 0) {
answer.push_back(0);
}
else if (S[i] == 1) {
answer.push_back(1);
}
else if (S[i] == 'B') {
answer.pop_back;
if (answer == " ") {
contin... | a.cc: In function 'int main()':
a.cc:17:32: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
17 | answer.pop_back;
| ... |
s300642348 | p04030 | C++ | #include "bits/stdc++.h"
using namespace std;
int main() {
string S;
cin >> S;
string answer = 0;
for (int i = 0; i < S.size(); i++) {
if (S[i] == 0) {
answer.push_back(0);
}
else if (S[i] == 1) {
answer.push_back(1);
}
else if (S[i] == 'B') {
answer.pop_back;
if (answer == " ") {
contin... | a.cc: In function 'int main()':
a.cc:17:32: error: invalid use of non-static member function 'void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pop_back() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
17 | answer.pop_back;
| ... |
s432426148 | p04030 | C | #include <stdio.h>
int main(){
char s[11],out[11];
int i,length,j=0;
scanf("%s",s);
length = sizeof s/sizeof s[0];
for(i=0;i<length;i++){
if(s[i]=='0')out[j]='0';
if(s[i]=='1')out[j]='1';
if(s[i]=='B')j--;
j++;
} | main.c: In function 'main':
main.c:14:1: error: expected declaration or statement at end of input
14 | }
| ^
|
s647095141 | p04030 | C | #include<stdio.h>
int main(void){
char box[10],a[10]={0};
int cnt=0;
for(int i=0;a[i]!='\0';i++){
scanf("%c",&a[i]);
if(a[i]=='0'||a[i]=='1') {
box[cnt]=a[i];
cnt++;
}else if(a[i]=='B'){
box[i-1]=' ';
}
i=0;
while(box[i]!='\0'){
printf("%c",box[i]);
}
return 0... | main.c: In function 'main':
main.c:18:1: error: expected declaration or statement at end of input
18 | }
| ^
|
s574264792 | p04030 | C | #include<stdio.h>
int main(void){
char box[10],a[10]={0};
int cnt=0;
for(int i=0;a[i]!='\0';i++){
scanf("%c",&a[i]);
if(a[i]=='0'||a[i]=='1') {
box[cnt]=a[i];
cnt++;
}else if(a[i]=='B'){
box[i-1]=' ';
}
i=0;
while(box[i]!='\0'){
printf("%s",box[i]);
}
return 0... | main.c: In function 'main':
main.c:18:1: error: expected declaration or statement at end of input
18 | }
| ^
|
s453128710 | p04030 | C | #include<stdio.h>
int main(void){
char box[10],a[10];
int cnt=0;
for(int i=0;a[i]!="\0";i++){
scanf("%c",&a[i]);
if(a[i]=='0'||a[i]=='1') {
box[cnt]=a[i];
cnt++;
}else if(key=='B'){
box[i-1]=' ';
}
i=0;
while(box[i]!="\0"){
printf("%s",box[i]);
}
return 0;
} | main.c: In function 'main':
main.c:5:19: warning: comparison between pointer and integer
5 | for(int i=0;a[i]!="\0";i++){
| ^~
main.c:10:14: error: 'key' undeclared (first use in this function)
10 | }else if(key=='B'){
| ^~~
main.c:10:14: note: each undeclared ide... |
s947456303 | p04030 | C | #include<stdio.h>
int main(void){
char box[10],a[10];
int cnt=0:
for(int i=0;a[i]!="\0";i++){
scanf("%c",&a[i]);
if(a[i]=='0'||a[i]=='1') {
box[cnt]=a[i];
cnt++;
}else if(key=='B'){
box[i-1]=' ';
}
i=0;
while(box[i]!="\0"){
printf("%s",box[i]);
}
return 0;
} | main.c: In function 'main':
main.c:4:12: error: expected ',' or ';' before ':' token
4 | int cnt=0:
| ^
main.c:5:17: error: 'i' undeclared (first use in this function)
5 | for(int i=0;a[i]!="\0";i++){
| ^
main.c:5:17: note: each undeclared identifier is reported only o... |
s848484776 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina c... | a.cc:28:18: error: macro "rep" passed 3 arguments, but takes just 2
28 | rep(i, h,size())
| ^
a.cc:4:9: note: macro "rep" defined here
4 | #define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
| ^~~
a.cc: In function 'int main()':
a.cc:26:9: error: invalid use of non-static mem... |
s778456311 | p04030 | Java | import java.util.*;
public class Main{
public static void main (String[] args){
String [] arr_1 = new String [];
for (String str : arr_1){ System.out println(str);}
List<String> list = new ArrayList<String>(Arrays.asList(arr_1));
list.remove(("0B")||("1B"));
String[] arr_2 = (String[]) list.toArra... | Main.java:4: error: array dimension missing
String [] arr_1 = new String [];
^
Main.java:5: error: ';' expected
for (String str : arr_1){ System.out println(str);}
^
Main.java:5: error: not a statement
for (String str : arr_1... |
s405688791 | p04030 | Java | import java.util.*;
public class Main{
public static void main (String[] args){
var items = [];
var result = items.filter(function( item ) ){
return !item ==( 1B)||(0B );};
console.log( result );
}
} | Main.java:4: error: illegal start of expression
var items = [];
^
Main.java:5: error: ';' expected
var result = items.filter(function( item ) ){
^
Main.java:6: error: ')' expected
return !item ==( 1B)||(0B );};
^
Main.... |
s957584741 | p04030 | Java | import java.util.*;
public class Main{
public static void main (String[] args){
var items = [];
var result = items.filter(function( item ) {
return !item ==( 1B||0B );
}
);
console.log( result );
}
} | Main.java:4: error: illegal start of expression
var items = [];
^
Main.java:5: error: ')' or ',' expected
var result = items.filter(function( item ) {
^
Main.java:6: error: ')' expected
return !item ==( 1B||0B );
^
Main.... |
s118608460 | p04030 | Java | import java.util.*;
public class Main{
public static void main (String[] args){
var items = [ System.in ];
var result = items.filter(function( item ) {
return !item ===( 1B||0B );
}
);
console.log( result );
}
} | Main.java:4: error: illegal start of expression
var items = [ System.in ];
^
Main.java:4: error: not a statement
var items = [ System.in ];
^
Main.java:4: error: ';' expected
var items = [ System.in ];
^
Main.java:5: error: ')' or ',' expect... |
s148370299 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
void PrintStack(stack<int> s)
{
// If stack is empty then return
if (s.empty())
return;
int x = s.top();
s.pop();
PrintStack(s);
cout << x;
s.push(x);
}
int main() {
string x;
stack<int> v;
cin >> x;
... | a.cc:35:16: warning: missing terminating ' character
35 | PrintStack(v)'
| ^
a.cc:35:16: error: missing terminating ' character
a.cc: In function 'int main()':
a.cc:24:25: error: request for member 'size' in 'i', which is of non-class type 'int'
24 | for (int i = 0; i < i.size(); i++) {
... |
s641294841 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
void PrintStack(stack<int> s)
{
// If stack is empty then return
if (s.empty())
return;
int x = s.top();
s.pop();
PrintStack(s);
cout << x;
s.push(x);
}
int main() {
string x;
stack<int> v;
cin >> x;
for ... | a.cc: In function 'int main()':
a.cc:24:25: error: request for member 'size' in 'i', which is of non-class type 'int'
24 | for (int i = 0; i < i.size(); i++) {
| ^~~~
a.cc:26:9: error: invalid use of non-static member function 'void std::stack<_Tp, _Sequence>::pop() [with _Tp = int; _... |
s890230489 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
string t;
cin >> s;
for(int i = 0; i < s.size(); i++){
if(s[i] == '0')
t += '0';
if(s[i] == '1')
t += '1';
if(s[i] == 'B'){
if(t.size() != 0)
t.erase(a.size() - 1);
}
}
... | a.cc: In function 'int main()':
a.cc:14:17: error: 'a' was not declared in this scope
14 | t.erase(a.size() - 1);
| ^
|
s834715747 | p04030 | C++ | #include <bits/st1dc++.h>
using namespace std;
int main(){
string s,a="";
cin>>s;
for(int i=0;i<s.size();i++){
if(s.at(i)=='B')if(a.size()!=0)a.erase(a.size()-1);
else a+=s.at(i);
}
cout<<a<<endl;
} | a.cc:1:10: fatal error: bits/st1dc++.h: No such file or directory
1 | #include <bits/st1dc++.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s700467594 | p04030 | C++ | #include <bits/st1dc++.h>
using namespace std;
int main(){
string s,a="";
cin>>s;
for(int i=0;i<s.size();i++){
if(s.at(i)=='B')if(a.size()!=0)a.push_
else a+=s.at(i);
}
} | a.cc:1:10: fatal error: bits/st1dc++.h: No such file or directory
1 | #include <bits/st1dc++.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
|
s334205109 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >>s;
stack<char> a;
for(int i=0;i<s.size();i++){
if(s.at(i)=='0'){
a.push('0');
}
else if(s.at(i)=='1'){
a.push('1');
}
else{
a.pop();
}
}
... | a.cc: In function 'int main()':
a.cc:19:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::stack<char>')
19 | cout << a;
| ~~~~ ^~ ~
| | |
| | std::stack<char>
| std::ostream {aka std::basic_ostream... |
s077381617 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >>s;
stack<char> a;
for(int i=0;i<s.size();i++){
if(s.at(i)=='0'){
a.push('0');
}
else if(s.at(i)=='1'){
a.push('1');
}
else{
a.pop();
}
}
... | a.cc: In function 'int main()':
a.cc:20:19: error: 'class std::stack<char>' has no member named 'at'
20 | cout << a.at(i);
| ^~
|
s299410784 | p04030 | C++ | #include<iostream>
using namespace std;
string s;
int c;
int main(){
getline(cin,s);
while(c<s.length()){
if(s[i]!='0'&&s[i]!='1')
if(i>0) s.erase(c-1,2),c--;
else s.erase(c,1);
else c++;}
cout<<s<<endl;} | a.cc: In function 'int main()':
a.cc:8:6: error: 'i' was not declared in this scope
8 | if(s[i]!='0'&&s[i]!='1')
| ^
|
s854899323 | p04030 | C++ | 0BB1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 0BB1
| ^~~~
|
s442319751 | p04030 | C | #include<stdio.h>
#include<string.h>
int main()
{
int i,len,l=0,l1=0,m=0;
char a[50],b[50],c[50];
scanf("%s",a);
len=strlen(a);
for(i=0;i<len;i++)
{
if(a[i]=='0')
{
b[m]='0';
m++;
l=m;
}
else if(a[i]=='1')
{
b[m]='1';
m++;
l=m;
}
else if(a[i]=='B')
{
if(l>0)
{
b[l-1]=' ';
l--;
}
}
}
for(i=0;i<m,;i++)
{
if(b[i]!=' ')
{
... | main.c: In function 'main':
main.c:32:13: error: expected expression before ';' token
32 | for(i=0;i<m,;i++)
| ^
|
s892580737 | p04030 | C | #include<stdio.h>
#include<string.h>
int main()
{
int i,len,l=0,l1=0,m=0;
char a[50],b[50],c[50];
scanf("%s",a);
len=strlen(a);
for(i=0;i<len;i++)
{
if(a[i]=='0')
{
b[m]='0';
m++
l=m;
}
else if(a[i]=='1')
{
b[m]='1';
m++;
l=m;
}
else if(a[i]=='B')
{
if(l>0)
{
b[l-1]=' ';
l--;
}
}
}
for(i=0;i<m,;i++)
{
if(b[i]!=' ')
{
c... | main.c: In function 'main':
main.c:14:4: error: expected ';' before 'l'
14 | m++
| ^
| ;
15 | l=m;
| ~
main.c:32:13: error: expected expression before ';' token
32 | for(i=0;i<m,;i++)
| ^
|
s751649244 | p04030 | C++ | s = input()
l = []
for i in range(len(s)):
if s[i] != 'B':
l.append(s[i])
else:
if len(l)==0:
pass
else:
del l[-1]
print("".join(l)) | a.cc:1:1: error: 's' does not name a type
1 | s = input()
| ^
|
s635142364 | p04030 | C | #include<stdio.h>
#include<string.h>
int main()
{
int i,len,l=0,l1=0;
char a[50],b[50],c[50];
gets(a);
len=strlen(a);
for(i=0;i<len;i++)
{
if(a[i]=='0')
{
b[i]='0'
l++;
}
else if(a[i]=='1')
{
b[i]=='1';
l++;
}
else if(a[i]=='B')
{
if(l>1)
{
b[l-1]=' ';
}
}
}
for(i=0;i<l;i++)
{
if(b[i]!=' ')
{
c[l1]=b[i];
l1++;
}
}
puts... | main.c: In function 'main':
main.c:7:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
7 | gets(a);
| ^~~~
| fgets
main.c:13:9: error: expected ';' before 'l'
13 | b[i]='0'
| ^
| ;
14 | l++;
| ~
|
s109778432 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{ string a;int k=0;vector<string>b;
b.resize(0);
cin>>a;
for(int i=0;i<a.size();i++)
{ if(a[i]=='0')
{ b.resize(b.size()+1);
b[k++]='0';
}
else if(a[i]=='1')
{ b.resize(b.size()+1);
b[k++]='1';}
else {
b.resize(b.si... | a.cc: In function 'int main()':
a.cc:21:12: error: expected '}' at end of input
21 | return 0;}
| ^
a.cc:4:1: note: to match this '{'
4 | { string a;int k=0;vector<string>b;
| ^
|
s921032297 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{ string a;int k=0;vector<string>b;
b.resize(0);
cin>>a;
for(int i=0;i<a.size();i++)
{ if(a[i]=='0')
{ b.resize(b.size()+1);
b[k++]='0';
}
else if(a[i]=='1')
{ b.resize(b.size()+1);
b[k++]='1';}
else {
b.resize(b.si... | a.cc: In function 'int main()':
a.cc:19:4: error: 'print' was not declared in this scope; did you mean 'rint'?
19 | print(b);
| ^~~~~
| rint
a.cc:20:12: error: expected '}' at end of input
20 | return 0;}
| ^
a.cc:4:1: note: to match this '{'
4 | { string a;int k=0;vecto... |
s604393967 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{ string a;int k=0;vector<string>b;
b.resize(0);
cin>>a;
for(int i=0;i<a.size();i++)
{ if(a[i]=='0')
{ b.resize(b.size()+1);
b[k++]='0';
}
else if(a[i]=='1')
{ b.resize(b.size()+1);
b[k++]='1';}
else {
b.resize(b.si... | a.cc: In function 'int main()':
a.cc:19:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
19 | cout<<b;
| ~~~~^~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
... |
s721408533 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{ stirng a;int k=0;vector<string>b;
b.resize(0);
cin>>a;
for(int i=0;i<a.size();i++)
{ if(a[i]=='0')
{ b.resize(b.size()+1);
b[k++]='0';
}
else if(a[i]=='1')
{ b.resize(b.size()+1);
b[k++]='1';}
else {
b.resize(b.si... | a.cc: In function 'int main()':
a.cc:4:3: error: 'stirng' was not declared in this scope
4 | { stirng a;int k=0;vector<string>b;
| ^~~~~~
a.cc:6:8: error: 'a' was not declared in this scope
6 | cin>>a;
| ^
a.cc:19:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka ... |
s356659368 | p04030 | C++ | string = input()
l = 0
op = []
for i in string:
if(i == '1'):
op.append('1')
l += 1
elif(i == '0'):
op.append('0')
l+= 1
elif(i == 'B'):
if(len > 0):
op.pop()
l = l - 1
for i in op:
print(i, end = '' | a.cc:18:20: error: empty character constant
18 | print(i, end = ''
| ^~
a.cc:1:1: error: 'string' does not name a type
1 | string = input()
| ^~~~~~
|
s169664033 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{ vector<stirng>a,b;int k=0;
cin>>a;
for(int i=0;i<a.size();i++)
{ if(a[i]=='0')
{ b.resize(b.size()+1);
b[k++]='0';
}
else if(a[i]=='1')
{ b.resize(b.size()+1);
b[k++]='1';}
else {
b.resize(b.size()-1);
k--... | a.cc: In function 'int main()':
a.cc:4:10: error: 'stirng' was not declared in this scope
4 | { vector<stirng>a,b;int k=0;
| ^~~~~~
a.cc:4:16: error: template argument 1 is invalid
4 | { vector<stirng>a,b;int k=0;
| ^
a.cc:4:16: error: template argument 2 is invalid
a.cc:6:19... |
s521263191 | p04030 | Java | import java.util.*;
class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String str = scan.next();
ArrayList<String> list = new ArrayList<>();
int j = 0;
for(int i = 0; i < str.length(); i++){
if(str.charAt(i) <> B){
l... | Main.java:10: error: illegal start of expression
if(str.charAt(i) <> B){
^
Main.java:13: error: illegal start of expression
}else if (j <> 0){
^
2 errors
|
s429940182 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
string t;
for(int i=0;i<s.size();i++){
switch(s.at(i)){
case '0':
t=t+'0';
break;
case '1':
t=t+'1';
break;
case 'B':
if(!t.empty(){
t.pop_back();
}
... | a.cc: In function 'int main()':
a.cc:18:22: error: expected ')' before '{' token
18 | if(!t.empty(){
| ~ ^
| )
a.cc:21:5: error: expected primary-expression before '}' token
21 | }
| ^
|
s253763225 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
string t;
for(int i=0;i<s.size();i++){
switch(s.at(i)){
case '0':
t=t+'0';
break;
case '1':
t=t+'1';
break;
case 'B':
if(!s.empty(){
t.pop_back();
}
... | a.cc: In function 'int main()':
a.cc:18:22: error: expected ')' before '{' token
18 | if(!s.empty(){
| ~ ^
| )
a.cc:21:5: error: expected primary-expression before '}' token
21 | }
| ^
|
s280567855 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
string t;
for(int i=0;i<s.size();i++){
switch(s.at(i)){
case '0':
t=t+'0';
break;
case '1':
t=t+'1';
break;
case 'B':
t.pop_back();
}
}
cout<<s | a.cc: In function 'int main()':
a.cc:22:10: error: expected ';' at end of input
22 | cout<<s
| ^
| ;
a.cc:22:10: error: expected '}' at end of input
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s435240267 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
vector<char> L(0);
if(s.at(0) == '0'){
L.push_back('0');
}
if(s.at(0) == '1'){
L.push_back('1');
}
for(int i = 1; i < s.size(); i++){
if(s.at(i) == '0'){
L.push_back('0');
}
if(s.... | a.cc: In function 'int main()':
a.cc:25:12: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = char; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
25 | if(L.size == 0){
| ~~^~~... |
s777841625 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
vector<char> L(0);
if(s.at(0) == '0'){
L.push_back('0');
}
if(s.at(0) == '1'){
L.push_back('1');
}
for(int i = 1; i < s.size(); i++){
if(s.at(i) == '0'){
L.push_back('0');
}
if(s.... | a.cc: In function 'int main()':
a.cc:25:12: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = char; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
25 | if(L.size = 0){
| ~~^~~~... |
s366714111 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
vector<char> L(0);
if(s.at(0) == '0'){
L.push_back(0) = '0';
}
if(s.at(0) == '1'){
L.push_back(0) = '1';
}
for(int i = 1; i < s.size(); i++){
if(s.at(i) == '0'){
L.push_back() = '0';
... | a.cc: In function 'int main()':
a.cc:11:18: error: invalid use of 'void'
11 | L.push_back(0) = '0';
| ~~~~~~~~~~~^~~
a.cc:14:18: error: invalid use of 'void'
14 | L.push_back(0) = '1';
| ~~~~~~~~~~~^~~
a.cc:19:18: error: no matching function for call to 'std::vector<char>::push... |
s884925222 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
char s[15];
cin >> s;
int w=0;
char t[15];
for(int i=0;i<strlen(s);i++){
if(s[i]=='0'){
t[w]='0';
w++;
}
if(s[i]=='1'){
t[w]='1';
w++;
}
if(s[i]=='B'){
t[w-1]='\0';
w--;
}
}
t[w]='\0';
co... | a.cc: In function 'int main()':
a.cc:23:21: error: expected '}' at end of input
23 | cout << t << endl;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s619373617 | p04030 | C++ | #include<bits/stdc++.h>
int main(){
char s[15];
std::cin >> s;
int w=0;
char t[15];
for(int i=0;i<strlen(s);i++){
if(s[i]=='0'){
t[w]='0';
w++;
}
if(s[i]=='1'){
t[w]='1';
w++;
}
if(s[i]=='B'){
s[w-1]='\0';
w--;
}
}
std::cout << t << endl;
} | a.cc: In function 'int main()':
a.cc:21:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
21 | std::cout << t << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sst... |
s036807582 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin>>S;
if(S.at(0)=='B'){S.at(0)='';}
for(int i=1; i<S.length();i++){
if(S.at(i)=='B'){S.at(i)='';S.at(i-1)='';}}
cout<<S<<endl;
}
| a.cc:9:28: error: empty character constant
9 | if(S.at(0)=='B'){S.at(0)='';}
| ^~
a.cc:11:30: error: empty character constant
11 | if(S.at(i)=='B'){S.at(i)='';S.at(i-1)='';}}
| ^~
a.cc:11:43: error: empty character constant
11 | if(... |
s804125794 | p04030 | C | #include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
cin >> s;
for(int i=0; i<10; i++)
{
if(s[i]==66)
{
if(i==0)
s.erase(i,i+1);
else
s.erase(i-1, i+1);
}
}
cout << s;
return 0;
}
| main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s131791990 | p04030 | C++ | #include <bits/stdc++.h>
#include <math.h>
#include <cstdlib> //絶対値 abs()
using namespace std;
int main(){
strng s;
cin >> s;
l=s.size();
stack<char> ans;
for(int i=0; i<l; i++){
if(s[i]=='B'){
ans.pop();
}
else{
ans.push(s[i]);
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'strng' was not declared in this scope
8 | strng s;
| ^~~~~
a.cc:9:16: error: 's' was not declared in this scope
9 | cin >> s;
| ^
a.cc:11:9: error: 'l' was not declared in this scope
11 | l=s.size();
... |
s540798160 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int n;
string s;
cin>>s;
for(int i=0;i<s.length();i++){
if(s[i]=='B' && s.length()>0){
s.pop();
}
}
cout<<s;
} | a.cc: In function 'int main()':
a.cc:10:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop'
10 | s.pop();
| ^~~
|
s218135470 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int n;
string s;
cin>>s;
for(itn i=0;i<s.length();i++){
if(s[i]=='B' && s.length()>0){
s.pop();
}
}
cout<<s;
} | a.cc: In function 'int main()':
a.cc:8:9: error: 'itn' was not declared in this scope; did you mean 'int'?
8 | for(itn i=0;i<s.length();i++){
| ^~~
| int
a.cc:8:17: error: 'i' was not declared in this scope
8 | for(itn i=0;i<s.length();i++){
| ^
a.cc:10:... |
s053612472 | p04030 | Java | import java.io.*;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
Stack<String> stack = new Stack<String>();
for(int i=0;i<s.length();i++){
if(s.charAt(i)=='0... | Main.java:6: error: cannot find symbol
Stack<String> stack = new Stack<String>();
^
symbol: class Stack
location: class Main
Main.java:6: error: cannot find symbol
Stack<String> stack = new Stack<String>();
^
symbol: class Stack
location: class Main
Main.java:16: er... |
s341899070 | p04030 | C++ | #include <iostream>
#include <vector>
#include <iostream>
#include <cstdio>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <algorithm>
#include <cmath>
#include <queue>
#include <deque>
#include <stack>
#define ll long long
#define pb push_back
#define vi vector<int>
#define ... | a.cc:39:35: error: empty character constant
39 | } else if (ans != '') ans.pop_back();
| ^~
a.cc: In function 'int main()':
a.cc:39:32: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
39 ... |
s005024687 | p04030 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
char[] c=sc.next().toCharArray();
String ans="";
String bef=ans;
for(int i=0;i<c.length;i++){
switch(c[i]){
case '0':
bef=ans;
ans+="0";
br... | Main.java:20: error: cannot find symbol
char[] d=ans.toCharArrray();
^
symbol: method toCharArrray()
location: variable ans of type String
1 error
|
s300317236 | p04030 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
char[] c=sc.next().toCharArray();
String ans="";
String bef=ans;
for(int i=0;i<c.length;i++){
switch(c[i]){
case '0':
bef=ans;
ans+="0";
br... | Main.java:21: error: empty character literal
d[d.length-1]='';
^
1 error
|
s153007665 | p04030 | Java |
import java.util.Scanner;
import java.util.Stack;
public class B {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
char[] s = sc.next().toCharArray();
Stack<Character> stack = new Stack<>();
for (int i = 0; i < s.length; i++) {
if (s... | Main.java:7: error: class B is public, should be declared in a file named B.java
public class B {
^
1 error
|
s643396654 | p04030 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>
using namespace std ;
int main(){
string s,t;
cin >> s;
int n = s.size();
for(int i = 0; i < n; i++){
if(s... | a.cc: In function 'int main()':
a.cc:22:23: error: 'B' was not declared in this scope
22 | }else(s[i] == B){
| ^
|
s379154252 | p04030 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main(){
string a;
cin>>a;
string out;
int top=-1;
for(int i=0;a[i]!='\0';i++){
if(a[i]=='B'){
if(top==-1)continue;
out[top--]='\0';
}
else if(a[i]=='0'){
out+='0';
top++;
}else if(a[i]=='1'){
out+='1';
top++
... | a.cc: In function 'int main()':
a.cc:19:12: error: expected ';' before '}' token
19 | top++
| ^
| ;
20 | }
| ~
|
s777776664 | p04030 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int a,b,c,d,e,f,g,h,m,n,z,x,k[1001],l,o,s,ans,sum,maxa;
char st[11];
int main ( )
{
gets(st);
l=strlen(st);o=0;
for(a=1;a<=l;a++)
{
if(st[a-1]=='0'||st[a-1]=='1')
{
o++;
k[o]=st[a-1]-48;
}
else
o=max(o-1,0);
}
for(a=1;a<=o;a++)
cout<<k[a];
... | a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(st);
| ^~~~
| getw
a.cc:9:11: error: 'strlen' was not declared in this scope
9 | l=strlen(st);o=0;
| ^~~~~~
a.cc:3:1: note: 'strlen' i... |
s200637562 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void){
vector<int> ve;
int a=0,b,c;
string s,t="";
cin >> s;
for(int i = 0;i < s.size();i++){
if(s.at(i) == 'B' && t != ""){
t.delete(a);
a--;
}else(s.at(i) == 'B'){
}else{
t.insert(a,s.at(i));
a++;
}
}
cout << t;... | a.cc: In function 'int main()':
a.cc:10:9: error: expected unqualified-id before 'delete'
10 | t.delete(a);
| ^~~~~~
a.cc:12:26: error: expected ';' before '{' token
12 | }else(s.at(i) == 'B'){
| ^
| ;
a.cc:13:6: error: 'else' w... |
s710877074 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void){
vector<int> ve;
int a=0,b,c;
string s,t;
cin >> s;
for(int i = 0;i < s.size();i++){
if(s.at(i) == 'B' && t != ""){
t.delete(a);
a--;
}else(s.at(i) == 'B'){
}else{
t.insert(a,s.at(i));
a++;
}
}
cout << t;
} | a.cc: In function 'int main()':
a.cc:10:9: error: expected unqualified-id before 'delete'
10 | t.delete(a);
| ^~~~~~
a.cc:12:26: error: expected ';' before '{' token
12 | }else(s.at(i) == 'B'){
| ^
| ;
a.cc:13:6: error: 'else' w... |
s758275110 | p04030 | C | #include<stdio.h>
int main(){
char str1[11];
char str2[11];
int i,j=0,n;
scanf("%s",str1);
for(i=0;str1[i]!='\0';i++){
if(str1[i]=='B'){
j--;
}else{
str2[j++]=str1[i];
}
}
str2[j]='\0';
for(i=0;str2[i]!='\0';i++)
prntf("%c",str2[i]);
}
| main.c: In function 'main':
main.c:17:5: error: implicit declaration of function 'prntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
17 | prntf("%c",str2[i]);
| ^~~~~
| printf
|
s345562558 | p04030 | C | #include<stdio.h>
int main(){
char str1[11];
char str2[11];
int i,j=0,n;
scanf("%s",str);
for(i=0;str1[i]!='\0';i++){
if(str1[i]=='B'){
j--;
}else{
str2[j++]=str1[i];
}
}
str2[j]='\0';
for(i=0;str2[i]!='\0';i++)
prntf("%c",str[i]);
} | main.c: In function 'main':
main.c:7:14: error: 'str' undeclared (first use in this function); did you mean 'str2'?
7 | scanf("%s",str);
| ^~~
| str2
main.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:5: error: implic... |
s333623518 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
for(int i=0;i<s.size()-1;++i){
if(s[i] != 'B' && s[i+1] !='B') cout<<s[i]
}
if(s[s.size()-1]!='B')cout<<s[s.size()-1];
return 0;
} | a.cc: In function 'int main()':
a.cc:8:51: error: expected ';' before '}' token
8 | if(s[i] != 'B' && s[i+1] !='B') cout<<s[i]
| ^
| ;
9 | }
| ~ ... |
s072789620 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
string output(10,'');
int point;
cin >> s;
point = 0;
for(int i=0;i<s.size();i++){
if(s.at(i)=='B'){
//output.at(point) = '';
point = max(point-1,0);
}else{output.at(point) = s.at(i);
point++;
}
}
... | a.cc:6:20: error: empty character constant
6 | string output(10,'');
| ^~
|
s463456756 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
string output(10);
int point;
cin >> s;
point = 0;
for(int i=0;i<s.size();i++){
if(s.at(i)=='B'){
point = max(point-1,0);
}else{
output.at(point) = s.at(i);
point++;
}
}
cout << output.substr(0,p... | a.cc: In function 'int main()':
a.cc:6:19: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int)'
6 | string output(10);
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.