submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s145600898 | p04030 | C++ | #include<iostream>
#include<cstring>
using namespace std;
char s[105],ans[105];
int main()
{
gets(s);
int len=strlen(s),tot=0;
for(int i=0;i<len;i++)
{
if(s[i]=='0') ans[++tot]='0';
if(s[i]=='B'&&tot>0) tot--;
if(s[i]=='1') ans[++tot]='1';
}
for(int i=1;i<=tot;i++)
{
cout<<ans[i];
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(s);
| ^~~~
| getw
|
s557728874 | p04030 | C++ | #include<cstdio>
#include<cmath>
#include<iostream>
typedef long long ll;
using namespace std;
char a[100000];
int main()
{
int n,i;
scanf("%s",a);
n = strlen(a);
for(i = 0; i < n ; i++)
{
if(a[i] == '0')
printf("0");
else if(a[i] == '1')
printf("1");
else
printf("\b");
}
printf("\n");
return 0;
}... | a.cc: In function 'int main()':
a.cc:12:13: error: 'strlen' was not declared in this scope
12 | n = strlen(a);
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<iostream>
+++ |+#include <cstring>
... |
s190370064 | p04030 | C++ |
knight 2018/9/29 22:18:56
#include<stdio.h>
#include<stdlib.h>
#include<cstring>
int main()
{
char s[100],ss[100];
int i=0,j=0,a=0;
int b[100];
for(i = 0 ; i < 10 ; i++)b[i] = 1;
scanf("%s",s);
a = strlen(s);
for(i=0;i<a;i++)
{
if(s[i]=='B')
{
b[i]=0;
for(j = i; j >=0 ;j--)
{
if(b[j]!=0)
{... | a.cc:2:1: error: 'knight' does not name a type
2 | knight 2018/9/29 22:18:56
| ^~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/stdlib.h:36,
from a.cc:4:
/usr/include/stdlib.h:98:8: error: 'size_t' does not name a type
98 | extern size_... |
s692460159 | p04030 | C | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);} | main.c:1:1: warning: data definition has no type or storage class
1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^
main.c:1:2: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
1 | *s,c;char*p=s+3,*q=s+3;main(){for(gets(s);p-->s;)*p-66?!c?*--q=... |
s933497060 | p04030 | C | s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);} | main.c:1:1: warning: data definition has no type or storage class
1 | s[9];char*p=s+3,*q=s+3;c;main(){for(gets(s);p---s;)*p-66?!c?*--q=*p:c--:c++;puts(q);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:13: error: initialization of 'char *' from incompatible poin... |
s124647721 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
string t;
t="";
for(int i=0;i<s.size();i++)P{
if(s[i]=='1') t+='1';
else if(s[i]=='0') t+='0';
else if(t.size()>0) t.erase(t.end()-1);
}
cout<<t;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:36: error: 'P' was not declared in this scope
8 | for(int i=0;i<s.size();i++)P{
| ^
|
s558970807 | 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++)P{
if(s[i]=='1') t+='1';
else if(s[i]=='0') t+='0';
else if(t.size()>0) t.erase(t.end()-1);
}
cout<<t;
} | a.cc: In function 'int main()':
a.cc:8:36: error: 'P' was not declared in this scope
8 | for(int i=0;i<s.size();i++)P{
| ^
|
s433307666 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
strint t="";
for(int i=0;i<s.size();i++)P{
if(s[i]=='1') t+='1';
else if(s[i]=='0') t+='0';
else if(t.size()>0) t.erase(t.end()-1);
}
cout<<t;
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'strint' was not declared in this scope; did you mean 'strcat'?
6 | strint t="";
| ^~~~~~
| strcat
a.cc:7:36: error: 'P' was not declared in this scope
7 | for(int i=0;i<s.size();i++)P{
| ... |
s027060171 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int i,pos,a;
string s;
cin>>s;
for(i=1;i<=s.size();i++)
{
if(s[1]=='B')
{
a.erase('B',2)
}
if(s[1]==0)
{
a+=0;
}
else
{
a+=1;
}
}
cout<<a;
} | a.cc: In function 'int main()':
a.cc:12:27: error: request for member 'erase' in 'a', which is of non-class type 'int'
12 | a.erase('B',2)
| ^~~~~
|
s321878738 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int i,s,pos,a;
cin>>s;
for(i=1;i<=s.size();i++)
{
if(s[1]=='B')
{
a.erase('B',2)
}
if(s[1]==0)
{
a+=0;
}
else
{
a+=1;
}
}
cout<<a;
} | a.cc: In function 'int main()':
a.cc:7:22: error: request for member 'size' in 's', which is of non-class type 'int'
7 | for(i=1;i<=s.size();i++)
| ^~~~
a.cc:9:21: error: invalid types 'int[int]' for array subscript
9 | if(s[1]=='B')
| ... |
s582158620 | p04030 | C++ | #include <iostream>
#include <algorithm>
#include <stack>
using namespace std;
int main(){
string a;
stack<string>s;
cin>>a;
for(int i=0;i<a.size();i++){
if(a[i]=='0'){s.push('0');}
else if(a[i]=='1'){s.push('1');}
else{s.pop();}
}
cout<<s<<endl;
} | a.cc: In function 'int main()':
a.cc:10:33: error: no matching function for call to 'std::stack<std::__cxx11::basic_string<char> >::push(char)'
10 | if(a[i]=='0'){s.push('0');}
| ~~~~~~^~~~~
In file included from /usr/include/c++/14/stack:63,
from a.cc:3:
... |
s693263431 | p04030 | C++ | #include <iostream>
#include <string>
int main() {
std::string s;
std::cin >> s;
std::string str = "";
for (int i = 0; i < n; ++i) {
if ( s[i] == 'B' && str.length() > 0 ) {
str.erase(str.length() - 1);
} else if ( s[i] != 'B' ) {
str += s[i];
}
}
std::cout << str << std::endl;
... | a.cc: In function 'int main()':
a.cc:9:23: error: 'n' was not declared in this scope
9 | for (int i = 0; i < n; ++i) {
| ^
|
s729106064 | p04030 | C++ |
/*
|\_/|
|* *|
\_+_/
*/
#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>st2;
string str;
cin>>str;
for(int i=0;i<str.length();i... | a.cc: In function 'int main()':
a.cc:54:15: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
54 | cout<<st2.top();
| ^~~
| pop
|
s737039914 | p04030 | C++ | #include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <string.h>
#include <cstdio>
using namespace std;
void deleteAllMark(string &s, const string &mark)
{
size_t nSize = mark.size();
while(1)
{
size_t pos = s.find(mark);
if(pos == string::npos)
{
... | a.cc: In function 'int main()':
a.cc:42:28: error: expected '}' at end of input
42 | cout << screen << endl;
| ^
a.cc:22:1: note: to match this '{'
22 | {
| ^
|
s095747979 | p04030 | C | #include<stdio.h>
#include<string.h>
int main(){
char s[11];
int flag[10]={};
scanf("%s",s);
for(int i=0;i<strlen(s);i++){
if(s[i]!='B')
flad[i]=1;
else{
for(int j=i-1;j>=0;j--){
if(flag[j]==1){
flag[j]=0;
break;
}
}
}
}
for(int i=0;i<strlen(... | main.c: In function 'main':
main.c:9:7: error: 'flad' undeclared (first use in this function); did you mean 'flag'?
9 | flad[i]=1;
| ^~~~
| flag
main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in
|
s390465866 | p04030 | C | #include<stdio.h>
#include<string.h>
int main(){
char s[11];
flag[10]={};
scanf("%s",s);
for(int i=0;i<strlen(s);i++){
if(s[i]!='B')
flad[i]=1;
else{
for(int j=i-1;j>=0;j--){
if(flag[j]==1){
flag[j]=0;
break;
}
}
}
}
for(int i=0;i<strlen(s);i... | main.c: In function 'main':
main.c:5:3: error: 'flag' undeclared (first use in this function)
5 | flag[10]={};
| ^~~~
main.c:5:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:12: error: expected expression before '{' token
5 | flag[10]={};
| ... |
s763305701 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s="",command;
cin>>command;
for(int i=0;i<command.size();i++){
switch(command[i]){
case '0':
s+='0';
break;
case '1':
s+='1';
break;
case 'B':
if(s.size()!=0){
s-=s[s.size()-1]... | a.cc: In function 'int main()':
a.cc:17:12: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'})
17 | s-=s[s.size()-1];
|
s788557786 | p04030 | C | #include <stdio.h>
#include <string.h>
int main(void){
char s[11],c[11];
int i,j=0;
scanf("%s",s);
for(i=0;i<strlen(s);i++){
if(s[i]!='B') c[j++]=s[i];
else{
if(j>0) c[--j]='\0';
else c[j]='\0';
}
c[j]='\0';
printf("%s",c);
return 0;
} | main.c: In function 'main':
main.c:16:1: error: expected declaration or statement at end of input
16 | }
| ^
|
s957716296 | p04030 | C | #include <stdio.h>
#include <string.h>
int main(void){
char s[11],c[11];
int i,j=0;
scanf("%s",s);
for(i=0;i<strlen(s);i++){
if(s[i]!='B') c[j++]=s[i];
else j>0?c[--j]='\0':c[j]='\0';
}
c[j]='\0';
printf("%s",c);
return 0;
} | main.c: In function 'main':
main.c:9:28: error: lvalue required as left operand of assignment
9 | else j>0?c[--j]='\0':c[j]='\0';
| ^
|
s452776992 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
char c;
while(cin>>c){
if(c-'B'){
s+=c;
}else if(s!=""){
s.pop_back;
}
cout<<s<<endl;
}
} | a.cc: In function 'int main()':
a.cc:11:9: 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>]'
11 | s.pop_back;
| ~~^~~~~~~~
In file included fro... |
s374089014 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i,n) for(ll i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
# define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
# ... | a.cc: In function 'int main()':
a.cc:27:5: error: 'vetor' was not declared in this scope
27 | vetor<int> ans;
| ^~~~~
a.cc:27:14: error: expected primary-expression before '>' token
27 | vetor<int> ans;
| ^
a.cc:27:16: error: 'ans' was not declared in this scope; did you mean ... |
s463605559 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
// {{{
template<typename T>
void printmatrix(vector<vector<T> > ar){
for (int i = 0; i < (int)ar.size(); i++) {
for (int ... | a.cc:132:1: error: expected unqualified-id before '/' token
132 | /
| ^
|
s683213862 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int s=S.size();
for(int i=0;i<s;i++){
| a.cc: In function 'int main()':
a.cc:8:24: error: expected '}' at end of input
8 | for(int i=0;i<s;i++){
| ~^
a.cc:8:24: error: expected '}' at end of input
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s413727981 | p04030 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
// 自分の得意な言語で
// Let's チャレンジ!!
ArrayList<String> in=new ArrayList<String>();
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
String s[]=line.split("",0);
for(int i=0;i<s.length;i++){
i... | Main.java:25: error: <identifier> expected
System.out.println();
^
1 error
|
s638083141 | p04030 | C++ | S = input()
#print(S)
ans = []
for str in S:
if str == '0':
ans.append('0')
elif str == '1':
ans.append('1')
else:
if len(ans) > 0:
ans.pop()
for a in ans:
print(a,end ="")
print()
| a.cc:3:2: error: invalid preprocessing directive #print
3 | #print(S)
| ^~~~~
a.cc:1:1: error: 'S' does not name a type
1 | S = input()
| ^
|
s664984816 | p04030 | C++ | #include<iostream>
using namespace std;
int main(){
string ans,s;
cin >> s;
for (int i = 0; i < s.size(); i++){
if(s[i] == '0')
ans += '0';
else if(s[i] == '1')
ans += '1';
else if(s[i] == 'B' && s[i] != "")
ans.pop_back();
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:13:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
13 | else if(s[i] == 'B' && s[i] != "")
|
s831502764 | p04030 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
string s;
cin >> s;
vector<char> v;
int n = s.size();
for (int i = 0;i < n;i++) {
if (s[i] == '0')v.push_back('0');
else if (s[i] == '1')v.push_back('1');
else v.pop_back();
}
int m = v.size();
for (int i = 0;i < m;i++... | a.cc:7:9: error: extended character is not valid in an identifier
7 | string s;
| ^
a.cc: In function 'int main()':
a.cc:7:9: error: 'string\U00003000s' was not declared in this scope
7 | string s;
| ^~~~~~~~~
a.cc:8:16: error: 's' was not declared in this scope
... |
s291510966 | p04030 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
string
cin >> s;
vector<char> v;
int n = s.size();
for (int i = 0;i < n;i++) {
if (s[i] == '0')v.push_back('0');
else if (s[i] == '1')v.push_back('1');
else v.pop_back();
}
int m = v.size();
for (int i = 0;i < m;i++)co... | a.cc: In function 'int main()':
a.cc:8:13: error: expected initializer before '>>' token
8 | cin >> s;
| ^~
a.cc:10:17: error: 's' was not declared in this scope
10 | int n = s.size();
| ^
|
s023315314 | p04030 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
string
cin >> s;
vector<char> v;
int n = s.size();
for (int i = 0;i < n;i++) {
if (s[i] == '0')v.push_back('0');
else if (s[i] == '1')v.push_back('1');
else v.pop_back();
}
int m = v.size();
for (int i = 0;i < m;i++)co... | a.cc: In function 'int main()':
a.cc:8:13: error: expected initializer before '>>' token
8 | cin >> s;
| ^~
a.cc:10:17: error: 's' was not declared in this scope
10 | int n = s.size();
| ^
|
s525031056 | p04030 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
string s;
cin >> s;
vector<char> v;
int n = s.size();
for (int i = 0;i < n;i++) {
if (s[i] == '0')v.push_back('0');
else if (s[i] == '1')v.push_back('1');
else v.pop_back;
}
int m = v.size();
for (int i = 0;i < m;i++)c... | a.cc: In function 'int main()':
a.cc:14:24: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = char; _Alloc = std::allocator<char>]'
14 | else v.pop_back;
| ~~^~~~~~~~
In file included from /usr/include/c++/14/vector:66,
... |
s028067671 | p04030 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
string s;
cin >> s;
vector<char> v;
int n = s.size();
for (int i = 0;i < n;i++) {
if (s[i] == '0')v.push_back('0');
else if (s[i] == '1')v.push_back('1');
else v.pop_back;
}
int m = v.size();
for (int i = ;i < m;i++)co... | a.cc: In function 'int main()':
a.cc:14:24: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = char; _Alloc = std::allocator<char>]'
14 | else v.pop_back;
| ~~^~~~~~~~
In file included from /usr/include/c++/14/vector:66,
... |
s942480232 | p04030 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s;
cin >> s;
string ans = "";
for(char c : s){
if(c == '1' || c == '0'){
ans += c;
}else{
if(s.size()) ans = ans.substr(ans.size() - 1);
}
}
cout << ans < <endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:17: error: expected primary-expression before '<' token
15 | cout << ans < <endl;
| ^
|
s006300525 | p04030 | C++ | a#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n... | a.cc:1:2: error: stray '#' in program
1 | a#include <bits/stdc++.h>
| ^
a.cc:1:1: error: 'a' does not name a type
1 | a#include <bits/stdc++.h>
| ^
a.cc:4:12: error: 'vector' does not name a type
4 | using vi = vector<int>;
| ^~~~~~
a.cc:5:13: error: 'vector' does not name a ty... |
s206771885 | p04030 | C++ | av | a.cc:1:1: error: 'av' does not name a type
1 | av
| ^~
|
s840065599 | p04030 | C | #include<stdio.h>
#include<string.h>
int main(void){
int i,p;
char sd[10] = "";
char f[20] = "";
char e[20];
scanf("%s",sd);
p = strlen(sd);
for (i = 0;i < p; i++) {
if (sd[i] == '0') {
strcat_s(f, "0");
}
if (sd[i] == '1') {
strcat_s(f, "1");
}
if (sd[i] == '2') {
strncpy_s(e, f, (int)(str... | main.c: In function 'main':
main.c:12:25: error: implicit declaration of function 'strcat_s'; did you mean 'strcat'? [-Wimplicit-function-declaration]
12 | strcat_s(f, "0");
| ^~~~~~~~
| strcat
main.c:18:21: error: implicit declarati... |
s723544904 | p04030 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main(void)
{
int i;
char S[11];
scanf("%s",S);
for (i = 0; S[i] != '\0'; i++)
{
if (S[i] == 'B')
{
printf("\b");
if (S[i + 1] == '\0')
printf(" ");
continue;
}
printf("%c",S[i]);
}
return 0;
| a.cc: In function 'int main()':
a.cc:26:18: error: expected '}' at end of input
26 | return 0;
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s993587481 | p04030 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define all(a) a.begin(),a.end()
int main(void){
string s;
cin>>s;
reverse(all(s));
int n = s.size();
int del = 0;
rep(i,n){
if(s[i]=='B'){
del++;
}else if(del>0){
s[... | a.cc: In function 'int main()':
a.cc:17:13: error: 'de' was not declared in this scope; did you mean 'del'?
17 | de--;
| ^~
| del
|
s226483190 | p04030 | C++ | #include<stdio.h>
#include <string.h>
int main(){
char input[10], output[10];
scanf("%s", input);
int index = 0;
for(int i = 0; i <= strlen(input); i++){
if(strcmp(input[i], "0") == 0){
output[index] = "0";
}else if(strcmp(input[i], "1") == 0){
output[index] = "1";
}else if(st... | a.cc: In function 'int main()':
a.cc:12:22: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
12 | if(strcmp(input[i], "0") == 0){
| ~~~~~~~^
| |
| char
In file included from a.cc:2:
/usr/include/string.h:156:32: note: ... |
s408701921 | p04030 | C++ | #include<stdio.h>
#include <string.h>
int main(){
char input[10], output[10];
scanf("%s", input);
int index = 0;
for(int i = 0; i <= strlen(input); i++){
if(input[i] == "0"){
output[index] = "0";
}else if(input[i] == "1"){
output[index] = "0";
}else if(input[i] == "B"){
i... | a.cc: In function 'int main()':
a.cc:12:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(input[i] == "0"){
| ~~~~~~~~~^~~~~~
a.cc:13:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
13 | output[index] = "0";
| ... |
s434910780 | p04030 | C++ | #include<bits/stdc++.h>
using namespace std;
char a[1005];
char b[1005];
int p;
int main(){
gets(a);
for(int i=0;i<strlen(a);i++){
if(a[i]=='B'){
if(p>=1) p--;
}
else b[++p]=a[i];
}
for(int i=1;i<=p;i++) cout<<b[i];
cout<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(a);
| ^~~~
| getw
|
s000448256 | p04030 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s="";
string ans="";
cin>>s;
for(int i=0;i<10;i++){
char temp=s[i];
if(temp=='0')ans.push_back('0');
if(temp=='1')ans.push_back('1');
if(temp=='B'&&!ans.empty())ans.pop_back();
if(temp=='')break;
}
cout<<ans<<end... | a.cc:13:14: error: empty character constant
13 | if(temp=='')break;
| ^~
|
s292607445 | p04030 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s="";
string ans="";
cin>>s;
for(int i=0;i<10;i++){
char temp=s[i];
if(temp=='0')ans.push_back('0');
if(temp=='1')ans.push_back('1');
if(temp=='B'&&!ans.empty())ans.pop_back();
if(temp==null)break;
}
cout<<ans<<e... | a.cc: In function 'int main()':
a.cc:13:14: error: 'null' was not declared in this scope
13 | if(temp==null)break;
| ^~~~
|
s502464194 | p04030 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s="";
string ans="";
cin>>s;
for(int i=0;i<10;i++){
if(s[i]=="0")ans.push_back('0');
if(s[i]=="1")ans.push_back('1');
if(s[i]=="B"&&!ans.empty())ans.pop_back();
if(s[i]==null)break;
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(s[i]=="0")ans.push_back('0');
a.cc:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if(s[i]=="1")ans.push_back('1');
a.cc:11:12: error: IS... |
s163215743 | p04030 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s="";
string ans="";
cin>>s;
for(int i=0;i<10;i++){
if(s[i]=="0")ans.append("0");
if(s[i]=="1")ans.append("1");
if(s[i]=="B"&&!ans.empty())ans.pop_back();
if(s[i]==eof)break;
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
9 | if(s[i]=="0")ans.append("0");
a.cc:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if(s[i]=="1")ans.append("1");
a.cc:11:12: error: ISO C++ ... |
s532314402 | p04030 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s="";
string ans="";
cin>>s;
for(int i=0;i<10;i++){
if(s[i]=='0')ans.append('0');
if(s[i]=='1')ans.append('1');
if(s[i]=='B'&&!ans.empty())ans.pop_back();
if(s[i]==eof)break;
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:9:28: error: no matching function for call to 'std::__cxx11::basic_string<char>::append(char)'
9 | if(s[i]=='0')ans.append('0');
| ~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/local... |
s055736257 | p04030 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>
#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>>s;
int l=(int)S.... | a.cc: In function 'int main()':
a.cc:17:20: error: 'S' was not declared in this scope
17 | int l=(int)S.length();
| ^
a.cc:20:24: error: expected initializer before '==' token
20 | int pat==(int)T.length();
| ^~
a.cc:23:31: error: 'pat'... |
s912612615 | p04030 | C++ | #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(i,1)=="B" && !ans.empty())ans.pop_back()... | a.cc: In function 'int main()':
a.cc:9:43: error: no matching function for call to 'std::__cxx11::basic_string<char>::append(char)'
9 | if(command.substr(i,1)=="0")ans.append('0');
| ~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/string:54,
from ... |
s211924024 | p04030 | C++ | #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('0');
if(command.substr(i,1)=='B'&&!ans.empty())ans.pop_back();
... | a.cc: In function 'int main()':
a.cc:9:27: error: no match for 'operator==' (operand types are 'std::__cxx11::basic_string<char>' and 'char')
9 | if(command.substr(i,1)=='0')ans.append('0');
| ~~~~~~~~~~~~~~~~~~~^~~~~
| | |
| | char
... |
s513005450 | p04030 | C++ | #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('0');
if(command.substr(i,1)=='B')ans.pop_back();
}
cout<<an... | a.cc: In function 'int main()':
a.cc:9:27: error: no match for 'operator==' (operand types are 'std::__cxx11::basic_string<char>' and 'char')
9 | if(command.substr(i,1)=='0')ans.append('0');
| ~~~~~~~~~~~~~~~~~~~^~~~~
| | |
| | char
... |
s352942037 | p04030 | C++ | #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[i]=="0")ans.append("0");
if(command[i]=="1")ans.append("1");
if(command[i]=="B")ans.pop_back();
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:10:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if(command[i]=="0")ans.append("0");
a.cc:11:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if(command[i]=="1")ans.append("1");
a.cc:12:18: er... |
s098346170 | p04030 | C++ | #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[i].strcomp("0"))ans.append("0");
if(command[i].strcomp("1"))ans.append("1");
if(command[i].strcomp("B"))ans.pop_back();
... | a.cc: In function 'int main()':
a.cc:10:19: error: request for member 'strcomp' in 'command.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
10 | if(command[... |
s799466065 | p04030 | C++ | #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++)
switch(command[i]){
case("0"):ans.append("0");break;
case("1"):ans.append("1");break;
case("B"):ans.pop_back();
}... | a.cc: In function 'int main()':
a.cc:11:14: error: conversion from 'const char*' to 'int' in a converted constant expression
11 | case("0"):ans.append("0");break;
| ~^~~~
a.cc:11:14: error: could not convert '("0")' from 'const char [2]' to 'int'
11 | case("0"):ans.append("0");br... |
s702069917 | p04030 | C++ | #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++)
switch(s[i]){
case("0"):ans.append("0");
case("1"):ans.append("1");
case("B"):ans.pop_back();
}
cout<<ans<<endl... | a.cc: In function 'int main()':
a.cc:10:12: error: 's' was not declared in this scope
10 | switch(s[i]){
| ^
|
s631896185 | p04030 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
while(str.contains("B")){
int idx = str.indexOf("B");
s = (idx > 0 ? s.substring(0,idx-1) : "") + s.substring(idx+1);
}
System.out.println(s);
}}
| Main.java:6: error: cannot find symbol
while(str.contains("B")){
^
symbol: variable str
location: class Main
Main.java:7: error: cannot find symbol
int idx = str.indexOf("B");
^
symbol: variable str
location: class Main
2 errors
|
s440913177 | p04030 | C++ |
#include <string>
#include<iostream>
#include <algorithm>
#include<sstream>
#include<list>
#include <cstdio>
//#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]);
}
else if... | a.cc: In function 'int main()':
a.cc:33:25: error: cannot convert 'std::__cxx11::list<char>::iterator' to 'char' in initialization
33 | for(char itr = ans.begin(); itr != ans.end(); ++itr) {
| ~~~~~~~~~^~
| |
| std::__cxx11::list<char>:... |
s594566265 | p04030 | C++ | #include <iostream>
using namespace std;
int main(){
string S, A;
for(int i=0; i<10; i++){
char x;
cin >> x;
if(x=='0'){
A += "0";
} else if(x=='1'){
A += "1";
} else if(x=='B'){
if(A.size()>0){
A.size()--;
}
}
}
cout << A << endl;
}
| a.cc: In function 'int main()':
a.cc:15:39: error: lvalue required as decrement operand
15 | A.size()--;
| ~~~~~~^~
|
s441781090 | p04030 | C++ | #include <iostream>
using namespace std;
int main(){
string S, A;
for(int i=0; i<10; i++){
char x;
cin >> x;
if(x=='0'){
A += "0";
} else if(x=='1'){
A += "1";
} else if(x=='B'){
A -= ""
}
}
cout << A << endl;
} | a.cc: In function 'int main()':
a.cc:14:27: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [1]')
14 | A -= ""
| ~~^~~~~
|
s361282681 | p04030 | C++ | #include <iostream>
using namespace std;
int main(){
string S, A;
for(int i=0; i<10; i++){
char x;
cin >> x;
if(x=='0'){
A += "0";
} else if(x=='1'){
A += "1";
} else if(x=='B'){
*(A.end()-1) = '';
}
}
cout << A << endl;
} | a.cc:14:40: error: empty character constant
14 | *(A.end()-1) = '';
| ^~
|
s156267098 | p04030 | C++ | #include <iostream>
using namespace std;
int main(){
string S, A;
for(int i=0; i<10; i++){
char x;
cin >> x;
if(x=='0'){
A += "0";
} else if(x=='1'){
A += "1";
} else if(x=='B'){
*A.end() = '';
}
}
cout << A << endl;
} | a.cc:14:36: error: empty character constant
14 | *A.end() = '';
| ^~
|
s049113808 | p04030 | C++ | #include <iostream>
using namespace std;
int main(){
string S, A;
for(int i=0; i<10; i++){
char x;
cin >> x;
if(x=='0'){
A += "0";
} else if(x=='1'){
A += "1";
} else if(x=='B'){
*A.end() = "";
}
}
cout << A << endl;
} | a.cc: In function 'int main()':
a.cc:14:36: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
14 | *A.end() = "";
| ^~
| |
| const char*
|
s651252911 | p04030 | C++ | #include <iostream>
using namespace std;
int main(){
string S, A;
for(int i=0; i<10; i++){
char x;
cin >> x;
if(x=='0'){
A += "0";
} else if(x=='1'){
a += "1";
} else if(x=='B'){
if(A.size()!=0){
A -= *A.end();
}
}
}
cout << A << endl;
} | a.cc: In function 'int main()':
a.cc:12:25: error: 'a' was not declared in this scope
12 | a += "1";
| ^
a.cc:15:35: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
15 | ... |
s510082601 | p04030 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<string>
#include<sstream>
#include<iomanip>
#include<utility>
#include<cmath>
#include<set>
#include<list>
#include<string>
#include<queue>
#include<stack>
#include<deque>
#include<map>
#include<set>
#include<cstring>
#i... | a.cc:63:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
63 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:72:16: error: no match for 'operator<<' (operand types are 'std::basic_istream<char>' and '<unresolved overloaded function type>')
72 | cin >> ans << endl;
... |
s917415035 | p04030 | C++ | #include<iostream>
using namespace std;
int main(){
char s[] ;
cin >> s ;
int i = 0;
char out[sizeof(s)];
int j = 0;
for (i = 0; i <= sizeof(s); i++){
if (s[i] == '0') {
out[j] += '0';
j++;
}
else if (s[i] == '1'){
out[j]... | a.cc: In function 'int main()':
a.cc:7:11: error: storage size of 's' isn't known
7 | char s[] ;
| ^
a.cc:16:13: error: 'out' was not declared in this scope
16 | out[j] += '0';
| ^~~
a.cc:20:13: error: 'out' was not declared in this scope
20 | out... |
s306850990 | p04030 | C++ | s = input()
ans = []
for ch in s:
if ch == '0':
ans.append('0')
elif ch == '1':
ans.append('1')
else:
if len(ans) != 0:
ans.pop()
print("".join(ans)) | a.cc:1:1: error: 's' does not name a type
1 | s = input()
| ^
|
s495103074 | p04030 | C++ | // inputに入力データ全体が入る
function Main(input) {
ans = [];
for(let i=0;i<input.length;i++){
if(input[i] == 'B') ans.pop();
else ans.push(input[i]);
}
console.log(ans.join(''));
}
//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)
Main(require("fs").readFileSync("/dev/stdin", "utf8")); | a.cc:8:30: error: empty character constant
8 | console.log(ans.join(''));
| ^~
a.cc:2:1: error: 'function' does not name a type; did you mean 'union'?
2 | function Main(input) {
| ^~~~~~~~
| union
a.cc:11:5: error: expected constructor, destructor, or type ... |
s443341146 | p04030 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
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('1');
}
el... | a.cc: In function 'int main()':
a.cc:20:33: error: cannot convert 'std::__cxx11::basic_string<char>::empty' from type 'bool (std::__cxx11::basic_string<char>::)() const noexcept' to type 'bool'
20 | if(!ans.empty)
| ^~~~~
a.cc:20:33: error: in argument to... |
s647936133 | p04030 | C++ | #include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<functional>
#include<stack>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include... | a.cc: In function 'int main()':
a.cc:49:20: error: 'sre' was not declared in this scope
49 | if(sre[i] == 'B' && now > 0)now--;
| ^~~
a.cc: In lambda function:
a.cc:52:31: error: expected '{' before '=' token
52 | [now] = str[i];
| ... |
s344784353 | p04030 | C++ | 0BB1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 0BB1
| ^~~~
|
s894627249 | p04030 | C++ | abc | a.cc:1:1: error: 'abc' does not name a type
1 | abc
| ^~~
|
s031977221 | p04030 | C++ | // glory be to the sky
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
string input;
vector<char> output;
cin >> input;
for (int i = 0; i < input.length(); i++) {
if (input[i] == '0') output.pb('0');
else if (input[... | a.cc: In function 'int main()':
a.cc:16:45: error: 'class std::vector<char>' has no member named 'pb'
16 | if (input[i] == '0') output.pb('0');
| ^~
a.cc:17:50: error: 'class std::vector<char>' has no member named 'pb'
17 | else if ... |
s123381974 | p04030 | C | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<queue>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<cmath>
#include<cctype>
#include<ctime>
#define pi acos(-1.0)
using namespace std;
int main()
{
string a;
cin>>a;
int len=a.... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s725101342 | p04030 | C++ | #include<iostream>
#include<cstring>
#include<vector>
#include<stack>
#include<cstdio>
using namespace std;
char a[50],b[50];
int main()
{
vector<char>q;
while(cin>>a)
{
int len=a.size();
for(int i=0;i<len;i++)
{
if(a[i]=='0')
q.push_back('0');
else if(a[i]=='1')
q.push_back('1');
else if(!q.... | a.cc: In function 'int main()':
a.cc:13:27: error: request for member 'size' in 'a', which is of non-class type 'char [50]'
13 | int len=a.size();
| ^~~~
|
s691428751 | p04030 | C++ | #include<iostream>
#include<cstring>
#include<vextor>
#include<stack>
#include<cstdio>
using namespace std;
char a[50],b[50];
int main()
{
vector<char>q;
while(cin>>a)
{
int len=a.size();
for(int i=0;i<len;i++)
{
if(a[i]=='0')
q.push_back('0');
else if(a[i]=='1')
q.push_back('1');
else if(!q.... | a.cc:3:9: fatal error: vextor: No such file or directory
3 | #include<vextor>
| ^~~~~~~~
compilation terminated.
|
s293268682 | p04030 | C++ | #include<iostream>
using namespace std;
#include<cstring>
#include<cstdio>
int a[20];
char s[20];
int main()
{
gets(s);
// puts(s);
int k=-1;
for(int i=0;i<strlen(s);i++)
{
if(s[i]=='0')
{
k++;
a[k]=0;
}
if(s[i]=='1')
{
k++;
a[k]=1;
}
if(s[i]=='B')
if(k>=0)
k--;
}
for(int i=0;i<=k;i++)
{
... | a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(s);
| ^~~~
| getw
|
s294731088 | p04030 | C++ | #include<iostream>
using namespace std;
#include<cstring>
#include<cstdio>
int a[20];
char s[20];
int main()
{
gets(s);
// puts(s);
int k=-1;
for(int i=0;i<strlen(s);i++)
{
if(s[i]=='0')
{
k++;
a[k]=0;
}
if(s[i]=='1')
{
k++;
a[k]=1;
}
if(s[i]=='B')
if(k>=0)
k--;
}
for(int i=0;i<=k;i++)
{
... | a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(s);
| ^~~~
| getw
|
s530355552 | p04030 | C++ | #include<iostream>
using namespace std;
#include<cstring>
int a[20];
char s[20];
int main()
{
gets(s);
// puts(s);
int k=-1;
for(int i=0;i<strlen(s);i++)
{
if(s[i]=='0')
{
k++;
a[k]=0;
}
if(s[i]=='1')
{
k++;
a[k]=1;
}
if(s[i]=='B')
if(k>=0)
k--;
}
for(int i=0;i<=k;i++)
{
cout<<a[i];
}
... | a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(s);
| ^~~~
| getw
|
s523172557 | p04030 | C++ | #include"stdio.h"
#include"cstdio"
#include"algorithm"
#include"string.h"
using namespace std;
const int max_n=1e4+10;
char A[max_n];
char S[50];
int main()
{
while(gets(A)!=NULL)
{
int i,k=-1,n=strlen(A);
memset(S,0,sizeof(S));
for(i=0;i<n;i++)
{
if(A[i]=='0')
{
S[++k]='0';
}
if(A[i]=='1')
... | a.cc: In function 'int main()':
a.cc:11:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | while(gets(A)!=NULL)
| ^~~~
| getw
|
s135215630 | p04030 | C++ | #include<cstring>
#include<cstdio>
using namespace std;
int main()
{
char s[15],a[15];
gets(s);
int len =strlen(s);
int l=0;
for(int i=0;i<len ;i++)
{
if(s[i]=='0'||s[i]=='1')
a[l++]=s[i];
if(s[i]=='B'&&l>=1)
l--;
}
for(int i=0;i<l;i++)
printf("%c"... | a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(s);
| ^~~~
| getw
|
s483705889 | p04030 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
int main()
{
string s;
while(cin>>s)
{
for(int i=0;i<s.size();i++)
{
if(s[i]=='0')
{
ch.push_back('0');
}
else if(s[i]=='1')
... | a.cc: In function 'int main()':
a.cc:17:17: error: 'ch' was not declared in this scope
17 | ch.push_back('0');
| ^~
a.cc:21:17: error: 'ch' was not declared in this scope
21 | ch.push_back('1');
| ^~
a.cc:23:22: error: 'ch' was not declar... |
s775635445 | p04030 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
string s, str="";
cin >> s;
for (int i = 0;i < s.size();i++) {
if ((s[i]=='0'||s[i]=='1') {
str += s[i];
}
else {
str = str.substr(0, str.size() - 1);
}
}
cout << str << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:43: error: expected ')' before '{' token
8 | if ((s[i]=='0'||s[i]=='1') {
| ~ ^~
| )
a.cc:14:9: error: expected primary-expression before '}' token
14 | }
... |
s471205307 | p04030 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
string s, str;
cin >> s;
for (int i = 0;i < s.size();i++) {
if ((s[i] == 0) || (s[i] == 1)) {
str += s[i];
}
else
str = str.substr(0, str.size()-1);
cout << str << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s164974708 | p04030 | C++ | #include <stdio.h>
#include <conio.h>
int main(){
char S[11];
char A[11]={};
int x=0;
scanf("%s",&S);
for(int i=0;i<11;i++){
if(S[i]=='0'){
A[x]='0';
x++;
}
else if(S[i]=='1'){
A[x]='1';
x++;
}
else if(S[i]=='B'){
if(x!=0)
x--;
}
}
for(int i=0;i<x;i++){
printf("%c",A[i]);
}
... | a.cc:2:10: fatal error: conio.h: No such file or directory
2 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s514197301 | p04030 | C++ | #include <cstdio>
#ifdef _MSC_VER
#include <conio.h>
#else
#define getch()
#endif
#include <string>
#include <queue>
using std::string;
using std::queue;
int main(){
queue<char> Input;
string Str="";
char Buf[11]="";
scanf("%s",Buf);
for(int i=0;i<strlen(Buf);i++){
Input.push(Buf[i]);
}
while(Input.empty()!=... | a.cc: In function 'int main()':
a.cc:18:23: error: 'strlen' was not declared in this scope
18 | for(int i=0;i<strlen(Buf);i++){
| ^~~~~~
a.cc:9:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
8 | #include <queue>
++... |
s258594238 | p04030 | C++ | //ABC043B
#include <iostream>
#include <string>
#include <stack>
#include <list>
#include <algorithm>
using namespace std;
int main(){
string s;
list<char> st;
cin>>s;
for(int i=0;i<s.size();i++){
if(s[i]=='0'||s[i]=='1'){
st.push_back(s[i]);
}else if(s[i]=='B'){
... | a.cc: In function 'int main()':
a.cc:27:16: error: 'class std::__cxx11::list<char>' has no member named 'pop'
27 | st.pop.front();
| ^~~
|
s076847151 | p04030 | C++ | package main
import (
"fmt"
)
func main(){
var b string
fmt.Scan(&b)
var out []rune
for _,v := range b {
switch v {
case 'B':
if len(out) > 0 {
out = out[:len(out) - 1]
}
default:
out = append(out, v)
}
}
fmt.Println(string(out))
} | a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
|
s829347480 | p04030 | Java | public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s=new Scanner(System.in);
String S=s.next();
boolean f[]=new boolean[S.length()];
int i=0;
for(i=0;i<S.length();i++){
f[i]=true;
if(S.charAt(i)=='B'){
f[i-1]=false;
f[i]=false;
}
... | Main.java:5: error: cannot find symbol
Scanner s=new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner s=new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s660656525 | p04030 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String s=sc.next();
String m="";
String taihi="";
for(int i=0;i<s.length();i++){
if(s.charAt(i)=='B'){
for(int j=0;j<m.length()-1;j++){
taih... | a.cc:1:3: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:3: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:3: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s316262106 | p04030 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s; cin >> s;
string str;
for (int i = 0; i < s.size(); i++){
if (s[i] == '0')str += '0';
else if (s[i] == '1')str += '1';
else if (s[i] == 'B'&&s.size != 0)s.pop_back();
}
cout << str << endl;
} | a.cc: In function 'int main()':
a.cc:10:41: 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... |
s418784787 | p04030 | C++ | ra | a.cc:1:1: error: 'ra' does not name a type
1 | ra
| ^~
|
s988831128 | p04030 | C++ | #include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <b... | a.cc: In function 'void mainmain()':
a.cc:100:9: error: 'stirng' was not declared in this scope
100 | stirng ans = "";
| ^~~~~~
a.cc:103:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
103 | if(ans.size()==0){
| ^~~
... |
s566488672 | p04030 | Java | public class Main {
public static void main(String Args[]){
Scanner sc=new Scanner(System.in);
String str = sc.next();
StringBuffer sb1 = new StringBuffer();
char []hoge = str.toCharArray();
for(char ch:ho... | Main.java:5: error: cannot find symbol
Scanner sc=new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner sc=new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s901060321 | p04030 | C++ | #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
const long long INF = LLONG_MAX / 2;
#define FOR(i, r, n) for(int i=(r); i<(n); i++)
#define REP(i, n) FOR(i, (0), n)
#define ll long long int
template<typename T>
void remove(std::vector<T>& vector, unsigned... | a.cc:7:23: error: 'LLONG_MAX' was not declared in this scope
7 | const long long INF = LLONG_MAX / 2;
| ^~~~~~~~~
a.cc:7:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
6 | #include <vector>
+++ |+#include <climits>
... |
s578192240 | p04030 | Java | import java.util.Scanner;
public class Hacking {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
String str2 = "";
for(char c : str.toCharArray()){
if(c == 'b'){
if(!str2.equals("")){
str2 = str2.substring(0,str2.length()-1);
... | Main.java:3: error: class Hacking is public, should be declared in a file named Hacking.java
public class Hacking {
^
1 error
|
s765007959 | p04030 | C++ | #include <iostream>
#include <stack>
using namespace std;
int main() {
string s;
string st;
cin >> s;
for (auto i = s.begin(); i != s.end(); i++) {
if (*i=='B') st.pop_back();
else st.push_back(*i)
}
cout << st << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:22: error: expected ';' before '}' token
12 | else st.push_back(*i)
| ^
| ;
13 | }
| ~
|
s434842763 | p04030 | C++ | #include <iostream>
#include <stack>
using namespace std;
int main() {
string s;
string st
cin >> s;
for (auto i = s.begin(); i != s.end(); i++) {
if (*i=='B') st.pop_back();
else st.push_back(*i)
}
cout << st << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:1: error: expected initializer before 'cin'
9 | cin >> s;
| ^~~
a.cc:11:14: error: 'st' was not declared in this scope; did you mean 's'?
11 | if (*i=='B') st.pop_back();
| ^~
| s
a.cc:12:6: error: 'st' was not declared in this sc... |
s001452841 | p04030 | C | include<stdio.h>
int main(void)
{
char S[500];
scanf("%S",S);
printf("%S",S);
rewind(stdin);
getchar();
return 0;
} | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s188471453 | p04030 | C | include<stdio.h>
int main(void)
{
char S[500];
scanf("%S",S);
printf("%S",S);
rewind(stdin);
getchar();
return 0;
} | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s000934676 | p04030 | C++ | #include<iostream>
#include<string>
using std::cin;
using std::cout;
using std::endl;
using std::string;
string s, result;
int main() {
cin >> s;
for(auto c : s) {
if(c == 'B') {
if(!result.empty()) result.erase(result.size()-1);
continue;
}
result.append(c);
}
cout << result << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:17:30: error: no matching function for call to 'std::__cxx11::basic_string<char>::append(char&)'
17 | result.append(c);
| ~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/loc... |
s390790623 | p04030 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
#define sz 12
char s[sz + 2];
int main(){
int i, j, len;
int p = 0;
scanf("%s", s)
len = strlen(s);
if(len == 1){
if(s[0] != 'B'){
printf("%s\n", s);
}
}
... | a.cc: In function 'int main()':
a.cc:15:19: error: expected ';' before 'len'
15 | scanf("%s", s)
| ^
| ;
16 |
17 | len = strlen(s);
| ~~~
|
s671866247 | p04030 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
#define sz 12
char s[sz + 3];
int main(){
int i, j, len;
gets(s);
len = strlen(s);
if(len == 1){
puts(s);
}else{
for(i = 0; s[i]; i++){
if(s[i + 1] != 'B' && s[i] != 'B'){
... | a.cc: In function 'int main()':
a.cc:14:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
14 | gets(s);
| ^~~~
| getw
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.