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 <cstring> 2 | #include<string>
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'){ out[i] = '1'; p++ }else{p--;} } printf("%s",out); return 0; }
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++ | ^ | ; 19 | }else{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'){ out[i] = '1'; p++ }else{p--;} } printf("%s",out); return 0; }
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 reported only once for each function it appears in main.c:18:10: error: expected ';' before '}' token 18 | p++ | ^ | ; 19 | }else{p--;} | ~
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++; break; case 1: out[i] = 1; p++; break; case B: p--; break; } for(j=0;j<p;j++){ printf("%c",str[j]); } } return 0; }
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 reported only once for each function it appears in main.c:22:12: error: 'B' undeclared (first use in this function) 22 | case B: | ^ main.c:26:9: error: 'j' undeclared (first use in this function) 26 | for(j=0;j<p;j++){ | ^
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 c : &s){ cout << c; } cout << endl; }
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){ | ^ In file included from /usr/include/c++/14/bits/algorithmfwd.h:39, from /usr/include/c++/14/bits/stl_algo.h:59, from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)' 88 | begin(initializer_list<_Tp> __ils) noexcept | ^~~~~ /usr/include/c++/14/initializer_list:88:5: note: template argument deduction/substitution failed: a.cc:19:17: note: mismatched types 'std::initializer_list<_Tp>' and 'std::__cxx11::basic_string<char>*' 19 | for(char c : &s){ | ^ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)' 52 | begin(_Container& __cont) -> decltype(__cont.begin()) | ^~~~~ /usr/include/c++/14/bits/range_access.h:52:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&) [with _Container = std::__cxx11::basic_string<char>*]': a.cc:19:17: required from here 19 | for(char c : &s){ | ^ /usr/include/c++/14/bits/range_access.h:52:50: error: request for member 'begin' in '__cont', which is of pointer type 'std::__cxx11::basic_string<char>*' (maybe you meant to use '->' ?) 52 | begin(_Container& __cont) -> decltype(__cont.begin()) | ~~~~~~~^~~~~ /usr/include/c++/14/bits/range_access.h:63:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)' 63 | begin(const _Container& __cont) -> decltype(__cont.begin()) | ^~~~~ /usr/include/c++/14/bits/range_access.h:63:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&) [with _Container = std::__cxx11::basic_string<char>*]': a.cc:19:17: required from here 19 | for(char c : &s){ | ^ /usr/include/c++/14/bits/range_access.h:63:56: error: request for member 'begin' in '__cont', which is of pointer type 'std::__cxx11::basic_string<char>* const' (maybe you meant to use '->' ?) 63 | begin(const _Container& __cont) -> decltype(__cont.begin()) | ~~~~~~~^~~~~ /usr/include/c++/14/bits/range_access.h:95:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])' 95 | begin(_Tp (&__arr)[_Nm]) noexcept | ^~~~~ /usr/include/c++/14/bits/range_access.h:95:5: note: template argument deduction/substitution failed: a.cc:19:17: note: mismatched types '_Tp [_Nm]' and 'std::__cxx11::basic_string<char>*' 19 | for(char c : &s){ | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/valarray:1227:5: note: candidate: 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)' 1227 | begin(valarray<_Tp>& __va) noexcept | ^~~~~ /usr/include/c++/14/valarray:1227:5: note: template argument deduction/substitution failed: a.cc:19:17: note: mismatched types 'std::valarray<_Tp>' and 'std::__cxx11::basic_string<char>*' 19 | for(char c : &s){ | ^ /usr/include/c++/14/valarray:1238:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)' 1238 | begin(const valarray<_Tp>& __va) noexcept | ^~~~~ /usr/include/c++/14/valarray:1238:5: note: template argument deduction/substitution failed: a.cc:19:17: note: mismatched types 'const std::valarray<_Tp>' and 'std::__cxx11::basic_string<char>*' 19 | for(char c : &s){ | ^ a.cc:19:17: error: no matching function for call to 'end(std::__cxx11::basic_string<char>*&)' /usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)' 99 | end(initializer_list<_Tp> __ils) noexcept | ^~~ /usr/include/c++/14/initializer_list:99:5: note: template argument deduction/substitution failed: a.cc:19:17: note: mismatched types 'std::initializer_list<_Tp>' and 'std::__cxx11::basic_string<char>*' 19 | for(char c : &s){ | ^ /usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:74:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&) [with _Container = std::__cxx11::basic_string<char>*]': a.cc:19:17: required from here 19 | for(char c : &s){ | ^ /usr/include/c++/14/bits/range_access.h:74:48: error: request for member 'end' in '__cont', which is of pointer type 'std::__cxx11::basic_string<char>*' (maybe you meant to use '->' ?) 74 | end(_Container& __cont) -> decltype(__cont.end()) | ~~~~~~~^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)' 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&) [with _Container = std::__cxx11::basic_string<char>*]': a.cc:19:17: required from here 19 | for(char c : &s){ | ^ /usr/include/c++/14/bits/range_access.h:85:54: error: request for member 'end' in '__cont', which is of pointer type 'std::__cxx11::basic_string<char>* const' (maybe you meant to use '->' ?) 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ~~~~~~~^~~ /usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])' 106 | end(_Tp (&__arr)[_Nm]) noexcept | ^~~ /usr/include/c++/14/bits/range_access.h:106:5: note: template argument deduction/substitution failed: a.cc:19:17: note: mismatched types '_Tp [_Nm]' and 'std::__cxx11::basic_string<char>*' 19 | for(char c : &s){ | ^ /usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)' 1249 | end(valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/valarray:1249:5: note: template argument deduction/substitution failed: a.cc:19:17: note: mismatched types 'std::valarray<_Tp>' and 'std::__cxx11::basic_string<char>*' 19 | for(char c : &s){ | ^ /usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)' 1265 | end(const valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/valarray:1265:5: note: template argument deduction/substitution failed: a.cc:19:17: note: mismatched types 'const std::valarray<_Tp>' and '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) ID:017 !!!!!!!! !!!!!!!! !!!!!!!! !!!!!!!! !!!!!!!! !!!!!!!! !!!!!!!! !!!!!!!! !!!!!!!! ****!!!!!!!!**** ************** ************ ********** ******** ****** **** ** _____________________________________________________________________________________________________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ````````````````````````````````````````````````````````````````````````````````````````````````````` ****** ****** ***** ***** **** **** *** *** ** ** * * $$$$$$$$$$$$$$ $$$$$$ $$$$$$$$ $$$$$$$$$$ $$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$ $$$$$$$ $$$$$$ $$$$$$$$$$$$ $$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$ $$$$ $$$ $$$$ $$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$ $$$$ $$$$ $$$$ $$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$ $$$$ $$$$ $$$$ $$$$ $$ $$$$ $$$$ $$$ $$$$ $$$$ $$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$ $$$$ $$$ $$$$ $$$$ $$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$ $$$$ $$$ $$$$ $$$$ $$$$$$$$$$$$$$$$$$ $$$$ $$$$ $$$$ $$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$$ $$$ $$$$ $$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$$ $$$$$$$$$$$$ $$$$$$$$$$$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$$$ $$$$$$ $$$$$$$$$$ $$$$$$$$$$$$$$$ LETS START OUR JOURNEY................... */ #include<bits/stdc++.h> #define pb push_back #define pf push_front #define in insert #define ff first #define ss second #define off return 0 #define mp make_pair #define MOD 1000000007 #define ll long long int #define ld long double #define snll(a) scanf("%lld", &a) #define snll2(a,b) scanf("%lld %lld", &a,&b) #define snll3(a,b,c) scanf("%lld %lld %lld", &a,&b,&c) #define snl(b) scanf("%d", &b) #define snl2(a,b) scanf("%d %d", &a,&b) #define snl3(a,b,c) scanf("%d %d %d", &a,&b,&c) #define ptl(a) printf("%d\n", a) #define ptll(a) printf("%lld\n", a) #define ptl2(a,b) printf("%d %d\n", a,b) #define ptll2(a,b) printf("%lld %lld\n", a,b) #define gcd(a,b) __gcd(a,b) #define lcm(a,b) (a*b)/gcd(a,b) #define pi acos(-1) #define C continue #define B break #define N "\n" #define al(v) v.begin(),v.end() #define srt(v) sort(v.begin(),v.end()) #define rev(v) reverse(v.begin(),v.end()) #define loop(i,a,n) for(int i=a;i<n;i++) #define T int n; scanf("%d", &n); for(int i=0;i<n;i++) using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string str,s=""; cin>>str; for(int i=0; i<str.size(); i++) { if(str[i]=='1' || str[i]=='0') { if(str[i+1]=='B'){ while(str[i+1]=='B') { s+=""; i+=1; } } else s+=str[i]; } else C } cout << s << N; off; } /* *******THE END******** */
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; | ^ a.cc:4:9: error: 'vector' was not declared in this scope 4 | vector<char> d; | ^~~~~~ a.cc:4:16: error: expected primary-expression before 'char' 4 | vector<char> d; | ^~~~ a.cc:8:20: error: 'd' was not declared in this scope 8 | if(d.size()){ | ^ a.cc:11:10: error: 'd' was not declared in this scope 11 | else{d.push_back(s[i]);} | ^ a.cc:13:14: error: 'd' was not declared in this scope 13 | for(auto x:d){cout << x;} | ^ a.cc:13:17: error: 'cout' was not declared in this scope 13 | for(auto x:d){cout << x;} | ^~~~
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(); } cout<<ans<<endl; return 0; } cout<<ans<<endl; return 0; }
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(); }#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; } cout<<ans<<endl; return 0; } cout<<ans<<endl; return 0; }
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++.h> | ^~~~ a.cc:21:18: error: 'stdc' was not declared in this scope; did you mean 'std'? 21 | }#include<bits/stdc++.h> | ^~~~ | std a.cc:22:1: error: expected primary-expression before 'using' 22 | using namespace std; | ^~~~~ a.cc:23:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 23 | int main(){ | ^~ a.cc:23:9: note: remove parentheses to default-initialize a variable 23 | int main(){ | ^~ | -- a.cc:23:9: note: or replace parentheses with braces to value-initialize a variable a.cc:23:11: error: a function-definition is not allowed here before '{' token 23 | int main(){ | ^
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' ; } } printf ("%s \ n" 、a ); }
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 '\343' in program 4 | char s [ 1111 ]<U+3001>a [ 1111 ] = {}; | ^~~~~~~~ main.c:5:15: error: stray '\343' in program 5 | int i <U+3001>n <U+3001>t = 0 ; | ^~~~~~~~ main.c:5:19: error: stray '\343' in program 5 | int i <U+3001>n <U+3001>t = 0 ; | ^~~~~~~~ main.c:7:23: error: stray '\343' in program 7 | scanf <U+FF08>"<U+FF05>s" <U+3001>s <U+FF09>; | ^~~~~~~~ main.c:18:36: warning: unknown escape sequence: '\040' 18 | a [ -t ] = '\ 0' ; | ^~~~~ main.c:18:36: warning: multi-character character constant [-Wmultichar] main.c:24:28: error: stray '\343' in program 24 | printf <U+FF08>"<U+FF05>s \ n" <U+3001>a <U+FF09>; | ^~~~~~~~
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' ; } } printf ("%s \ n" 、a ); 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 '\343' in program 4 | char s [ 1111 ]<U+3001>a [ 1111 ] = {}; | ^~~~~~~~ main.c:5:15: error: stray '\343' in program 5 | int i <U+3001>n <U+3001>t = 0 ; | ^~~~~~~~ main.c:5:19: error: stray '\343' in program 5 | int i <U+3001>n <U+3001>t = 0 ; | ^~~~~~~~ main.c:7:23: error: stray '\343' in program 7 | scanf <U+FF08>"<U+FF05>s" <U+3001>s <U+FF09>; | ^~~~~~~~ main.c:18:36: warning: unknown escape sequence: '\040' 18 | a [ -t ] = '\ 0' ; | ^~~~~ main.c:18:36: warning: multi-character character constant [-Wmultichar] main.c:24:28: error: stray '\343' in program 24 | printf <U+FF08>"<U+FF05>s \ n" <U+3001>a <U+FF09>; | ^~~~~~~~ main.c:25:9: error: invalid suffix "を返します" on integer constant 25 | 0を返します。 | ^~~~~~~~~~~ main.c:25:20: error: stray '\343' in program 25 | 0<U+3092><U+8FD4><U+3057><U+307E><U+3059><U+3002> | ^~~~~~~~
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++) { cout<<v[i]; } v.clear(); return 0; }
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-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' (near match) 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: conversion of argument 1 would be ill-formed: a.cc:10:13: error: invalid conversion from 'const char*' to 'std::vector<char>::value_type' {aka 'char'} [-fpermissive] 10 | v.push_back(""); | ^~ | | | const char* /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' (near match) 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: conversion of argument 1 would be ill-formed: a.cc:10:13: error: invalid conversion from 'const char*' to 'std::vector<char>::value_type' {aka 'char'} [-fpermissive] 10 | v.push_back(""); | ^~ | | | const char*
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 (s[i]=='B' && !p.empty()) p.pop(); } string ans=""; char f; while (!p.empty) { f=p.top(); p.pop(); ans=f+ans; } cout<<ans<<endl; }
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) | ^~~~~ a.cc:25:13: error: in argument to unary ! 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.empty()){ is.push_back(stc.top()); stc.pop(); } reverse(is.begin(),is.end()); for(auto i : is) cout<<i; return 0; }
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); 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'){ c+=s[i]; } else if(c.size()!=0){ c.pop_back(); } } cout<<c<<endl(); }
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, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:744:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::endl(basic_ostream<_CharT, _Traits>&)' 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ /usr/include/c++/14/ostream:744:5: note: candidate expects 1 argument, 0 provided
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.pop_back(); }} else if(s[i]=='1') { c+='1'; } else if(s[i]=='0'){ cout<<'0'; c+='0'; } } cout<<c; }
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<<c; | ^~~~ a.cc:34:1: error: expected declaration before '}' token 34 | } | ^
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 = b; return 1; } return 0; } //max=({}); //条件式が真ならwhileの中身を回し続ける //printf("%d\n", ans); //pairの入力 //vector<pair<ll, ll>>work(n); //rep(i, n) { // ll a, b; // cin >> a >> b; // work[i] = make_pair(a, b); //for(auto p:mp)(mapの探索) //printf("%.10f\n",なんちゃら) int g[15][15]; const int INF = 1001001001; const int dx[4] = { -1,0,1,0 }; const int dy[4] = { 0,-1,0,1 }; //最大公約数 ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; } ll lcm(ll x, ll y) { if (x == 0 || y == 0)return 0; return (x / gcd(x, y) * y); } //素因数分解 vector<pair<ll, int>>factorize(ll n) { vector<pair<ll, int>>res; for (ll i = 2;i * i <= n;++i) { if (n % i)continue; res.emplace_back(i, 0); while (n % i == 0) { n /= i; res.back().second++; } } if (n != 1)res.emplace_back(n, 1); return res; } int bingo[3][3]; int cnt[2][105]; int h, w; bool flag[110][110]; int main() { string s; cin >> s; string ans; int n = s.length(); rep(i, n) { if (s[i] == '0') { ans.push_back('0'); } else if (s[i] == '1') { ans.push_back('1'); } else { ans.erase(ans.end(), 1); } } cout << ans << endl; return 0; }
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/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:2114:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2114 | erase(size_type __pos = 0, size_type __n = npos) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2114:23: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 2114 | erase(size_type __pos = 0, size_type __n = npos) | ~~~~~~~~~~^~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2134 | erase(__const_iterator __position) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2134:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/basic_string.h:2154:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::erase(__const_iterator, __const_iterator) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2154 | erase(__const_iterator __first, __const_iterator __last) | ^~~~~ /usr/include/c++/14/bits/basic_string.h:2154:56: note: no known conversion for argument 2 from 'int' to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'} 2154 | erase(__const_iterator __first, __const_iterator __last) | ~~~~~~~~~~~~~~~~~^~~~~~
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 included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~
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); if(c!='B'){ st.push(c); } else{ if(!st.isEmpty()){ st.pop(); } } } StringBuilder ans=new StringBuilder(); while(!st.isEmpty()){ ans.append(st.pop()); } System.out.println(ans); } }
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); if(c!='B'){ st.push(c); } else{ if(!st.isEmpty()){ st.pop(); } } } StringBuilder ans=new StringBuilder(); while(!st.isEmpty()){ ans.append(st.pop()); } System.out.println(ans); } }
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 + 10; vector<int> g[N]; bool viss[N]; int vis[N]; void dfs(int curr, int par) { for(auto x: g[curr]) if(x != par) dfs(x, curr); } void dfs1(int curr, int par) { viss[curr] = 1; for(auto x: g[curr]) if(!viss[x]) dfs1(x, curr); } void dfs2(int curr, int par, int num) { vis[curr] = num; for(auto x: g[curr]) if(vis[x] == 0) dfs2(x, curr, num); } ll fxor(ll n) { if(n < 0) return 0; if(n % 4 == 3) return 0; else if(n % 4 == 0) return n; else if(n % 4 == 1) return n^(n-1); else if(n%4 == 2) return n^(n-1)^(n-2); } llt ppow(llt x, llt y) { llt res = 1; while(y > 0){ if(y&1) res = (res * x)%M; y = y >> 1; x = (x * x)%M; } return res; } string ans =""; void convert10tob(llt N, int b) { if (N == 0) return; int x = N % b; N /= b; if (x < 0) N += 1; convert10tob(N, b); ans += to_string(x); return; } llt convertback(string a, int b) { llt aa = 0; llt mul = 1; for(int i=a.length()-1; i>=0; i--) { int curr = a[i] - '0'; aa += (curr * mul); mul *= b; } return aa; } int main() { string s,ans=""; cin>>s; rep(i,0,s.length()) { if(s[i]=='0') ans+='0'; else if(s[i]=='1') ans+='1'; else ans.pop(); } cout<<ans; return 0; }
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; | ~~~~^~~~~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~
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 ans = ""; | ^~~ a.cc:11:37: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | if (s[i] == '0' || s[i] == '1') ans += s[i]; | ^~~ | abs a.cc:12:22: error: 'ans' was not declared in this scope; did you mean 'abs'? 12 | if (s[i] == 'B') ans.pop_back; | ^~~ | abs a.cc:14:16: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | std::cout << ans; | ^~~ | abs
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){ continue; } else{ q.pop_back(); } } } for(char ss:q){ cout<<ss; } }
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 second const int MOD = 1000000007; template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; } template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; } //sort(all(x))とするとソートできるよ // 10^x は pow(10,(x)) // 任意のlogは 対数の底の変換を使う log(N) / log(任意の底) int main(){ string s;cin >> s; deque<char> ans; rep(i,s.size()){ if(ans.size() == 0 && s[i] == 'B')continue; else if(s[i] == 'B'){ ans.pop_back(); } else if(s[i] == '0'){ ans.push_back('0'); } else if(s[i] == '1'){ ans.push_back('1'); } } for(auto t : ans){ cout << t <<; } cout << endl; }
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>>s.at[i]; #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() #define prians(Answer) cout<<Answer<<"\n" #define TF(X) X==1?cout<<"Yes\n":cout<<"No\n" #define elcon else{continue;} typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<string> vs; typedef vector<vector<int> > matrix; typedef pair<int,int> pii; typedef vector<pii> vpi; typedef greater<int> gi; typedef vector<unsigned> vu; ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); } bool is_prime(const unsigned n){ switch(n){ case 0: case 1: return false; case 2: return true; } for(unsigned i=2;i<n;++i){ if(n%i == 0) return false; } return true; } int main() { string s,ans=""; cin>>s; rep(i,s.size()) { if(s[i]=='0')ans+='0'; else if(s[i]=='1')ans+='1'; else if(s[i]=='B'&&ans.size>0){ans.pop_back();} } cout<<ans; }
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 unsigned int]' (did you forget the '()' ?) 54 | else if(s[i]=='B'&&ans.size>0){ans.pop_back();} | ~~~~^~~~ | ()
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>>s.at[i]; #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() #define prians(Answer) cout<<Answer<<"\n" #define TF(X) X==1?cout<<"Yes\n":cout<<"No\n" #define elcon else{continue;} typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<string> vs; typedef vector<vector<int> > matrix; typedef pair<int,int> pii; typedef vector<pii> vpi; typedef greater<int> gi; typedef vector<unsigned> vu; ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); } bool is_prime(const unsigned n){ switch(n){ case 0: case 1: return false; case 2: return true; } for(unsigned i=2;i<n;++i){ if(n%i == 0) return false; } return true; } int main() { string s,ans=""; cin>>s; rep(i,s.size()) { if(s[i]=='0')ans+='0'; else if(s[i]=='1')ans+='1'; else if(s[i]=='B'&&ans.size>0){ans.pop_back();} } cout<<ans; }
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 unsigned int]' (did you forget the '()' ?) 54 | else if(s[i]=='B'&&ans.size>0){ans.pop_back();} | ~~~~^~~~ | ()
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() - 1); } } } cout << ans << endl; return 0; }
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.size(); i++) s1 += v[i]; cout << s1; 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/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~
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.size(); i++) s1 += v[i]; cout << s1; 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/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~
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/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ a.cc:14:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 14 | cout << v; | ~~~~ ^~ ~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/
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 == " ") { continue; } } } cout << answer << endl; }
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; | ~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~
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 == " ") { continue; } } } cout << answer << endl;
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; | ~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:2174:7: note: declared here 2174 | pop_back() noexcept | ^~~~~~~~ a.cc:23:32: error: expected '}' at end of input 23 | cout << answer << endl; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
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 identifier is reported only once for each function it appears in main.c:14:17: warning: comparison between pointer and integer 14 | while(box[i]!="\0"){ | ^~ main.c:18:1: error: expected declaration or statement at end of input 18 | } | ^
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 once for each function it appears in main.c:5:29: error: expected ';' before ')' token 5 | for(int i=0;a[i]!="\0";i++){ | ^ | ; main.c:5:29: error: expected statement before ')' token main.c:10:14: error: 'key' undeclared (first use in this function) 10 | }else if(key=='B'){ | ^~~ main.c:18:1: error: expected declaration or statement at end of input 18 | } | ^
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 cout << ' ' #define in(n) cin >> n #define in2(n, m) cin >> n >> m #define in3(n, m, l) cin >> n >> m >> l #define out(n) cout << n const ll mei = (ll)1e9 + 7; int main(){ string s; vector<char> h; rep(i, s.size()){ if(s[i] == '0') h.pb(0); if(s[i] == '1') h.pb(1); if(s[i] == 'B' && h.size() > 0) h.pop_back; } rep(i, h,size()) out(h[i]); memi; }
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 member function 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = char; _Alloc = std::allocator<char>]' 26 | h.pop_back; | ~~^~~~~~~~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:1324:7: note: declared here 1324 | pop_back() _GLIBCXX_NOEXCEPT | ^~~~~~~~ a.cc:28:3: error: 'rep' was not declared in this scope 28 | rep(i, h,size()) | ^~~
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.toArray(new String [list.size()]); for (String str :arr_2) { System.out.println(str); } } }
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){ System.out println(str);} ^ Main.java:5: error: ';' expected for (String str : arr_1){ System.out println(str);} ^ 4 errors
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.java:6: error: ';' expected return !item ==( 1B)||(0B );}; ^ Main.java:6: error: binary numbers must contain at least one binary digit return !item ==( 1B)||(0B );}; ^ 5 errors
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.java:6: error: binary numbers must contain at least one binary digit return !item ==( 1B||0B ); ^ Main.java:6: error: not a statement return !item ==( 1B||0B ); ^ Main.java:6: error: ';' expected return !item ==( 1B||0B ); ^ Main.java:8: error: illegal start of expression ); ^ 7 errors
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 ',' expected var result = items.filter(function( item ) { ^ Main.java:6: error: illegal start of expression return !item ===( 1B||0B ); ^ Main.java:6: error: ')' expected return !item ===( 1B||0B ); ^ Main.java:6: error: binary numbers must contain at least one binary digit return !item ===( 1B||0B ); ^ Main.java:6: error: not a statement return !item ===( 1B||0B ); ^ Main.java:6: error: ';' expected return !item ===( 1B||0B ); ^ Main.java:8: error: illegal start of expression ); ^ 10 errors
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; for (int i = 0; i < i.size(); i++) { if (x[i] == 'b') { v.pop; } else if (x[i] == 0) { v.push(0); } else if (x[i] == 1) { v.push(1); } } PrintStack(v)' }
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++) { | ^~~~ a.cc:26:9: error: invalid use of non-static member function 'void std::stack<_Tp, _Sequence>::pop() [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]' 26 | v.pop; | ~~^~~ In file included from /usr/include/c++/14/stack:63, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:160, from a.cc:1: /usr/include/c++/14/bits/stl_stack.h:291:7: note: declared here 291 | pop() | ^~~ a.cc:35:16: error: expected ';' before '}' token 35 | PrintStack(v)' | ^ | ; 36 | } | ~
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 (int i = 0; i < i.size(); i++) { if (x[i] == 'b') { v.pop; } else if (x[i] == 0) { v.push(0); } else if (x[i] == 1) { v.push(1); } } PrintStack(v) }
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; _Sequence = std::deque<int, std::allocator<int> >]' 26 | v.pop; | ~~^~~ In file included from /usr/include/c++/14/stack:63, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:160, from a.cc:1: /usr/include/c++/14/bits/stl_stack.h:291:7: note: declared here 291 | pop() | ^~~ a.cc:35:16: error: expected ';' before '}' token 35 | PrintStack(v) | ^ | ; 36 | } | ~
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); } } for(int i = 0; i < t.size(); i++) cout << t[i]; cout << endl; }
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(); } } cout << a; }
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<char>} In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::stack<char>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::stack<char>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::stack<char>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::stack<char>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::stack<char>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::stack<char>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::stack<char>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::stack<char>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::stack<char>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::stack<char>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::stack<char>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::stack<char>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::stack<char>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::stack<char>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::stack<char>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::stack<char>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'std::stack<char>' to 'std::nullptr_t' 306 | operator<<(nullptr_t) | ^~~~~~~~
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(); } } for(int i=0;i<a.size();i++){ cout << a.at(i); } cout << endl; }
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]!=' ') { c[l1]=b[i]; l1++; } } c[l1]='\0'; printf("%s",c); }
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[l1]=b[i]; l1++; } } c[l1]='\0'; printf("%s",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(c); }
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.size()-1); k--; } for(int i=0;i<b.size();i++) cout<<b[i]; return 0;}
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.size()-1); k--; } print(b); return 0;}
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;vector<string>b; | ^
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.size()-1); k--; } cout<<b; return 0;}
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> > | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream
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.size()-1); k--; } cout<<b; return 0;}
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 'std::basic_ostream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 19 | cout<<b; | ~~~~^~~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known co
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--; } cout<<b; return 0;}
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: error: request for member 'size' in 'a', which is of non-class type 'int' 6 | for(int i=0;i<a.size();i++) | ^~~~ a.cc:7:9: error: invalid types 'int[int]' for array subscript 7 | { if(a[i]=='0') | ^ a.cc:8:9: error: request for member 'resize' in 'b', which is of non-class type 'int' 8 | { b.resize(b.size()+1); | ^~~~~~ a.cc:8:18: error: request for member 'size' in 'b', which is of non-class type 'int' 8 | { b.resize(b.size()+1); | ^~~~ a.cc:9:8: error: invalid types 'int[int]' for array subscript 9 | b[k++]='0'; | ^ a.cc:11:14: error: invalid types 'int[int]' for array subscript 11 | else if(a[i]=='1') | ^ a.cc:12:9: error: request for member 'resize' in 'b', which is of non-class type 'int' 12 | { b.resize(b.size()+1); | ^~~~~~ a.cc:12:18: error: request for member 'size' in 'b', which is of non-class type 'int' 12 | { b.resize(b.size()+1); | ^~~~ a.cc:13:8: error: invalid types 'int[int]' for array subscript 13 | b[k++]='1';} | ^ a.cc:15:13: error: request for member 'resize' in 'b', which is of non-class type 'int' 15 | b.resize(b.size()-1); | ^~~~~~ a.cc:15:22: error: request for member 'size' in 'b', which is of non-class type 'int' 15 | b.resize(b.size()-1); | ^~~~ a.cc:19:12: error: expected '}' at end of input 19 | return 0;} | ^ a.cc:4:1: note: to match this '{' 4 | { vector<stirng>a,b;int k=0; | ^
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){ list.add(str.charAt(i)); j = j + 1; }else if (j <> 0){ list.remove(j - 1); } } } }
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(); } } } cout<<t<<endl; }
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(); } } } cout<<t<<endl; }
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.at(i) == '1'){ L.push_back('1'); } if(s.at(i) == 'B'){ if(L.size == 0){ continue; } else{ L.pop_back(); } } } for(int i = 0; i < L.size(); i++){ cout << L.at(i); } }
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.at(i) == '1'){ L.push_back('1'); } if(s.at(i) == 'B'){ if(L.size = 0){ continue; } else{ L.pop_back(); } } } for(int i = 0; i < L.size(); i++){ cout << L.at(i); } }
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'; } if(s.at(i) == '1'){ L.push_back() = '1'; } if(s.at(i) == 'B'){ L.pop_back(); } } for(int i = 0; i < N; i++){ cout << L.at(i); } }
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_back()' 19 | L.push_back() = '0'; | ~~~~~~~~~~~^~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate expects 1 argument, 0 provided a.cc:22:18: error: no matching function for call to 'std::vector<char>::push_back()' 22 | L.push_back() = '1'; | ~~~~~~~~~~~^~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = char; _Alloc = std::allocator<char>; value_type = char]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate expects 1 argument, 0 provided a.cc:29:22: error: 'N' was not declared in this scope 29 | for(int i = 0; i < N; i++){ | ^
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'; cout << t << endl;
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/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
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(S.at(i)=='B'){S.at(i)='';S.at(i-1)='';}} | ^~
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(); | ^ a.cc:22:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::stack<char>') 22 | cout << ans << endl; | ~~~~ ^~ ~~~ | | | | | std::stack<char> | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::stack<char>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::stack<char>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::stack<char>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::stack<char>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::stack<char>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::stack<char>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::stack<char>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::stack<char>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::stack<char>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::stack<char>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::stack<char>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::stack<char>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::stack<char>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::stack<char>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::stack<char>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::stack<char>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_trai
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:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop' 10 | s.pop(); | ^~~
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'){ stack.push("0");} if(s.charAt(i)=='1'){ stack.push("1");} if(s.charAt(i)=='B'){ stack.pop();}} String res = ""; while(!s.isEmpty()){ res = res + s.pop();} System.out.println(res);}}
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: error: cannot find symbol res = res + s.pop();} ^ symbol: method pop() location: variable s of type String 3 errors
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 sz(a) (int((a).size())) #define mp make_pair #define f first #define s second #define pii pair<int, int> using namespace std; const int mod = 998244353; const int inf = (int)2e9; const ll INF = (ll)2e18; const int N = 100100; string s, ans; int main() { ios_base::sync_with_stdio(0), cin.tie(0); cin >> s; for (int i = 0; i < sz(s); i++) { if (s[i] != 'B') { ans += s[i]; } else if (ans != '') ans.pop_back(); } cout << ans << endl; return 0; }
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 | } else if (ans != '') ans.pop_back(); | ~~~ ^~ ~~ | | | | | char | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:39:35: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 39 | } else if (ans != '') ans.pop_back(); | ^~ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:39:35: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 39 | } else if (ans != '') ans.pop_back(); | ^~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:39:35: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 39 | } else if (ans != '') ans.pop_back(); | ^~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:39:35: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 39 | } else if (ans != '') ans.pop_back(); | ^~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:39:35: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 39 | } else if (ans != '') ans.pop_back(); | ^~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:39:35: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 39 | } else if (ans != '') ans.pop_back(); | ^~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:39:35: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 39 | } else if (ans != '') ans.pop_back(); | ^~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:39:35: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 39 | } else if (ans != '') ans.pop_back(); | ^~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:39:35: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 39 | } else if (ans != '') ans.pop_back(); | ^~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:39:35: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char' 39 | } else if (ans != '') ans.pop_back(); | ^~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:39:35: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'char' 39 | } else if (ans != '') ans.pop_back(); | ^~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:39:35: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 39 | } else if (ans != '') ans.pop_back(); | ^~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:39:35: note: mismatched types 'const _CharT*' and 'char' 39 | } else if (ans != '') ans.pop_back(); | ^~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:39:35: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 39 | } else if (ans != '') ans.pop_back(); | ^~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/include/c++/14/bits/basic_ios.h:37, from /usr/include/c++/14/i
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"; break; case '1': bef=ans; ans+="1"; break; case 'B': char[] d=ans.toCharArrray(); d[d.length-1]=' '; ans=String.valueOf(d); break; } } System.out.println(ans); } }
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"; break; case '1': bef=ans; ans+="1"; break; case 'B': char[] d=ans.toCharArrray(); d[d.length-1]=''; ans=String.valueOf(d); break; } } System.out.println(ans); } }
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[i] != 'B') { stack.push(s[i]); } else { if (stack.size() > 0) { stack.pop(); } } } String ans = ""; for (int i = 0; i < stack.size(); i++) { ans += stack.get(i); } System.out.println(ans); } }
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[i] == 0){ t.push_back('0'); }else if(s[i] == 1){ t.push_back('1'); }else(s[i] == B){ t.pop_back() } cout << t << endl; } return 0 ; }
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++ } } cout <<out<<endl; return 0; }
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]; return 0 ; }
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' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<cstdio> +++ |+#include <cstring> 3 | using namespace std;
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' without a previous 'if' 13 | }else{ | ^~~~ a.cc:14:15: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(int&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)' 14 | t.insert(a,s.at(i)); | ~~~~~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:2007:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match) 2007 | insert(size_type __pos, const _CharT* __s) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2007:7: note: conversion of argument 2 would be ill-formed: a.cc:14:22: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive] 14 | t.insert(a,s.at(i)); | ~~~~^~~ | | | __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char} /usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, _InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 1876 | insert(const_iterator __p, _InputIterator __beg, _InputIterator __end) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:2069:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2069 | insert(size_type __pos, const _Tp& __svt) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2069:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = std::__cxx11::basic_string<char>&]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = char; _Res = std::__cxx11::basic_string<char>&; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2069:2: required by substitution of 'template<class _Tp> std::__cxx11::basic_string<char>::_If_sv<_Tp, std::__cxx11::basic_string<char>&> std::__cxx11::basic_string<char>::insert(size_type, const _Tp&) [with _Tp = char]' 2069 | insert(size_type __pos, const _Tp& __svt) | ^~~~~~ a.cc:14:15: required from here 14 | t.insert(a,s.at(i)); | ~~~~~~~~^~~~~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, std::__cxx11::basic_string<char>&>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2086 | insert(size_type __pos1, const _Tp& __svt, | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator; size_type = long unsigned int]' 1831 | insert(const_iterator __p, size_type __n, _CharT __c) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:1911:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 1911 | insert(const_iterator __p, initializer_list<_CharT> __l) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1911:29: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>::const_iterator' 1911 | insert(const_iterator __p, initializer_list<_CharT> __l) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:1939:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 1939 | insert(size_type __pos1, const basic_string& __str) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1939:52: note: no known conversion for argument 2 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::__cxx11::basic_string<char>&' 1939 | insert(size_type __pos1, const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 1963 | insert(size_type __pos1, const basic_string& __str, | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate expects 4 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 1987 | insert(size_type __pos, const _CharT* __s, size_type __n) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2032 | insert(size_type __pos, size_type __n, _CharT __c) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:2051:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(__const_iterator, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2051 | insert(__const_iterator __p, _CharT __c) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2051:31: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'} 2051 | insert(__const_iterator __p, _CharT __c) | ~~~~~~~~~~~~~~~~~^~~
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' without a previous 'if' 13 | }else{ | ^~~~ a.cc:14:15: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(int&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)' 14 | t.insert(a,s.at(i)); | ~~~~~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:2007:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match) 2007 | insert(size_type __pos, const _CharT* __s) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2007:7: note: conversion of argument 2 would be ill-formed: a.cc:14:22: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive] 14 | t.insert(a,s.at(i)); | ~~~~^~~ | | | __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char} /usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, _InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 1876 | insert(const_iterator __p, _InputIterator __beg, _InputIterator __end) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:2069:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2069 | insert(size_type __pos, const _Tp& __svt) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2069:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = std::__cxx11::basic_string<char>&]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = char; _Res = std::__cxx11::basic_string<char>&; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2069:2: required by substitution of 'template<class _Tp> std::__cxx11::basic_string<char>::_If_sv<_Tp, std::__cxx11::basic_string<char>&> std::__cxx11::basic_string<char>::insert(size_type, const _Tp&) [with _Tp = char]' 2069 | insert(size_type __pos, const _Tp& __svt) | ^~~~~~ a.cc:14:15: required from here 14 | t.insert(a,s.at(i)); | ~~~~~~~~^~~~~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, std::__cxx11::basic_string<char>&>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 2086 | insert(size_type __pos1, const _Tp& __svt, | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator; size_type = long unsigned int]' 1831 | insert(const_iterator __p, size_type __n, _CharT __c) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:1911:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 1911 | insert(const_iterator __p, initializer_list<_CharT> __l) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1911:29: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>::const_iterator' 1911 | insert(const_iterator __p, initializer_list<_CharT> __l) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:1939:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 1939 | insert(size_type __pos1, const basic_string& __str) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1939:52: note: no known conversion for argument 2 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::__cxx11::basic_string<char>&' 1939 | insert(size_type __pos1, const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 1963 | insert(size_type __pos1, const basic_string& __str, | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate expects 4 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 1987 | insert(size_type __pos, const _CharT* __s, size_type __n) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 2032 | insert(size_type __pos, size_type __n, _CharT __c) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:2051:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(__const_iterator, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]' 2051 | insert(__const_iterator __p, _CharT __c) | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:2051:31: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'} 2051 | insert(__const_iterator __p, _CharT __c) | ~~~~~~~~~~~~~~~~~^~~
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: implicit declaration of function 'prntf'; did you mean 'printf'? [-Wimplicit-function-declaration] 17 | prntf("%c",str[i]); | ^~~~~ | printf
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++; } } cout << output.substr(0,point) << endl; return 0; }
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,point) << endl; return 0; }
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, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:6:17: note: cannot convert '10' (type 'int') to type 'const char*' 6 | string output(10); | ^~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&' 552 | basic_string(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:527:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT =