submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s529278411
p04029
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; cout << n*(n+1)/2 << endl; return;
a.cc: In function 'int main()': a.cc:11:1: error: return-statement with no value, in function returning 'int' [-fpermissive] 11 | return; | ^~~~~~ a.cc:11:8: error: expected '}' at end of input 11 | return; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s513007699
p04030
Java
import java.util.*; import java.io.*; import java.math.*; public class Unhappy_hacking { public static void main(String[] args) { FastScanner I=new FastScanner(); Output O=new Output(); String s=I.next(); Stack<Character> cur=new Stack<Character>(); Stack<Character> ans=new Stack<Character>(); for(int i=0...
Main.java:4: error: class Unhappy_hacking is public, should be declared in a file named Unhappy_hacking.java public class Unhappy_hacking { ^ 1 error
s361144077
p04030
C++
s = str(input()) ans = [] for i in range(len(s)): if s[i] == "B": if len(ans) != 0: ans.pop() else : ans.append(s[i]) print(''.join(ans))
a.cc:7:7: error: empty character constant 7 | print(''.join(ans)) | ^~ a.cc:1:1: error: 's' does not name a type 1 | s = str(input()) | ^
s530819598
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] = ""; if(i!=0){ s[i-1] = ''; } } } }
a.cc:11:16: error: empty character constant 11 | s[i-1] = ''; | ^~ a.cc: In function 'int main()': a.cc:8:16: error: 'B' was not declared in this scope 8 | if(s[i] == B){ | ^ a.cc:9:12: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<...
s496805295
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] = ''; if(i!=0){ s[i-1] = ''; } } } }
a.cc:9:12: error: empty character constant 9 | s[i] = ''; | ^~ a.cc:11:16: error: empty character constant 11 | s[i-1] = ''; | ^~ a.cc: In function 'int main()': a.cc:8:16: error: 'B' was not declared in this scope 8 | if(s[i] == B){ | ...
s232811242
p04030
Java
import java.util.*; public class Main{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); String s = sc.next(); String ans = ""; for(int i = 0; i < s.length; i++){ if(s.charAt(i) == '0' || s.charAt(i) == '1'){ ans += s.charAt(i...
Main.java:9: error: cannot find symbol for(int i = 0; i < s.length; i++){ ^ symbol: variable length location: variable s of type String 1 error
s492731717
p04030
Java
import java.util.*; public class Main{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); String s = sc.next(); String ans = ""; for(int i = 0; i < sa.length; i++){ if(s.charAt(i) == "0" || s.charAt(i) == "1"){ ans += s.charAt(...
Main.java:9: error: cannot find symbol for(int i = 0; i < sa.length; i++){ ^ symbol: variable sa location: class Main Main.java:10: error: bad operand types for binary operator '==' if(s.charAt(i) == "0" || s.charAt(i) == "1"){ ^ first ty...
s057069470
p04030
Java
import java.util.*; public class Main{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); String s = sc.next(); String[] sa = s.split(""); String ans = ""; for(int i = 0; i < sa.length; i++){ if(sa[i] == "0" || sa[i] == "1"){ ...
Main.java:14: error: cannot find symbol ans.substring(0, end - 1); ^ symbol: variable end location: class Main 1 error
s994343252
p04030
Java
import java.util.*; public class Main{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); String s = sc.next(); String[] sa = s.split(""); StringBuilder ans = new StringBuilder(); for(int i = 0; i < sa.length; i++){ if(sa[i] == '0' || ...
Main.java:11: error: bad operand types for binary operator '==' if(sa[i] == '0' || sa[i] == '1'){ ^ first type: String second type: char Main.java:11: error: bad operand types for binary operator '==' if(sa[i] == '0' || sa[i] == '1'){ ...
s662340644
p04030
C++
// C++ includes used for precompiling -*- C++ -*- // Copyright (C) 2003-2013 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free So...
a.cc: In function 'int main()': a.cc:127:15: error: expected ';' before 'for' 127 | cin >> s;0 | ^ | ; a.cc:128:9: error: 'i' was not declared in this scope 128 | rep(i, 10) | ^ a.cc:119:35: note: in definition of macro 'rep' 119 | #define rep(i, n) fo...
s416992153
p04030
C++
#include<bits/stdc++.h> using namespace std; int main(){ string in,out; cin>>in; for(int i=0;i<in.size();i++){ if(in.at(i)=="0"){ out.push_back(i); out.at(i)="0"; }else if(in.at(i)=="1"){ out.push_back(i); out.at(i)="1"; }else{ ...
a.cc: In function 'int main()': a.cc:7:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | if(in.at(i)=="0"){ | ~~~~~~~~^~~~~ a.cc:9:23: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka ...
s818023564
p04030
Java
import java.util.*; import java.util.stream.Collectors; /** * ABC043 B * * @date 2020.08.22 * @author 焼き鮭 <yaki-shake@up-tri.me> */ public class App { Scanner sc; public static void main(String[] args) { new App().execute(); } public void execute() { this.sc = new Scanner(System.in); String...
Main.java:11: error: class App is public, should be declared in a file named App.java public class App { ^ 1 error
s088818856
p04030
Java
import java.util.*; import java.util.stream.Collectors; /** * ABC043 B * * @date 2020.08.22 * @author 焼き鮭 <yaki-shake@up-tri.me> */ public class B { Scanner sc; public static void main(String[] args) { new B().execute(); } public void execute() { this.sc = new Scanner(System.in); String com...
Main.java:11: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s238130764
p04030
C++
#include <stdio.h> int main() { int count = 0; char Zx[14], Yz[14] = {}; scanf("%s", &Zx); for (int u = 0; Zx[u] != '\0'; u++) { if (Zx[u] == '0') { Yz[count] = '0'; count++; } else if (Zx[u] == '1') { Yz[count] = '1'; count++; } else if (count != 0) { if (Xz[u] == 'B') { ...
a.cc: In function 'int main()': a.cc:18:17: error: 'Xz' was not declared in this scope; did you mean 'Yz'? 18 | if (Xz[u] == 'B') { | ^~ | Yz
s533671627
p04030
C++
#include <stdio.h> #include <string.h> int main() { char command[10+1]; scanf("%s",&command); int len = strlen(command); char output[len+1]; for (int i = 0, j = 0; i < len; i++,j++) { if (command[i] == '0') { output[j] = '0'; output[j+1] = '\0'; } else if (command[i] == '1') { output[j] = '1'; ...
a.cc: In function 'int main()': a.cc:20:41: error: expected ';' before '{' token 20 | else (command[i] == 'B') | ^ | ; 21 | { | ~
s280448579
p04030
C++
#include <stdio.h> int main(){ char a[20], char b[20]; scanf("%s",a); int counter=0; for (int i=0 ; a[i] != '\0';i++){ if(a[i] == '0'){ b[counter]='0'; counter++; } else if(a[i] == '1'){ b[counter]='1'; counter++; } else if(counter != 0){ if(a[i] == 'B'){ ...
a.cc: In function 'int main()': a.cc:4:1: error: expected unqualified-id before 'char' 4 | char b[20]; | ^~~~ a.cc:9:9: error: 'b' was not declared in this scope 9 | b[counter]='0'; | ^ a.cc:13:9: error: 'b' was not declared in this scope 13 | b[counter]='1'; | ...
s425234439
p04030
C++
#include <stdio.h> int main(){ char a[20],b[20]; scanf("%s",a); int counter=0; for (int i=0;a[i]!='\0';i++){ if(a[i]=='0'){ b[couter]='0'; counter++; } else if(a[i]=='1'){ b[counter]='1'; counter++; } else if(counter!=0){ if(a[i]=='B'){ b[counter-1]='\0'; counter=counter-2; } counter++; } } b[...
a.cc: In function 'int main()': a.cc:8:19: error: 'couter' was not declared in this scope; did you mean 'counter'? 8 | b[couter]='0'; | ^~~~~~ | counter
s889909348
p04030
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; int main() { ios::sync_with_stdio(false); cin.tie(0); string s, f=""; cin >> s; int n = s.length(); for(int i=0; i<n; i++) { if(s[i] == 'B') { s[i] = '9'; s[i-1] = '9'; } } for(int i=0; i<n; i++) { if (s[i...
a.cc: In function 'int main()': a.cc:25:14: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'legth'; did you mean 'length'? 25 | if(f.legth() > 0) { | ^~~~~ | length
s005016116
p04030
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll INF = 1e16; const ll mod = 1000000007; #define rep(i, n) for (int i = 0; i < (ll)(n); i++) int main() { string s; cin >> s; stack <ll> st; rep(i, s.size()) { if (s.at(i) == '0') st.push(0); else if (s.at(i) == '1')...
a.cc: In function 'int main()': a.cc:14:16: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pop' 14 | else s.pop(); | ^~~
s415428455
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s;cin>>s;string v=""; for(int i=0;i<s.sise();i++){ if(s[i]=='0'||s[i]=='1')v.push_back(s[i]); else if(s[i]=='B'){ if(v.sise()==0)break; else v.erase(v.end()); } }cout<<v<<endl; }
a.cc: In function 'int main()': a.cc:6:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sise'; did you mean 'size'? 6 | for(int i=0;i<s.sise();i++){ | ^~~~ | size a.cc:9:12: error: 'std::string' {aka 'class std::__cxx11::b...
s316151614
p04030
C++
vector<int> vec; int c = 0; rep(i, N) { if(str.at(i) == '0') { vec.push_back(0); c++; } if(str.at(i) == '1') { vec.push_back(1); c++; } if(str.at(i) == 'B') { if(c > 0) { c--; vec.pop_back(); } } } rep(i, vec.size()) { cout << ve...
a.cc:1:3: error: 'vector' does not name a type 1 | vector<int> vec; | ^~~~~~ a.cc:3:6: error: expected constructor, destructor, or type conversion before '(' token 3 | rep(i, N) { | ^ a.cc:19:6: error: expected constructor, destructor, or type conversion before '(' token 19 | rep(i, ...
s116681447
p04030
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) int main() { string str; cin >> str; int N = str.size(); vector<int> vec; rep(i, N) { if(str.at(i) == '0') { vec.push_ba...
a.cc: In function 'int main()': a.cc:19:11: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = int; _Alloc = std::allocator<int>]' 19 | vec.pop_back; | ~~~~^~~~~~~~ In file included from /usr/include/c++/14/vector:66, from /usr/i...
s023548245
p04030
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) int main() { string str; cin >> str; int N = str.size(); vector<int> vec; rep(i, N) { if(str.at(i) == '0') { vec.push_ba...
a.cc: In function 'int main()': a.cc:16:11: error: 'class std::vector<int>' has no member named 'puch_back'; did you mean 'push_back'? 16 | vec.puch_back(1); | ^~~~~~~~~ | push_back a.cc:19:11: error: 'class std::vector<int>' has no member named 'pop_beck'; did you mean 'pop_bac...
s130860972
p04030
C++
/* author : nishi5451 created: 12.08.2020 16:12:44 */ #include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<n; i++) typedef long long ll; int main(){ string s; cin >> s; vector<int> a; rep(i,s.size()){ if(s[i]=='0') a.push_back(0); else if(s[i]=='1'...
a.cc: In function 'int main()': a.cc:21:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<int>') 21 | cout << a << endl; | ~~~~ ^~ ~ | | | | | std::vector<int> | std::ostream {aka std::basic...
s194309305
p04030
Java
import java.util.*; public class Main { public static void main(String[] args) throws Exception{ Scanner scn = new Scanner(System.in); String s = scn.next(); String[] list = s.split(""); String ans = ""; if(s.length()==1){ ans = s; }else{ for(int i=1; i<s.length(); i++)...
Main.java:18: error: incompatible types: int cannot be converted to String if(list[0].equals("B")) list[0]=2; ^ 1 error
s251847171
p04030
C++
#include<bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; using ull = unsigned long long; template<class T, class U> using P = pair<T,U>; template<class T> using Heap = priority_queue<T>; template<class T> using heaP...
a.cc: In function 'int main()': a.cc:49:16: error: 'st' was not declared in this scope; did you mean 's'? 49 | } else if(!st.empty()){ | ^~ | s
s410133451
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int S = s.size() - 1; string c = s.at(0) for (int i = 1; i < S; i++) { if (s.at(i) == '0') {c += '0';} else if (s.at(i) == '1') {c += '1';} else {c.at(i - 1) = ' ';} } cout << c << endl; }
a.cc: In function 'int main()': a.cc:7:18: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 7 | string c = s.at(0) | ~~~~^~~ a.cc:8:3: error: expected ',' o...
s375894016
p04030
C++
#include <bits/stdc++.h> using namespace std; int main(){ string S; cin>>S; queue<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 if(!A.empty())A.pop(); } for(i:A){ cout<<A.front(); A.pop(); } cout<<endl; }
a.cc: In function 'int main()': a.cc:7:27: error: no matching function for call to 'push(const char [2])' 7 | if(S.at(i)=='0')A.push("0"); | ~~~~~~^~~~~ In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157, ...
s893316500
p04030
C
#include <stdio.h> int main () { char str[15]; char modstr[15]; int length = 0; (scanf("%s", str); for (int i = 0; str[i] != '\0'; i++) { length++; } int j = 0; for (int i = 0; i < length; i++) { if (str[i] == '0') { modstr[j] = '0'; j++; } else if (str[i] == '1') { modstr[i] = '1'; j++...
main.c: In function 'main': main.c:7:26: error: expected ')' before ';' token 7 | (scanf("%s", str); | ~ ^ | ) main.c:30:18: error: expected ';' before '}' token 30 | return 0; | ^ | ; 31 ...
s187189750
p04030
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); String s = input.nextLine(); Queue<String> q0 = new LinkedList<>(); Queue<String> q1 = new LinkedList<>(); for (int i = 0; i < s.length(); i++) { ...
Main.java:41: error: class, interface, enum, or record expected } ^ 1 error
s300939221
p04030
C++
#include <bits/stdc++.h> using namespace std; int main(){ string S,ans; cin >> S; for (int i=0; i<S.size(); i++){ if (S[i] == 0){ ans += 0; } else if(S[i] == 1){ ans += 1; } else if( ans.erase(i); ans.erase(i-1); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:11: error: ambiguous overload for 'operator+=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 9 | ans += 0; | ~~~~^~~~ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:...
s721910218
p04030
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.FileWriter; import java.io.PrintWriter; import java.nio.charset.StandardCharsets; import java.io.BufferedWriter; import java.io.FileReader; import java.io.File; import java.util.*; public class B { public static StringBuilder output = new S...
Main.java:11: error: class B is public, should be declared in a file named B.java public class B { ^ 1 error
s293355117
p04030
C
/* ex9_1 fmuacshai */ # include<stdio.h> #include<stdlib.h> # define SIZE 20 //stackの定義 typedef struct{ int size; int count; char string[SIZE]; char *top; } stack; //データの追加 void push(stack *stk,char character){ if(stk->count>=stk->size){ printf("Error"); }else{ stk->top--; ...
main.c: In function 'main': main.c:57:23: error: stray '`' in program 57 | for(i=0;input[i]!=`\0`;i++){ | ^ main.c:57:24: error: stray '\' in program 57 | for(i=0;input[i]!=`\0`;i++){ | ^ main.c:57:26: error: stray '`' in program 57 | for(i=0...
s980126063
p04030
C
/* ex9_1 takaoga */ #include<stdio.h> #include<stdlib.h> #define SIZE 10 typedef struct{ int size; int count; char data[SIZE]; char *top; } stack; void initialize_text(stack *text){ text->count = 0; text->size = SIZE; text->top = &(text->data[SIZE]); } void push(stack *text, char ...
main.c: In function 'push': main.c:23:52: error: 'x' undeclared (first use in this function) 23 | printf("Error: stack overflow. (x=%lf)¥n", x); | ^ main.c:23:52: note: each undeclared identifier is reported only once for each function it appears in ma...
s914601328
p04030
C
/* ex 9_1 hangan2020 */ #include <stdio.h> #include <stdlib.h> #define SIZE 11 typedef struct stack{ int size; int count; char data[SIZE]; char *top; } stack; void initialize_stack(stack *stk){ stk->count = 0; stk->size = SIZE; stk->top = &(stk->data[SIZE]); } void push(stack *stk, char elem...
main.c: In function 'pop': main.c:39:4: error: 'else' without a previous 'if' 39 | else{ | ^~~~
s797120489
p04030
C
/* ex 9_1 riverstone */ #include <stdio.h> #include <stdlib.h> //スタックに格納するデータの数 #define SIZE 20 //プロトタイプ宣言 typedef struct stack stack; void initialize_stack(stack *stk); void push(stack *stk, char elem); char pop(stack *stk); void print_stuck(stack *stk); //スタックの定義 typedef struct stack{ int size; int cou...
main.c: In function 'main': main.c:36:15: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] 36 | for(i=0;i<strlen(string);i++){ | ^~~~~~ main.c:6:1: note: include '<string.h>' or provide a declaration of 'strlen' 5 | #include <stdlib.h> +++ |+#include <s...
s229002942
p04030
C++
/* ex 9_1 series2 */ #include <stdio.h> #include <stdlib.h> #define SIZE 10 //条件 文字列を格納するスタックを定義、push,pop typedef struct stack { int size; int count; //現在格納されている文字数 char data[SIZE]; //データ内容そのもの char *top; //外部からのアクセス部はdata配列の一番後ろの番地のアドレスをさす } stack; void init_stack(stack *stk) { stk->count...
a.cc:52:22: error: extended character   is not valid in an identifier 52 | init_stack(&stk); //stackの初期化 | ^ a.cc: In function 'int main()': a.cc:52:22: error: '\U00003000' was not declared in this scope 52 | init_stack(&stk); //stackの初期化 | ^~ a.cc:54:...
s448115736
p04030
C
/* ex9_1 YSK722 */ #include <stdio.h> #include <stdlib.h> //スタックに格納するデータの最大数 #define SIZE 11 //スタックの定義 typedef struct stack{ int size; int count; char data[SIZE]; char *top; } stack; //スタックの初期化 void initialize_stack(stack *stk){ stk->count = 0; stk->size = SIZE; stk->top = &(stk->data[...
main.c: In function 'main': main.c:68:14: error: invalid type argument of '->' (have 'stack') 68 | ptr = stk->top; | ^~ main.c:69:15: error: invalid type argument of '->' (have 'stack') 69 | ptr += stk->count - 1; | ^~ main.c:70:24: error: invalid type argument of '-...
s692093458
p04030
C++
#include<iostream> using namespace std; int main() { string s1,s2; cin>>s1; for(int i=0;i<n;i++) { if(s1[i]=='0'||s[i]=='1') s2.push_back(s[i]); if(s[i]=='B'){ s2.pop_back(); i=i-1;} } cout<<s2[s2.length()-1]; }
a.cc: In function 'int main()': a.cc:7:17: error: 'n' was not declared in this scope 7 | for(int i=0;i<n;i++) | ^ a.cc:9:20: error: 's' was not declared in this scope 9 | if(s1[i]=='0'||s[i]=='1') | ^ a.cc:11:8: error: 's' was not declared in this scope 11...
s790279178
p04030
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String S = sc.next(); String ans = ""; for(int i=0; i<S.length(); i++){ String str = String.valueOf(S.charAt(i)); if(str.equals("0")){ ans += "0"; }else if(str.equa...
Main.java:17: error: cannot find symbol ans = ans.subStrings(0, ans.length()-1); ^ symbol: method subStrings(int,int) location: variable ans of type String 1 error
s149424397
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { vector<char> a; string s; cin >> s; for ( char c:s ) { if ( c=='B'&&asize() ) a.pop_back(); else a.push_back(c); } for ( char c:a ) { cout << c; } return 0; }
a.cc: In function 'int main()': a.cc:9:18: error: 'asize' was not declared in this scope; did you mean 'dysize'? 9 | if ( c=='B'&&asize() ) a.pop_back(); | ^~~~~ | dysize
s447220238
p04030
C++
#include <algorithm> #include <bitset> #include <tuple> #include <cstdint> #include <cstdio> #include <cctype> #include <assert.h> #include <stdlib.h> #include <stdio.h> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <fstream> #incl...
a.cc: In function 'int main()': a.cc:68:7: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::queue<long long int>') 68 | cout<<A<<endl; | ~~~~^~~ | | | | | std::queue<long long int> | std::ostream {aka std::basic_os...
s004118921
p04030
C++
#include <algorithm> #include <bitset> #include <tuple> #include <cstdint> #include <cstdio> #include <cctype> #include <assert.h> #include <stdlib.h> #include <stdio.h> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <fstream> #incl...
a.cc: In function 'int main()': a.cc:62:9: error: class template argument deduction failed: 62 | queue A; | ^ a.cc:62:9: error: no matching function for call to 'queue()' In file included from /usr/include/c++/14/queue:66, from a.cc:26: /usr/include/c++/14/bits/stl_queue.h:195:9: not...
s972397217
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string e = ""; for(int i = 0; i < s.size(); i++) { if(s[i] == '0') { e.emplace_back('0'); } else if(s[i] == '1') { e.emplace_back('1'); } else if (s[i] == 'B' && e.size() > 0) { e.pop_back();...
a.cc: In function 'int main()': a.cc:11:9: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'emplace_back' 11 | e.emplace_back('0'); | ^~~~~~~~~~~~ a.cc:14:9: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'emplace_ba...
s101178132
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string e = ""; for(int i = 0; i < s.size(); i++) { if(s[i] == '0') { e.push_back('0'); } else if(s[i] == '1') { e.emplace_back('1'); } else if (s[i] == 'B' && ans.size() > 0) { e.pop_back(); ...
a.cc: In function 'int main()': a.cc:14:9: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'emplace_back' 14 | e.emplace_back('1'); | ^~~~~~~~~~~~ a.cc:16:29: error: 'ans' was not declared in this scope; did you mean 'abs'? 16 | else if (s[i] == 'B' ...
s661424007
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; vector<char> v; for (char c : s) { switch (c) { case '0': v.push_back('0'); break; case '1': v.push_back('1'); break; ...
a.cc: In function 'int main()': a.cc:24:31: error: expected '}' at end of input 24 | for (char c : v) ans += c; | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s590858041
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { char s[1000000]; char v[1000000]; long long i=0; long long l=0; cin>>s; l=s.size(); for(i=0;i<l;i++) { if(s[i]=='0') { v.push('0'); l++; } else if(s[i]=='1') { v.push('1'); l++; } else if(s[i]=...
a.cc: In function 'int main()': a.cc:11:6: error: request for member 'size' in 's', which is of non-class type 'char [1000000]' 11 | l=s.size(); | ^~~~ a.cc:16:9: error: request for member 'push' in 'v', which is of non-class type 'char [1000000]' 16 | v.push('0'); | ^~~~ a.cc:21:9...
s480761173
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { char s[1000000]; char v[1000000]; long long i=0; long long l=0; cin>>s; l=s.size(); for(i=0;i<l;i++) { if(s[i]=='0') { v.push_back('0'); l++; } else if(s[i]=='1') { v.push_back('1'); l++; } els...
a.cc: In function 'int main()': a.cc:11:6: error: request for member 'size' in 's', which is of non-class type 'char [1000000]' 11 | l=s.size(); | ^~~~ a.cc:16:9: error: request for member 'push_back' in 'v', which is of non-class type 'char [1000000]' 16 | v.push_back('0'); | ^~~~...
s152289378
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { string s; int i=0; int l=0; while(cin>>s[i]) { l++; i++; } for(i=0;i<l;i++) { if(s[i]=="0") { s.push_back('0'); l++; } else if(s[i]=="1") { s.push_back('1'); l++; } else if(s[i]=...
a.cc: In function 'int main()': a.cc:18:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 18 | if(s[i]=="0") a.cc:23:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 23 | else if(s[i]=="1") a.cc:28:17: error: ISO C++ forbids comparison between...
s086663613
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { vector<string> s; int i=0; int l=0; while(cin>>s[i]) { l++; i++; } for(i=0;i<l;i++) { if(s[i]=="0") { s.push_back('0'); l++; } else if(s[i]=="1") { s.push_back('1'); l++; } else ...
a.cc: In function 'int main()': a.cc:20:18: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(char)' 20 | s.push_back('0'); | ~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:6...
s438213539
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { vector<string> s; int i=0; int l=0; while(cin>>s[i]) { l++; i++; } for(i=0;i<l;i++) { if(s[i]=="0") { s.push_back(0); l++; } else if(s[i]=="1") { s.push_back(1); l++; } else if(s...
a.cc: In function 'int main()': a.cc:25:18: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(int)' 25 | s.push_back(1); | ~~~~~~~~~~~^~~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, ...
s356967009
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { vector<string> s; int i=0; int l=0; while(cin>>s[i]) { l++; i++; } for(i=0;i<l;i++) { if(s[i]=='0') { s.push_back('0'); l++; } else if(s[i]=='1') { s.push_back('1'); l++; } else ...
a.cc: In function 'int main()': a.cc:18:12: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} and 'char') 18 | if(s[i]=='0') In file included fr...
s924843509
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { vector<int> s; int i=0; while(cin>>s[i]) { l++; i++; } int l=s.size(); for(i=0;i<l;i++) { if(s[i]==0) { s.push_back(0); } else if(s[i]==1) { s.push_back(1); } else if(s[i]=='B') { s.pop...
a.cc: In function 'int main()': a.cc:9:5: error: 'l' was not declared in this scope 9 | l++; | ^ a.cc:29:13: error: 'v' was not declared in this scope 29 | for(i=0;i<v.size();i++) | ^
s159493849
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { vector<int> s; int i; for(i=0;i!='\0';i++) { cin>>s[i]; } int l=s.size(); for(i=0;i<l;i++) { if(s[i]==0) { s.push_back(0); } else if(s[i]==1) { s.push_back(1); } else if(s[i]=='B') { s.pop_...
a.cc: In function 'int main()': a.cc:28:13: error: 'v' was not declared in this scope 28 | for(i=0;i<v.size();i++) | ^
s756588199
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { vector<int> s; for(i=0;i!='\0';i++) { cin>>s[i]; } int i; int l=s.size(); for(i=0;i<l;i++) { if(s[i]==0) { s.push_back(0); } else if(s[i]==1) { s.push_back(1); } else if(s[i]=='B') { s.pop_bac...
a.cc: In function 'int main()': a.cc:6:7: error: 'i' was not declared in this scope 6 | for(i=0;i!='\0';i++) | ^
s305942362
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { vector<int> s; cin>>s; int i; int l=s.size(); for(i=0;i<l;i++) { if(s[i]==0) { s.push_back(0); } else if(s[i]==1) { s.push_back(1); } else if(s[i]=='B') { s.pop_back(); } } return 0; }
a.cc: In function 'int main()': a.cc:6:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 6 | cin>>s; | ~~~^~~ | | | | | std::vector<int> | std::istream {aka std::basic_istream<char>} In file included...
s605846734
p04030
C++
#include <bits/stdc++.h> #define REP(i, n) for(i = 0; i < n ; i++){} #define REPN(i, n) for(i = n-1; i > -1 ; i--}{} #define MOD 1000000007 using namespace std; typedef unsigned int ll; typedef long long ull; int main() { #ifndef ONLINE_JUDGE freopen("input.txt"...
a.cc: In function 'int main()': a.cc:23:83: error: 'j' was not declared in this scope 23 | if(str[i-1]!='B'){for(int j = 1; j <= count; j++)str[i-j]!='B';i-=j;} | ^
s988122960
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { #include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ll long long #define ld long double #define pb push_back #define w(t) int t;cin>>t;while(t--) int solve() { ...
a.cc: In function 'int main()': a.cc:12:14: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 12 | int solve() | ^~ a.cc:12:14: note: remove parentheses to default-initialize a variable 12 | int solve() | ^~ | ...
s872675072
p04030
C++
#include<iostream> using namespace std; int main(){ string s,result=""; cin >> s; for(int i=0; i<s.length(); i++){ char c = s[i]; switch(c){ case '0': result += c; break; case '1': result += c; break; ...
a.cc: In function 'int main()': a.cc:23:27: error: expected ';' before '}' token 23 | cout << result << '\n' | ^ | ; 24 | } | ~
s596860055
p04030
C++
#include<iostream> using namespace std; int main(){ string s,result=""; cin >> s; for(int i=0; i<s.length(); i++){ char c = s[i]; switch(c){ case '0': result += c; break; case '1': result += c; break; ...
a.cc: In function 'int main()': a.cc:23:27: error: expected ';' before '}' token 23 | cout << result << '\n' | ^ | ; 24 | } | ~
s436327128
p04030
C++
#include<iostream> using namespace std; int main(){ string s,result=""; cin >> s; for(int i=0; i<s.length(); i++){ char c = s[i]; switch(c){ case '0': case '1': result += c; break; case 'B': if(result.length...
a.cc: In function 'int main()': a.cc:21:27: error: expected ';' before '}' token 21 | cout << result << '\n' | ^ | ; 22 | } | ~
s734786783
p04030
C++
#include<iostream> using namespace std; int main(){ string s,result=""; cin >> s; for(int i=0; i<s.length(); i++){ char c = s[i]; switch(c){ case '0': case '1': result += c; break; case 'B': if(result.length...
a.cc: In function 'int main()': a.cc:21:27: error: expected ';' before '}' token 21 | cout << result << '\n' | ^ | ; 22 | } | ~
s948713093
p04030
C++
#include<iostream> using namepace std; int main(){ string s, result =" "; cin >> s; for(int i = 0; i < s.length(); i++){ char c = s[i]; switch(c){ case'0': result += '0'; break; case'1': result += '1'; break; case'B': if(result.length() > 0){ ...
a.cc:2:7: error: expected nested-name-specifier before 'namepace' 2 | using namepace std; | ^~~~~~~~ a.cc: In function 'int main()': a.cc:4:3: error: 'string' was not declared in this scope 4 | string s, result =" "; | ^~~~~~ a.cc:4:3: note: suggested alternatives: In file included from /u...
s291633447
p04030
C++
#include <iostream> using namespace std; int main () { string A; string str; cin >> str; for (int i = 0; i < str.length(); i ++){ if (str[i] == '0'){ A[i] = '0'; } else if (str[i] == '1'){ A[i] = '1'; } else if (str[i] == 'B'){ A[i - 1] = ""; } cout << A; } }
a.cc: In function 'int main()': a.cc:14:18: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 14 | A[i - 1] = ""; | ^~ | | | const char*
s526033781
p04030
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll mod=1000000007; const int MAX_N = 1000; // n の最大値 // nCk を取得 double nCk(int n, int k) { double res=1.0; for(int i=0; i<n; i++){ res*=0.5;} for(int i=0; i<k; i++){ res*=(double)(n-i); res/=(double)(k-...
a.cc: In function 'int main()': a.cc:34:4: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 34 | ans-=q;}} | ~~~^~~
s151190326
p04030
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll mod=1000000007; const int MAX_N = 1000; // n の最大値 // nCk を取得 double nCk(int n, int k) { double res=1.0; for(int i=0; i<n; i++){ res*=0.5;} for(int i=0; i<k; i++){ res*=(double)(n-i); res/=(double)(k-...
a.cc: In function 'int main()': a.cc:34:4: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 34 | ans-=q;}} | ~~~^~~ a.cc: At global scope: a.cc:36:1: error: 'cout' does not name a type 36 | ...
s572388147
p04030
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; const ll mod=1000000007; const int MAX_N = 1000; // n の最大値 // nCk を取得 double nCk(int n, int k) { double res=1.0; for(int i=0; i<n; i++){ res*=0.5;} for(int i=0; i<k; i++){ res*=(double)(n-i); res/=(double)(k-...
a.cc: In function 'int main()': a.cc:32:4: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}) 32 | ans-=ans.at(ans.size()-1);}} | ~~~^~~~~~~~~~~~~~~~~~~~~~ a.cc: At glob...
s961260960
p04030
Java
import java.util.Scanner; public class UnhappyHacking { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scn = new Scanner(System.in); String s = scn.nextLine(); if (s.isEmpty()) { System.out.println(""); } else { String ans = ""; boolean check = true; for (int...
Main.java:3: error: class UnhappyHacking is public, should be declared in a file named UnhappyHacking.java public class UnhappyHacking { ^ 1 error
s796556945
p04030
C++
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using namespace std; const long long INF=1e9+5; const string alp="abcdefghijklmnopqrstuvwxyg"; //26 const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYG"; typedef long long ll; int main() { ...
a.cc: In function 'int main()': a.cc:23:13: error: 'class std::vector<char>' has no member named 'pop' 23 | vec.pop(); | ^~~
s242279824
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 if(T.size()!=0){ T.pop_back(); } } cout << T << endl;
a.cc: In function 'int main()': a.cc:18:21: error: expected '}' at end of input 18 | cout << T << endl; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s151542101
p04030
C++
#include<iostream> #include<algorithm> #include<cmath> #include<vector> #include<map> #include<set> #include<string> #include<queue> #include<stack> #include<iomanip> #define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); using namespace std; #define debug(x) cout<<(#x)<<"="<<(x)<<", "; #de...
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46, from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_ba...
s809117898
p04030
C++
#include <bits/stdc++.h> #include <math.h> #define rep(i,n) for (int i=0;i < (n); ++i) #define ALL(x) (x).begin(), (x).end() using namespace std; using ll = long long; int main() { stack<char> s; string S,ans=""; cin >> S; rep(i,S.size()){ if(S[i]=='B'&&ans.size()!=0){ ans.back() = ...
a.cc: In function 'int main()': a.cc:14:26: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive] 14 | ans.back() = ""; | ^~ | | | ...
s777786032
p04030
Java
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.nextLine(); String ans = ""; for (int i=0;i<str.length();i++) { char c = str.charAt(i); if (c=='0') ans = ans+'0'; else if (c=='1') ans = ans+'1';...
Main.java:2: error: class Solution is public, should be declared in a file named Solution.java public class Solution ^ Main.java:26: error: cannot find symbol System.out.print(res); ^ symbol: variable res location: class Solution 2 errors
s926176567
p04030
C++
#include <stdio.h> #include <cstring> char s[11]; char result[11]; int main() { scanf("%s",s); for (int i=0;i<strlen(s);i++) { char c = s[i]; if (c=='1') result[i] = '1'; else if (c=='0') result[i] = '0'; else i=max(0,i--); } printf("%s",result); } int max(int x, int y) { if (x>=y) return ...
a.cc: In function 'int main()': a.cc:18:27: error: 'max' was not declared in this scope 18 | i=max(0,i--); | ^~~ a.cc: In function 'int max(int, int)': a.cc:28:25: error: expected ';' before 'else' 28 | return x | ...
s920984339
p04030
C++
#include <stdio.h> #include <cstring> char s[11]; char result[11]; int main() { scanf("%s",s); for (int i=0;i<strlen(s);i++) { char c = s[i]; if (c=='1') result[i] = '1'; else if (c=='0') result[i] = '0'; else i=max(0,i--); } printf("%s",result);
a.cc: In function 'int main()': a.cc:18:27: error: 'max' was not declared in this scope 18 | i=max(0,i--); | ^~~ a.cc:21:29: error: expected '}' at end of input 21 | printf("%s",result); | ^ a.cc:6:1: note: to match ...
s481913449
p04030
C++
using namespace std; int main() { string input; vector<int> output(0); cin >> input; for (int i = 0; i < input.size(); i++) { switch (input.at(i)) { case '0': output.push_back(0); break; case '1': output.push_back(1); break; case 'B': if (output.empty()); else output.pop_back(); break; }...
a.cc: In function 'int main()': a.cc:6:9: error: 'string' was not declared in this scope 6 | string input; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | a.cc:7:9: error: 'vector'...
s040156307
p04030
C++
using namespace std; int main() { string input; vector<int> output(0); cin >> input; for (int i = 0; i < input.size(); i++) { switch (input.at(i)) { case '0': output.push_back(0); break; case '1': output.push_back(1); break; case 'B': output.pop_back(); break; } } for (int i : output) cout << i; ...
a.cc: In function 'int main()': a.cc:6:9: error: 'string' was not declared in this scope 6 | string input; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | a.cc:7:9: error: 'vector'...
s320686091
p04030
C++
#include<bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #define int long long void solve() { string s; cin >> s; for(char c: s) { if(c == 'B') { ans = ans.substr(0, ans.length()-1); } else { ans += c; } } cout << ans << endl; ...
a.cc: In function 'void solve()': a.cc:14:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 14 | ans = ans.substr(0, ans.length()-1); | ^~~ | abs a.cc:16:25: error: 'ans' was not declared in this scope; did you mea...
s556109393
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s,S; cin >> s ; for(int i=0;i<s.size();i++){ if(s.at(i) == '0'){ S = S + '0'; } else if(s,at(i) == '1'){ S = S + '1'; } else{ S.erase(S.size()--); } } cout << S << endl; }
a.cc: In function 'int main()': a.cc:13:15: error: 'at' was not declared in this scope 13 | else if(s,at(i) == '1'){ | ^~ a.cc:18:21: error: lvalue required as decrement operand 18 | S.erase(S.size()--); | ~~~~~~^~
s359834604
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s,S; cin >> s ; for(int i=0;i<s.size();i++){ if(s.at(i) == '0'){ S = S + '0'; } else if(s,at(i) == '1'){ S = S + '1'; } else{ S.erase(S.size()--) = ''; } } cout << S << endl; }
a.cc:18:29: error: empty character constant 18 | S.erase(S.size()--) = ''; | ^~ a.cc: In function 'int main()': a.cc:13:15: error: 'at' was not declared in this scope 13 | else if(s,at(i) == '1'){ | ^~ a.cc:18:21: error: lvalue required as decrement ...
s743794504
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s,S; cin >> s ; for(int i=0;i<s.size();i++){ if(s.at(i) == '0'){ S = S + '0'; } else if(s,at(i) == '1'){ S = S + '1'; } else{ S.at(S.size()--) = ''; } } cout << S << endl; }
a.cc:18:26: error: empty character constant 18 | S.at(S.size()--) = ''; | ^~ a.cc: In function 'int main()': a.cc:13:15: error: 'at' was not declared in this scope 13 | else if(s,at(i) == '1'){ | ^~ a.cc:18:18: error: lvalue required as decrement operan...
s175172774
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s,S; cin >> s ; for(int i=0;i<s.size();i++){ if(s.at(i) == '0'){ S = S + '0'; } else if(s,at(i) == '1'){ S = S + '1'; } else{ S.end() = ''; } } cout << S << endl; }
a.cc:18:17: error: empty character constant 18 | S.end() = ''; | ^~ a.cc: In function 'int main()': a.cc:13:15: error: 'at' was not declared in this scope 13 | else if(s,at(i) == '1'){ | ^~ a.cc:18:17: error: no match for 'operator=' (operand types are 'std::__c...
s940129592
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s,S; cin >> s ; for(int i=0;i<s.size();i++){ if(s.at(i) == '0'){ S = S + '0'; } else if(){ S = S + '1'; } else{ S.end() = ''; } } cout << S << endl; }
a.cc:18:17: error: empty character constant 18 | S.end() = ''; | ^~ a.cc: In function 'int main()': a.cc:13:13: error: expected primary-expression before ')' token 13 | else if(){ | ^ a.cc:18:17: error: no match for 'operator=' (operand types are 'std::__cxx11::ba...
s110353824
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s,S; cin >> s ; for(int i=0;i<s.size();i++){ if(s.at(i) == '0'){ S = S + '0'; } else if(){ S = S + '1'; } else{ S.end() == ''; } } cout << S << endl; }
a.cc:18:18: error: empty character constant 18 | S.end() == ''; | ^~ a.cc: In function 'int main()': a.cc:13:13: error: expected primary-expression before ')' token 13 | else if(){ | ^ a.cc:18:15: error: no match for 'operator==' (operand types are 'std::__cxx11:...
s843783478
p04030
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; vector<string>n; cin>>s; for(int i=1;i<=s.size();i++){ if(s[i]=='0'){ n.push_back('0'); } else if(s[i]=='1'){ n.push_back('1'); } else{ n.pop_back(); } } cout<<n<<endl; }
a.cc: In function 'int main()': a.cc:10:18: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(char)' 10 | n.push_back('0'); | ~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:6...
s288715847
p04030
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; vector<string>n; cin>>s; for(int i=1;i<=s.size();i++){ if(s[i]=='0'){ n.push_back("0"); } else if(s[i]=='1'){ n.push_back("1"); } else{ n.pop_back(); } } cout<<n<<endl; }
a.cc: In function 'int main()': a.cc:19:7: 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<<n<<endl; | ~~~~^~~ | | | | | std::vector<std::__cxx11::basic_string<char> >...
s380010075
p04030
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; vector<string>n; cin>>s; for(int i=1;i<=s.size();i++){ if(s[i]=='0'){ n.push_back(0); } else if(s[i]=='1'){ n.push_back(1); } else{ n.pop_back(); } } cout<<n<<endl; }
a.cc: In function 'int main()': a.cc:13:18: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(int)' 13 | n.push_back(1); | ~~~~~~~~~~~^~~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, ...
s061601204
p04030
C++
#include <bits/stdc++.h> using namespace std; int main(){ string A, B; cin >> A; for (int i=0; i<10; i++){ if (A.at(i)=='0'){ B+="0"; } else if(A.at(i)=='1'){ B+="1"; } else if(A.at(i)=='B'){ if (B=="0"){ continue; } else { B-=B.at(i-1); } ...
a.cc: In function 'int main()': a.cc:19:10: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}) 19 | B-=B.at(i-1); | ~^~~~~~~~~~~
s708836682
p04030
C
# include "stdio.h" int main(){ char s[11],a[11]; scanf("%s",s); int c=0; for(i=0;i<11;i++) a[i]='\0'; for(int i=0;i<10;i++){ if(s[i]!='B'){ a[c]=s[i]; c++; }else{ if(c!=0) c--; a[c]='\0'; } } printf("%s\n",a); ...
main.c: In function 'main': main.c:7:9: error: 'i' undeclared (first use in this function) 7 | for(i=0;i<11;i++) | ^ main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
s252994845
p04030
C++
#include<bits/stdc++.h> using namespace std; int main() { string a; cin>>a; for (int i=0;i<a.size();i++) { if(s[i]=='0') ans[i]='0'; else if(s[i]=='1') ans[i]='1'; else ans[i-1]=""; } for(i=0;i<s.size();i++) cout<<ans[i]; return 0; }
a.cc: In function 'int main()': a.cc:9:20: error: 's' was not declared in this scope 9 | if(s[i]=='0') | ^ a.cc:10:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 10 | ans[i]='0'; | ^~~ | ...
s117373247
p04030
C++
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(0); cin.tie(0); string s; cin >> s; string ans = ""; for (int i=0; i<s.length(); i++){ if (s[i] == '1'){ ans.push_back("1"); } else if (s[i] == '0'){ ans.push_back("0"); } else{ if (!s.e...
a.cc: In function 'int main()': a.cc:14:31: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 14 | ans.push_back("1"); | ^~~ | | | const char* In file included from /usr/inc...
s785475477
p04030
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string ans; for (int i = 0; i < s.size(); i++) { if (s[i] == '0') { ans.push_back('0'); } else if (s[i] == '1') { ans.push_back('1'); } else { if (ans.size != 0) { ans.pop_back(); } } } cout << ans << en...
a.cc: In function 'int main()': a.cc:19:33: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsig...
s125709569
p04030
C++
wakaranannda
a.cc:1:1: error: 'wakaranannda' does not name a type 1 | wakaranannda | ^~~~~~~~~~~~
s952561488
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)==B){ if(t!=""){ t.erace(-1); } }else{ t+=s.at(i); } } cout << t << endl; }
a.cc: In function 'int main()': a.cc:10:17: error: 'B' was not declared in this scope 10 | if(s.at(i)==B){ | ^ a.cc:12:11: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'erace'; did you mean 'erase'? 12 | t.erace(-1); | ^~...
s372370368
p04030
C++
#include<iostream> using namespace std; int main() { string commands; cin>>commands; string output=""; for(i=0;i<commands.length();i++) { if(commands[i]!='B') output.push_back(commands[i]); else output.pop_back(); } cout<<output; return 0; }
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<commands.length();i++) | ^
s424134204
p04030
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i=0;i<(n);i++) #define adrep(i,s,n) for (int i=(s);i<(n);i++) using namespace std; typedef long long ll; int main(){ string s; cin>>s; vector<int> v; rep(i,s.length()){ if(s[i]=='0')v.push_back(0); else if(s[i]=='1')v.push_back(1); else if...
a.cc: In function 'int main()': a.cc:22:7: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<int>') 22 | cout<<v<<endl; | ~~~~^~~ | | | | | std::vector<int> | std::ostream {aka std::basic_ostream<char>} In fi...
s007074849
p04030
C++
#include <iostream> //#include <string> using namespace std; int main() { char str[10] = {0}; cin >> str; uint32_t i = 0; while (1) { switch (str[i]) { case '\0': printf("%s\n", str); return 0; case 'B': if (i == 0) { memmove(&str[i], &str[i + 1], 9); } else { memmove(&str[i - 1],...
a.cc: In function 'int main()': a.cc:11:9: error: 'uint32_t' was not declared in this scope 11 | uint32_t i = 0; | ^~~~~~~~ a.cc:2:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 1 | #include <iostream> +++ |+#include <cstdint>...
s522567296
p04030
C++
int main(int argc, const char * argv[]) { string stmp, stmp2; //vector<string> vs; /* while(true) { //char input = getchar(); char input; cin.get(input); if(input == '0') { //vs.push_back("0"); stmp.push_back('0'); ...
a.cc: In function 'int main(int, const char**)': a.cc:3:5: error: 'string' was not declared in this scope 3 | string stmp, stmp2; | ^~~~~~ a.cc:29:5: error: 'cin' was not declared in this scope 29 | cin >> stmp; | ^~~ a.cc:29:12: error: 'stmp' was not declared in this scope 29 | ...
s017549039
p04030
C++
#include <bits/stdc++.h> #define fi first #define se second #define rep(i,n) for(int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = 1; i <= (n); ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) #define srep(i,s,t) for (int i = s; i < t; ++i) #define rng(a) a.begin(),a.end() #define rrng(a) a.rbegin(),a.rend()...
a.cc: In function 'int main()': a.cc:44:9: error: 'n' was not declared in this scope 44 | rep(i,n){ | ^ a.cc:4:38: note: in definition of macro 'rep' 4 | #define rep(i,n) for(int i = 0; i < (n); ++i) | ^
s771995905
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]; } b[n] = '\0'; cout << b; }
a.cc: In function 'int main()': a.cc:9:17: error: 'strlen' was not declared in this scope 9 | int s = strlen(a); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cst...