submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s499355949
p04001
C++
#include <bits/stdc++.h> using namespace std; int main() { int tmp,i,ans=0; long N;cin>>N; int sizN=to_string(N).size(); for(tmp=0;tmp<(1<<(sizN-1));tmp++){ bitset<9> s(tmp); long L=0,copyN=N;A int w=1; for(i=0;i<sizN-1;i++){ w*=10; if(s[i]){L+=copyN%w;copyN/=w;w=1;} } ans+=L...
a.cc: In function 'int main()': a.cc:9:22: error: 'A' was not declared in this scope 9 | long L=0,copyN=N;A | ^ a.cc:12:7: error: 'w' was not declared in this scope 12 | w*=10; | ^
s432520162
p04001
C++
#include <bits/stdc++.h> using namespace std; int main() { int tmp,i; int ans=0; int N; string sN=N.to_string(); cin>>N; for(tmp=0;tmp<(1<<(sN.size()-1));tmp++){ bitset<9> s(tmp); int L=0,w=1,NN=N; for(i=0;i<sN.size()-1;i++){ W*=10; if(s[i]){L+=NN%w;NN/=w;w=1;} } ans+=L; } c...
a.cc: In function 'int main()': a.cc:8:15: error: request for member 'to_string' in 'N', which is of non-class type 'int' 8 | string sN=N.to_string(); | ^~~~~~~~~ a.cc:14:6: error: 'W' was not declared in this scope 14 | W*=10; | ^
s178973650
p04001
C++
#include <bits/stdc++.h> using namespace std; int main() { long int S,ans=0; cin>>S; int N; for(int tmp=0;tmp<(1<<S.size()-1);tmp++){ bitset<10> sub(tmp); long int s=S; int i=0; ans+=s%10; N=1;s/=10; while(s){ if(sub.test(i))N*=10; else N=1; ans+=(s%10)*N; s/=10;...
a.cc: In function 'int main()': a.cc:8:27: error: request for member 'size' in 'S', which is of non-class type 'long int' 8 | for(int tmp=0;tmp<(1<<S.size()-1);tmp++){ | ^~~~
s159224838
p04001
C++
#include <bits/stdc++.h> using namespace std; int plus(string &S) { string num; int point = 0; for (int i = 1; i < S.size() - 1; i++) { num = ""; for (int j = 0; j < S.size(); j++) { if (j == i) { num.push_back("+"); } num.push_back(S.at(j)); } for (int j = 0; j < num.si...
a.cc: In function 'int plus(std::string&)': a.cc:11:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive] 11 | num.push_back("+"); | ^~~ | | | const char* In file included from /usr/include/c++/14/string:5...
s873456924
p04001
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int64_t ans = 0; for(bitset<9> tmp = 0; tmp < (1 << 9); tmp++){ int count = 0, sum = 0; for(int i = 0; i < 10; i++){ sum += (i + 1) * (int)pow(10, count); if(tmp.test(i)) count = 0; else c...
a.cc: In function 'int main()': a.cc:9:30: error: no match for 'operator<' (operand types are 'std::bitset<9>' and 'int') 9 | for(bitset<9> tmp = 0; tmp < (1 << 9); tmp++){ | ~~~ ^ ~~~~~~~~ | | | | | int ...
s130358537
p04001
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int n = s.length(); int[] a = new int[n]; for(int i = 0;i < n; i++) { a[i] = s.charAt(i) - '0'; } long ans = 0; for (int bit = 0; bit < 1 << (n-1); bit++){ long num = 0; ...
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s744031278
p04001
C++
#include <bits/stdc+;.h> using namespace std; int main(){ string s; cin>>s; int n=s.size(); vector<int> a(n); for(int i=0;i<n;i++){ a.at(i)=s.at(i); } }
a.cc:1:10: fatal error: bits/stdc+;.h: No such file or directory 1 | #include <bits/stdc+;.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s439868718
p04001
C++
#include <bits/stdc++.h> using namespace std; int64_t sum(int i, vector<int>A) { if(i==0) return A.at(0); int a=A.at(i); vector<int> B=A; B.at(i-1)=B.at(i-1)*10+a; return sum(i-1,A)+a*(int)pow(2,i-1)+sum(i-1,B); } int main() { string S; cin >> S; vector<int> A(S.size()); for(int i=0;i<S.size(),i...
a.cc: In function 'int main()': a.cc:17:29: error: expected ';' before ')' token 17 | for(int i=0;i<S.size(),i++) | ^ | ;
s245315531
p04001
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string s; cin >> s; int n = s.size(); ll ans = 0; for (int bit = 0; i < (1 << n-1); i++) { ll temp = 0; for (int i = 0; i < n; i++) { temp = temp * 10 + S.at(i) - '0'; if (bit & (1 << i)) { ans ...
a.cc: In function 'int main()': a.cc:12:21: error: 'i' was not declared in this scope 12 | for (int bit = 0; i < (1 << n-1); i++) { | ^ a.cc:15:26: error: 'S' was not declared in this scope 15 | temp = temp * 10 + S.at(i) - '0'; | ^
s656796087
p04001
C++
#include <bits/stdc++.h> using namespace std; int sum(string s, int n){ if(n == 0) return atoi(s.c_str()); if(s.length() <= n) return 0; if(s.length() == 2 && n == 1) return int(s.at(0) + s.at(1)); int total = 0; for(int i = 1; i < s.length(); i++){ int tmp = sum(s.substr(i), n-1); if(tmp != 0){ ...
a.cc: In function 'int sum(std::string, int)': a.cc:13:29: error: cannot convert 'std::__cxx11::basic_string<char>' to 'const char*' 13 | total += atoi(s.substr(0, i)) + sum(s.substr(i), n-1); | ~~~~~~~~^~~~~~ | | | s...
s965267091
p04001
C++
#include <bits/stdc++.h> using namespace std; int sum(string s, int n){ if(n == 0) return atoi(s); if(s.lenth() <= n) return 0; if(s.lenth() == 2 && n == 1) return int(s.at[0] + s.at[1]); int total = 0; for(int i = 1; i < s.length(); i++){ int tmp = sum(s.substr(i), n-1); if(tmp != 0){ total...
a.cc: In function 'int sum(std::string, int)': a.cc:5:26: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 5 | if(n == 0) return atoi(s); | ^ | | | std::string {aka std::__cxx1...
s804327260
p04001
C++
#include <bits/stdc++.h> #include <string> #include <iostream> using namespace std; int main(){ string s; cin>>s; int ans=0; for(int i=0;i<11;i++){ int y=stoi(s.substr(i)); ans=ans+y; } cout<<ans<<end;: }
a.cc: In function 'int main()': a.cc:13:12: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 13 | cout<<ans<<end;: | ~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstr...
s553842639
p04001
C++
#include <bits/stdc++.h> #include <string> #include <iostream> using namespace std; int main(){ string s; cin>>s; int ans=0; for(int i=0;i<11;i++){ int y=stoi(substr(i)); ans=ans+y; } cout<<ans<<end;: }
a.cc: In function 'int main()': a.cc:10:16: error: 'substr' was not declared in this scope; did you mean 'strstr'? 10 | int y=stoi(substr(i)); | ^~~~~~ | strstr a.cc:13:12: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved ov...
s924646524
p04001
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int ans=0; for(int i=0;i<11;i++){ int y=stoi(substr(i)); ans=ans+y; } cout<<ans<<end;: }
a.cc: In function 'int main()': a.cc:8:16: error: 'substr' was not declared in this scope; did you mean 'strstr'? 8 | int y=stoi(substr(i)); | ^~~~~~ | strstr a.cc:11:12: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved ove...
s233748915
p04001
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int ans=0; for(int i=0;i<11;i++){ int y=substr(i); ans=ans+stoi(y); } cout<<ans<<end;: }
a.cc: In function 'int main()': a.cc:8:11: error: 'substr' was not declared in this scope; did you mean 'strstr'? 8 | int y=substr(i); | ^~~~~~ | strstr a.cc:9:17: error: no matching function for call to 'stoi(int&)' 9 | ans=ans+stoi(y); | ~~~~^~~ In fil...
s902743318
p04001
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) string S; int dfs(int i, int sum) { if (i == n) return sum; return dfs(i + 1, sum) + dfs(i + 1, sum + S[i] - '0'); } int main() { cin >> S; cout << dfs(0, S[0] - '0') << endl; }
a.cc: In function 'int dfs(int, int)': a.cc:8:14: error: 'n' was not declared in this scope 8 | if (i == n) return sum; | ^
s440884619
p04001
C++
#include <bits/stdc++.h> #include <math.h> ////べき乗を使うのに必要 using namespace std; //int S の桁数を求める関数 dig int dig(int S) { int ans = 0; while (true) { S /= 10; ans++; if (S==0) break; } return ans; } //int S の左からx番目(x=0 始まり)の数字を求める関数 dig_at_i int dig_at_i(int S, int x) { int a = pow(10...
a.cc: In function 'int sumA(int, int)': a.cc:42:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 42 | ans += sumA(S, i); | ^~~ | abs a.cc:49:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 49 | int main() { | ^~ a...
s135336724
p04001
C++
#include <bits/stdc++.h> using namespace std; void sumA(long long S) { if (S<10) { return S; } return ((S-S%10)/10)+(S%10)+sumA(S); } int main() { long long S; cin >> S; cout << sumA(S)+S << endl; }
a.cc: In function 'void sumA(long long int)': a.cc:6:12: error: return-statement with a value, in function returning 'void' [-fpermissive] 6 | return S; | ^ a.cc:9:30: error: invalid operands of types 'long long int' and 'void' to binary 'operator+' 9 | return ((S-S%10)/10)+(S%10)+sumA(S)...
s889167465
p04001
C++
#include <iostream> #include <string> #include <bitset> using namespace std; int main() { string s; cin >> s; int n = s.size(); int b =0; for (int bit = 0; bit < (1 << n-1); ++bit){ bitset<10> a(bit); int t = 0; t += s.at(n - 1)-'0'; int c = 0; for (int i = 2; i <= n; i++) { if (a.test(i-2) == 1...
a.cc: In function 'int main()': a.cc:27:46: error: 'pow' was not declared in this scope 27 | t += (s.at(n-i)-'0')*pow(10, c); | ^~~
s186122598
p04001
C++
s = input() n = len(s) ans = 0 i = 1 def dfs(i, s, ans): if i==n: #print(i, 'bottom', s, ans) ans += sum([int(i) for i in s.split('+')]) return False, ans else: #print(i, 'left',s, ans) tf, ans = dfs(i+1, s, ans) if tf: return True, ans else: ...
a.cc:8:10: error: invalid preprocessing directive #print 8 | #print(i, 'bottom', s, ans) | ^~~~~ a.cc:12:10: error: invalid preprocessing directive #print 12 | #print(i, 'left',s, ans) | ^~~~~ a.cc:17:14: error: invalid preprocessing directive #print 17 | ...
s731193784
p04001
C++
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int n, ans = 0; n = (int)S.size(); for (int tmp = 0; tmp < (1 << 9); tmp++) { bitset<9> s(tmp); int start = 0; for (int i = 0; i < n; i++) { if (s.test(i)) { ...
a.cc: In function 'int main()': a.cc:21:31: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 21 | ans += atoi(c.c_str); | ...
s480661821
p04001
C++
program name implicit none character(10):: s integer(8):: bmax,i,ni,j,ans,nans integer(8),allocatable:: bit(:) read*, s bmax = 2**(len_trim(s)-1)-1 allocate(bit(len_trim(s)-1)) ans=0 do i=0,bmax ni=i do j=1,size(bit) bit(j) = and(ni,1) ni = rs...
a.cc:1:1: error: 'program' does not name a type 1 | program name | ^~~~~~~
s462801616
p04001
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0;i < (n);i++) using namespace std; int main(){ string s; cin >> s; int64_t ans = 0; int64_t tmp; for (int bit = 0; bit < (1<<(s.size()-1)); ++bit) { tmp = S[0] - '0'; for (int i = 0; i < s.size()-1; ++i) { if (bit&(1...
a.cc: In function 'int main()': a.cc:11:15: error: 'S' was not declared in this scope 11 | tmp = S[0] - '0'; | ^
s445863805
p04001
C
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; long int ans;ans=0; string mstr=""; int n=S.size(); for(int tmp=0;tmp<(1<<S.size()-1);tmp++){ bitset<10>g(tmp); for(int i=0;i<S.size()-1;i++){ //プラスなら、そこまでの文字列を加え、mstrメモ用のstringをリセット if(g.test(i)){ mstr+=S.at(...
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s489104101
p04001
C++
#include<bits/stdc++.h> #define REP(i, n) for(int i=0; i<n; i++) using namespace std; using ll = long long; int ctoi(char c){ if(c >= '0' && c <= '9'){ return c - '0'; } } ll fullsearch(int n, int(&a)[10]) { int ret = 0; for (int bit = 0; bit < (1<<n-1); ++bit) { ll sum = a[0]; ll tmp ...
a.cc: In function 'int main()': a.cc:39:9: error: 'N' was not declared in this scope 39 | N = S.length(); | ^ a.cc: In function 'int ctoi(char)': a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type] 10 | } | ^
s389424197
p04001
C++
#include<bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i,n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(),v.end() #define INF INT_MAX; typedef long long ll; using namespace std; int N; ll ans; void check_sum(string s,int x,vector<bool> &ope){ if(x==N-1){ ll sum=0; int f=0; for(int i=0;...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s910160256
p04001
C++
#include<bits/stdc++.h> #define _GLIBCXX_DEBUG #define rep(i,n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(),v.end() #define INF INT_MAX; typedef long long ll; using namespace std; int N; ll ans; void check_sum(string s,int x,vector<bool> &ope){ if(x==N-1){ ll sum=0; int f=0; for(int i=0;...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s076836257
p04001
C++
#include<bits/stdc++.h> using namespace std; int main(){ int S; cin>>S; long ans; int len=to_string(S).length; for(int i=0;i<(1<<len;i++){ int dig=1; for(int i=0;i<len;i++){ if(bit & (1<<i){ ans+=S/10*dig; dig=1; }else{ dig++; } } } // int n = 10;...
a.cc: In function 'int main()': a.cc:8:24: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int' 8 | ...
s591638026
p04001
C++
#include <iostream> #include <math.h> #include <string> #include <sstream> using namespace std; istringstream iss; int sum, num, c; string S; int summary(string s, int x){ //cout << s << " " << s.size() << " " << x << endl; if(x == s.size()){ iss = istringstream(s.substr(0,1)); iss >> num; ...
a.cc: In function 'int summary(std::string, int)': a.cc:43:1: warning: no return statement in function returning non-void [-Wreturn-type] 43 | } | ^ a.cc: In function 'int main()': a.cc:54:5: error: 'else' without a previous 'if' 54 | else if(S.size()==2){ | ^~~~
s777061052
p04001
C++
#include <bits/stdc++.h> using namespace std; char s[12345]; int main() { cin >> s; int n = s.size(); long long ans = 0; for(int t = 0; t < (1 << (n-1)); t++){ long long num = s[0]; for(int i = 0; i < n-1; i++){ if (t & (1 << i)) { ans = ans + num; num = 0; } num = nu...
a.cc: In function 'int main()': a.cc:7:13: error: request for member 'size' in 's', which is of non-class type 'char [12345]' 7 | int n = s.size(); | ^~~~
s757832139
p04001
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int calculate(string s) { int sum = 0; if (s.size()==1) return stoi(s); sum += stoi(s) + (int)(s.at(s.size()-1)); s.pop_back(); sum += calculate(s); return sum; } int main() { string s; cin >> s; cout << calculate(s) <<...
a.cc:19:1: error: expected declaration before '}' token 19 | } | ^
s345815325
p04001
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int calculate(string s) { int sum = 0; if (s.size()==1) return stoi(s); sum += stoi(s) + ctoi(s.at(s.size()-1)) + calculate(s.pop_back()); return sum; } int main() { string s; cin >> s; cout << calculate(s) << endl; } }
a.cc: In function 'int calculate(std::string)': a.cc:8:22: error: 'ctoi' was not declared in this scope; did you mean 'atoi'? 8 | sum += stoi(s) + ctoi(s.at(s.size()-1)) + calculate(s.pop_back()); | ^~~~ | atoi a.cc:8:67: error: invalid use of void expressio...
s691651305
p04001
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int calculate(string s) { int sum = 0; if (s.size()==1) return stoi(s); sum += stoi(s) + stoi(s.at(s.size()-1)) + calculate(s.pop_back()); return sum; } int main() { string s; cin >> s; cout << calculate(s) << endl; } }
a.cc: In function 'int calculate(std::string)': a.cc:8:26: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)' 8 | sum += stoi(s) + stoi(s.at(s.size()-1)) + calculate(s.pop_back()); | ~~~~^~~~~~~~~~~~~~~~~~ In file include...
s952383969
p04001
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int calculate(string s) { int sum = 0; if (s.size()==1) return atoi(s); sum += atoi(s) + atoi(s.at(s.size()-1)) + calculate(s.pop_back()); return sum; } int main() { string s; cin >> s; cout << calculate(s) << endl; } }
a.cc: In function 'int calculate(std::string)': a.cc:7:34: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 7 | if (s.size()==1) return atoi(s); | ^ | | | ...
s832200010
p04001
C++
#include <bits/stdc++.h> using namespace std; int main () { string S; cin >> S; int sum; string num; int count = 0 int N = S.size() - 1; for (int i = 0; i < (1 << N); i++) { bitset<N> s(i); for (int j = 0; j < S.size(); j++) { if (s.test(j) || j == N) { for (k = 0; k < count; k++) {...
a.cc: In function 'int main()': a.cc:10:3: error: expected ',' or ';' before 'int' 10 | int N = S.size() - 1; | ^~~ a.cc:11:29: error: 'N' was not declared in this scope 11 | for (int i = 0; i < (1 << N); i++) { | ^ a.cc:14:13: error: request for member 'test' in 's',...
s591340913
p04001
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string s; cin >> s; ll answer;//returnする int size = s.size()-1;//数列のサイズ-1 for (int tmp = 0; tmp < (1 << (size)); tmp++) {//+の分布を与える、右からi番目が1のときその後は+ ll c = s[0];//+が来るまでの入れ物 for (int i = 0; i < size; i++) {//+の分布に対して和を返す...
a.cc: In function 'int main()': a.cc:32:25: error: expected ';' before '}' token 32 | cout << answer << endl | ^ | ; 33 | } | ~
s978226589
p04001
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string s; cin >> s; ll answer;//returnする int size = s.size()-1;//数列のサイズ-1 for (int tmp = 0; tmp < (1 << (size)); tmp++) { bitset<size> plus(tmp);//+の分布を与えるbitset、右からi番目が1のときその後は+ ll c = s[0];//+が来るまでの入れ物 for (int i =...
a.cc: In function 'int main()': a.cc:11:16: error: the value of 'size' is not usable in a constant expression 11 | bitset<size> plus(tmp);//+の分布を与えるbitset、右からi番目が1のときその後は+ | ^ a.cc:9:7: note: 'int size' is not const 9 | int size = s.size()-1;//数列のサイズ-1 | ^~~~ a.cc:11:16: no...
s801405722
p04001
C++
#include <iostream> using namespace std; int main(){ int S; int a[10], k, b, c; cin >> S; for(int i=0;i<11;i++) { if(S%10!=0) { a[i] = S - S/10*10; S = S /10; } if(S%10==0) { a[i] = S; k = i - 1; } int l = 0; for(int bit=0;bit < (1 << k);++bit) { for(int j=0; j < k...
a.cc: In function 'int main()': a.cc:36:4: error: expected '}' at end of input 36 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s772306633
p04001
C++
#include <iostream> using namespace std; int main(){ int S; int a[10], k, b, c; cin >> S; for(int i=0;i<11;i++) { if(S%10!=0) { a[i] = S - S/10*10; S = S /10; } if(S%10==0) { a[i] = S; k = i - 1; } int l = 0; for(int bit=0;bit < (1 << k);++bit) { for(int j=0; j < k...
a.cc: In function 'int main()': a.cc:35:4: error: expected '}' at end of input 35 | } | ^ a.cc:8:25: note: to match this '{' 8 | for(int i=0;i<11;i++) { | ^ a.cc:35:4: error: expected '}' at end of input 35 | } | ^ a.cc:4:11: note: to match this '{' 4 ...
s616704516
p04001
C++
#include <iostream> using namespace std; int main(){ int S; int a[10], k, b, c; cin >> S; for(int i=0;i<11;i++) { if(S%10!=0) { a[i] = S - S/10*10; S = S /10; } if(S%10==0) { a[i] = S; k = i - 1; } int l = 0; for(int bit=0;bit < (1 << k);++bit) { for(int j=0; j < k...
a.cc: In function 'int main()': a.cc:29:16: error: expected ';' before ':' token 29 | ++l: | ^ | ; a.cc:35:4: error: expected '}' at end of input 35 | } | ^ a.cc:8:25: note: to match this '{' 8 | for(int i=0;i<11;i++) { | ...
s871467369
p04001
C++
#include <iostream> using namespace std; int main(){ int S; int a[10], k, b, c; cin >> S; for(i=0;i<11;i++) { if(S%10!=0) { a[i] = S - S/10*10; S = S /10; } if(S%10==0) { a[i] = S; k = i - 1; } int l = 0; for(int bit=0;bit < (1 << k);++bit) { for(int j=0; j < k; ++...
a.cc: In function 'int main()': a.cc:8:7: error: 'i' was not declared in this scope 8 | for(i=0;i<11;i++) { | ^ a.cc:29:16: error: expected ';' before ':' token 29 | ++l: | ^ | ; a.cc:35:4: error: expected '}' at end of input 35 | } |...
s075629741
p04001
C++
#include <bits/stdc++.h> using namespace std; string S; long long ans; void DFS(int a,string s,int b) { if (a != s.size()){ return (a + 1,s,b * 10 + int(s[a - 1] - 48)); return (a + 1,s,int(s[a - 1] - 48)); ans += b; } } int main() { cin >> S; DFS(1,S,0); cout << ans << endl; return 0; }
a.cc: In function 'void DFS(int, std::string, int)': a.cc:8:20: error: return-statement with a value, in function returning 'void' [-fpermissive] 8 | return (a + 1,s,b * 10 + int(s[a - 1] - 48)); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:9:20: error: return-statement with a value, in functio...
s566628210
p04001
C++
#include <bits/stdc++.h> using namespace std; string S; long long ans; void DFS(int a,string s,int b) { if (a != s.size()){ return (a + 1,s,b * 10 + int(s[i] - 48)); return (a + 1,s,int(s[i] - 48)); ans += b; } } int main() { cin >> S; DFS(1,S,0); cout << ans << endl; return 0; }
a.cc: In function 'void DFS(int, std::string, int)': a.cc:8:36: error: 'i' was not declared in this scope 8 | return (a + 1,s,b * 10 + int(s[i] - 48)); | ^
s448205288
p04001
C++
#include <iostream> #include <string> #include <vector> #include <stack> #include <queue> #include <deque> #include <algorithm> #include <bitset> #include <stdio.h> #include <math.h> #include <stdlib.h> #include <numeric> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld...
a.cc: In function 'int main()': a.cc:57:18: error: expected '}' at end of input 57 | return 0; | ^ a.cc:26:12: note: to match this '{' 26 | int main() { | ^
s475361634
p04001
C++
//#include <bits/stdc++.h> #include <vector> #include <iostream> #include<algorithm> #include<string> using namespace std; long long sum_plus(string s) { long long ans = 0; char* endptr; ans+= strtoll(s.c_str(), &endptr, 10); for (int i = 1; i < s.size(); i++) { string left = s.substr(0, i); ...
a.cc: In function 'long long int sum_plus(std::string)': a.cc:15:51: error: 'pow' was not declared in this scope 15 | ans += strtoll(left.c_str(), &endptr,10)*(pow(2,(s.size()-i-1))) + sum_plus(s.substr(i)); | ^~~
s907675474
p04001
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(int i = 0; i < (int)(n); i++) int main(){ string s; cin >> s; int n = s.size(); ll ans = 0; for(int bit = 0; bit < (1<<n-1); bit++){ ll t = s[0] - '0'; rep(i,n-1){ if(bit & (1 << i))...
a.cc: In function 'int main()': a.cc:21:17: error: expected ';' before '}' token 21 | ans += t | ^ | ; 22 | } | ~
s422935500
p04001
C++
#include <iostream> #include<vector> #include<algorithm> #include<string> #include<cmath> using namespace std; int main(){ string s; cin >> s; int ans=0; int a=s.size()-1; int r; for(int tmp=0;tmp<(1<<a);tmp++){ bitset<9> bit(tmp); r = s[0]-'0'; for(int i=0;i<a;i++){ ...
a.cc: In function 'int main()': a.cc:17:9: error: 'bitset' was not declared in this scope 17 | bitset<9> bit(tmp); | ^~~~~~ a.cc:6:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>' 5 | #include<cmath> +++ |+#include <bitset> ...
s568586062
p04001
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; string A; long long ans = 0; for(int i = 0; i < (1 << (s.size() - 1)); i++){ bitset<11> p(i); A = s[0] for(int j = 0; j < (s.size() - 1); j++){ if(p[j]){ ans += stoll(A); A = s[j + 1]; } ...
a.cc: In function 'int main()': a.cc:11:13: error: expected ';' before 'for' 11 | A = s[0] | ^ | ; 12 | for(int j = 0; j < (s.size() - 1); j++){ | ~~~ a.cc:12:20: error: 'j' was not declared in this scope 12 | for(int j = 0; j < (s.size() - 1); j+...
s808632229
p04001
C++
t
a.cc:1:1: error: 't' does not name a type 1 | t | ^
s839821951
p04001
C++
#include <bits/stdc++.h> using namespace std; int sum_from(string S, int start) { if(start == S.size() - 1) return S.at(start) - '0'; int sum = 0; for(int i = start; i < S.size(); i++) sum = sum * 10 + S.at(i) - '0'; return sum + sum_from(S, start + 1); int main() { string S; cin >> S; cout << su...
a.cc: In function 'int sum_from(std::string, int)': a.cc:12:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 12 | int main() | ^~ a.cc:12:9: note: remove parentheses to default-initialize a variable 12 | int main() | ^~ | -- a.cc...
s787687559
p04001
C++
#include <bits/stdc++.h> using namespace std; int sum_from(string S, int start) { if(S.at(start + 1) == '¥n') return S.at(start); return sum_from(S. start + 1) + S.at(start); } int main() { string S; cin >> S; cout << sum_from(S, 0) << endl; }
a.cc:6:25: warning: multi-character character constant [-Wmultichar] 6 | if(S.at(start + 1) == '¥n') | ^~~~ a.cc: In function 'int sum_from(std::string, int)': a.cc:8:22: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'start' 8 | return ...
s751026952
p04001
C++
#include<iostream> #include<math.h> #include<stdlib.h> #include<string> using namespace std; int main() { string s; cin >> s; long long sum = 0; int n = s.size(); for (int temp = 0; temp < (1 << n - 1); temp++) { long long t = s[0] - '0'; for (int i = 0; i < n - 1; i++) { if (temp & (1 << i)) { sum += ...
a.cc: In function 'int main()': a.cc:24:25: error: expected ';' before '}' token 24 | sum += t | ^ | ; 25 | } | ~
s383039944
p04001
C++
#include<iostream> #include<math.h> #include<string> using namespace std; int main() { string s; cin >> s; long long sum = 0; int n = s.size(); for (int temp = 0; temp < (1 << n - 1); temp++) { long long t = s[0] - '0'; for (int i = 0; i < n - 1; i++) { if (temp & (1 << i)) { sum += t; t = s[i + 1]...
a.cc: In function 'int main()': a.cc:23:25: error: expected ';' before '}' token 23 | sum += t | ^ | ; 24 | } | ~
s464940870
p04001
C++
#include<iostream> #include<string> using namespace std; int main(){ string S; cin >> S; int sum = 0; for (int i = 0; i < (1 << n-1); i++){ int t = S[0} - '0'; for (int j = 0; j < (n-1); j++){ if (i & (1 << j)){ sum += S[j] - '0'; t = S[j+1] - '0'; }else { t *= 10; ...
a.cc: In function 'int main()': a.cc:9:29: error: 'n' was not declared in this scope 9 | for (int i = 0; i < (1 << n-1); i++){ | ^ a.cc:10:16: error: expected ']' before '}' token 10 | int t = S[0} - '0'; | ^ | ] a.cc:10:16: error:...
s421095628
p04001
C++
s = input() ans = 0 def dfs(index, ret): if index == len(s) - 1: ret += s[index] ret2 = map(int, ret.split("+")) global ans ans += sum(ret2) return dfs(index + 1, ret + s[index]) or dfs(index + 1, ret + s[index] + "+") dfs(0, "") print(ans)
a.cc:1:1: error: 's' does not name a type 1 | s = input() | ^
s113349061
p04001
C++
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; long long sum = 0; string A // string B; for (int i = 0; i < (1 << (S.size()-1)); i++) { bitset<10> p(i); A = S.at(0); // B = ""; for (int j = 0; j<(S.size()-1); j++){ if(p.test(j)){ s...
a.cc: In function 'int main()': a.cc:12:3: error: expected initializer before 'for' 12 | for (int i = 0; i < (1 << (S.size()-1)); i++) { | ^~~ a.cc:12:19: error: 'i' was not declared in this scope 12 | for (int i = 0; i < (1 << (S.size()-1)); i++) { | ^
s780508818
p04001
C++
#include <iostream> #include <string> #include <bitset> #include <cmath> #include <algorithm> using namespace std; int main(void){ string str; long long sum = 0; cin >> str; // 各計算の式のプラスが入る場所を作る for(int tmp = 0; tmp < (1 << (str.size()-1)); tmp++){ bitset<10> s(tmp); string now...
a.cc:25:21: error: extended character   is not valid in an identifier 25 | int pos = 0; // 現在地、find()で現在見ている場所が変化するから。 | ^ a.cc: In function 'int main()': a.cc:25:21: error: '\U00003000' was not declared in this scope 25 | int pos = 0; // 現在地、find()で現在見ている場所が変化するから。 ...
s103001159
p04001
C++
#include<cstdio> #include<cmath> #include<algorithm> using namespace std; long long result; int len; char orin[100]; long long temp[100]; void dfs(int x, long long sum,int cnt) { if (x == len) { temp[cnt] = sum; for (int i = 1; i <= cnt; ++i) result += temp[i]; return; } temp[cnt] = sum; dfs(x + 1, or...
a.cc: In function 'int main()': a.cc:32:15: error: 'strlen' was not declared in this scope 32 | len = strlen(orin); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<algorithm> +++ |+#include <cst...
s920149313
p04001
C++
#include <bits/stdc++.h> using namespace std; int main(){ string N; cin >> N; s=N.size(); bitset<s> bita; for (int bit=0;bit<(1<<(s-1));++bit){ cout << bit<< endl; } }
a.cc: In function 'int main()': a.cc:7:3: error: 's' was not declared in this scope 7 | s=N.size(); | ^
s838444159
p04001
C++
#include<iostream> #include<string> using namespace std; typedef long long ll; vector<vector<ll>> fmr; int ln; const char* num; int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; } void addFmr(int cnt, vector<ll> f) { if (cnt >= ln) { fmr.push_back(f); return; } vector<ll> v = ...
a.cc:7:1: error: 'vector' does not name a type 7 | vector<vector<ll>> fmr; | ^~~~~~ a.cc:18:22: error: 'vector' has not been declared 18 | void addFmr(int cnt, vector<ll> f) { | ^~~~~~ a.cc:18:28: error: expected ',' or '...' before '<' token 18 | void addFmr(int cnt, vector<l...
s879194705
p04001
C++
#include<iostream> using namespace std; typedef long long ll; vector<vector<ll>> fmr; int ln; const char* num; int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; } void addFmr(int cnt, vector<ll> f) { if (cnt >= ln) { fmr.push_back(f); return; } vector<ll> v = f; int add = cto...
a.cc:6:1: error: 'vector' does not name a type 6 | vector<vector<ll>> fmr; | ^~~~~~ a.cc:17:22: error: 'vector' has not been declared 17 | void addFmr(int cnt, vector<ll> f) { | ^~~~~~ a.cc:17:28: error: expected ',' or '...' before '<' token 17 | void addFmr(int cnt, vector<l...
s298904618
p04001
C++
#include<bits/stdc++.h> #include <iostream> #include <string> #include <cmath> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i,a,b) for(ll i=(a);i<(b);i++) #define FORR(i,a,b)for(ll i=(a);i<=(b);i++) #define repR(i,n) for(ll i=n;i>=0;i--) #define all(v)(v).begin(),...
a.cc: In function 'int main()': a.cc:46:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 46 | ans+=k; | ^~~ | abs a.cc:56:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 56 | ans+=k; | ^~~ | abs a.cc:58:8: error: 'a...
s053042415
p04001
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int N=s.size(); int all_sum=0; for(int i=0;i<N;i++){ int a=stoll(s); int part_number=s[0]; if(N>1){ for(int tmp=0;tmp<(1<<N-1);tmp++){ bitset<9>cord(tmp); for(int i=0;i<N-1;i++){ if(cord.test(N-2-i)){ all_sum+=part_number; part_number=s[i+1]...
a.cc: In function 'int main()': a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s095221653
p04001
C++
#include <bits/stdc++.h> using namespace std; int main(){ char s[11]; scanf("%s",s); int i,j; long long ans=0; long long tmp; // ’+’で分割したものを代入 for(i=0;i<( 1 << ( strlen(s) - 1 ) );i++){ // S="125"なら、i=(00)_2~(11)_2まで。   // strlen(s) にすると、i=(111)_2...
a.cc:13:45: error: extended character   is not valid in an identifier 13 |   // strlen(s) にすると、i=(111)_2までになる。 | ^ a.cc:22:20: error: extended character   is not valid in an identifier 22 | ans += tmp; // 最後の分割部...
s437042650
p04001
C++
#include <bits/stdc++.h> using namespace std; int main(){ char s[11]; scanf("%s",s); int i,j; long long ans=0; long long tmp; // ’+’で分割したものを代入 for(i=0;i<( 1 << ( strlen(s) - 1 ) );i++){ // S="125"なら、i=(00)_2~(11)_2まで。   // strlen(s) にすると、i=(111)_2...
a.cc:13:45: error: extended character   is not valid in an identifier 13 |   // strlen(s) にすると、i=(111)_2までになる。 | ^ a.cc:22:20: error: extended character   is not valid in an identifier 22 | ans += tmp; // 最後の分割部...
s938039826
p04001
C++
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; long long sum=0; int n.s.size(); for(int temp=0;temp<(1<<n-1);temp++){ long long t=s[0]-'0'; for(int i=0;i<n-1;i++){ if(temp&(1<<i)){ sum+=t; t=s[i+1]-'0'; }else{ t*=10; t=s[i+1]-'0...
a.cc: In function 'int main()': a.cc:7:8: error: expected initializer before '.' token 7 | int n.s.size(); | ^ a.cc:8:27: error: 'n' was not declared in this scope 8 | for(int temp=0;temp<(1<<n-1);temp++){ | ^
s505883160
p04001
C++
#include <bits/stdc++.h> #define int long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; const int MOD = 1000000007; const int INF = numeric_limits<int>::max() / 2; signed main(){ ios::sync_with_stdio(false); cin.tie(nullptr); string S; cin >> S; int N = S.size(...
a.cc: In function 'int main()': a.cc:22:29: error: expected ';' before '}' token 22 | num = S[i+1] - '0' | ^ | ; 23 | } | ~
s211078345
p04001
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); ++i ) using namespace std; typedef long long ll; ll stoLL(string str){ int digits = str.length(); ll num = 0; for(const char c : str){ num += (c-48) * pow(10,digits-1); digits--; } return num; } ll splitandsum(string str){ string...
a.cc: In function 'int main()': a.cc:42:17: error: 'j' was not declared in this scope 42 | if(bit >> j & 1){ | ^
s876154284
p04001
C++
#include<bits/stdc++.h> #include <iostream> #include <string> #include <cmath> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i,a,b) for(ll i=(a);i<(b);i++) #define FORR(i,a,b)for(ll i=(a);i<=(b);i++) #define repR(i,n) for(ll i=n;i>=0;i--) #define all(v)(v).begin(),...
a.cc: In function 'int main()': a.cc:41:25: error: 'n' was not declared in this scope 41 | for(int bit=0;bit<(1<<n);bit++){ | ^
s601223083
p04001
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MM = 1000000000;ll mod = MM + 7; #define rep(i, n) for(ll i=0; i<n; i++) #define Rep(i, j, n) for(ll i=j; i<n; i++) #define all(vec) vec.begin(), vec.end() template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true;} return...
a.cc:28:2: error: stray '#' in program 28 | }#include <bits/stdc++.h> | ^ a.cc:55:2: error: stray '#' in program 55 | }#include <bits/stdc++.h> | ^ a.cc:28:3: error: 'include' does not name a type 28 | }#include <bits/stdc++.h> | ^~~~~~~ a.cc:30:32: error: redefinition of 'const ll MM' ...
s481126577
p04001
C++
#include <algorithm> #include <iostream> #include <set> #include <vector> typedef long long ll; #define _GLIBCXX_DEBUG #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) using namespace std; const ll INF = 1 << 30; const ll INFll = 1ll << 60; ll calc(string s) { ll d = 0; ll sum = 0; for (ll i = 0; i < s.size();...
a.cc:43:1: error: '::main' must return 'int' 43 | ll main() { | ^~
s818179844
p04001
C++
#include <algorithm> #include <iostream> #include <set> #include <vector> typedef long long ll; #define _GLIBCXX_DEBUG #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) using namespace std; const int INF = 1 << 30; const ll INFll = 1ll << 60; int calc(string s) { int d = 0; int sum = 0; for (int i = 0; i < s.si...
a.cc: In function 'int main()': a.cc:53:12: error: expected '}' at end of input 53 | return 0; | ^ a.cc:44:12: note: to match this '{' 44 | int main() { | ^
s397900648
p04001
C++
#include <iostream> #include <string> using namespace std; int main(void) { string S; cin >> S; unsigned int len = S.length(); unsigned int bitmax = (unsigned int)pow(2, len-1); long long ans = 0; for (unsigned int i = 0; i <= (bitmax-1); i++) { bool plus_pos[10] = {false}; for (int j = 0; j < 9; j++) { ...
a.cc: In function 'int main()': a.cc:11:45: error: 'pow' was not declared in this scope 11 | unsigned int bitmax = (unsigned int)pow(2, len-1); | ^~~
s883003686
p04001
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++) #define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(),(a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int,int> #define priq...
a.cc: In function 'int main()': a.cc:26:11: error: 'null' was not declared in this scope 26 | X=null; | ^~~~
s519187004
p04001
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++) #define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(),(a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int,int> #define priq...
a.cc: In function 'int main()': a.cc:21:25: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)' 21 | string X=(string)S[0]; | ^ In file included from /usr/include/c++/14/string:5...
s377968558
p04001
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++) #define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(),(a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int,int> #define priq...
a.cc: In function 'int main()': a.cc:21:17: 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 21 | string X=S[0]; | ^
s261774751
p04001
C++
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; long ans = 0; long n = s.length(); for (int bit = 0; bit < (1 << n - 1); bit++) { string save = s[0]; for(int i = 0; i < n - 1; i++) { if (bit & (1 << i)) { ans += stoll(save); save = s[i+1]; } ...
a.cc: In function 'int main()': a.cc:10:22: 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 10 | string save = s[0]; | ^
s186582512
p04001
C++
#include<bits/stdc++.h> using namespace std ; long int keisan(bitset<9> pl){ } int main(){ string s ; cin >> s ; long int str = stoli(s) ; long int sum = 0 ; for(int i=0;i<(1<<s.size())){ bitset<9> pl(i) ; } }
a.cc: In function 'long int keisan(std::bitset<9>)': a.cc:5:1: warning: no return statement in function returning non-void [-Wreturn-type] 5 | } | ^ a.cc: In function 'int main()': a.cc:9:18: error: 'stoli' was not declared in this scope 9 | long int str = stoli(s) ; | ^~~~~ a.cc:...
s742516326
p04001
C++
#include <bits/stdc++.h> using namespace std; int S; int main() { cin >> S; int l = S.size(); int sum = 0; for (int tmp = 0; tmp < (1 << l - 1); tmp++) { int t = S.at(l - 1); for (int i = 0; i < l ; i++) { if ((tmp << i) & 1) { sum += t; } else { t *= 10; } }...
a.cc: In function 'int main()': a.cc:7:13: error: request for member 'size' in 'S', which is of non-class type 'int' 7 | int l = S.size(); | ^~~~ a.cc:10:15: error: request for member 'at' in 'S', which is of non-class type 'int' 10 | int t = S.at(l - 1); | ^~
s154745554
p04001
C++
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int sum = 0; for (int tmp = 0; tmp (1 << S.size() - 1); tmp++) { bitset<S.size() - 1> s(tmp); int sum_tmp = 0; for (int i = 0; i < S.size() - 1; i++) { if (s.set(i) == 1) { sum_tmp += 10*S.at(i); } ...
a.cc: In function 'int main()': a.cc:8:25: error: 'tmp' cannot be used as a function 8 | for (int tmp = 0; tmp (1 << S.size() - 1); tmp++) { | ~~~~^~~~~~~~~~~~~~~~~~~ a.cc:9:18: error: call to non-'constexpr' function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::_...
s193993221
p04001
C++
s = input() n = len(s) - 1 answers = [] sl = [s[i] for i in range(len(s))] for i in range(2 ** n): tmp = [] for j in range(n): if ((i >> j) & 1): tmp.append(j) ll = ['*']*len(s) for k in tmp: ll[k] = '+' ans = [] for k, _ in zip(sl, ll): ans.append(k) ...
a.cc:18:11: error: empty character constant 18 | ans = ''.join(ans) | ^~ a.cc:1:1: error: 's' does not name a type 1 | s = input() | ^
s913260823
p04001
C
/* submission # - User: herp_sy https://atcoder.jp/contests/ coding: utf-8 lang: C (GCC 5.4.1) */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <stdbool.h> #define _CRT_SECURE_NO_WARNINGS #define TLong long long #define TBMod 1000000007 TLong getSum(TLong n,TLong i,TLong ...
main.c: In function 'main': main.c:29:24: error: implicit declaration of function 'sum' [-Wimplicit-function-declaration] 29 | printf("%lld", sum(n, 10, 0)); | ^~~
s025874637
p04001
C
/* submission # - User: herp_sy https://atcoder.jp/contests/ coding: utf-8 lang: C (GCC 5.4.1) */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <stdbool.h> #define _CRT_SECURE_NO_WARNINGS #define TLong long long #define TBMod 1000000007 TLong sum(TLong n,TLong i,TLong sum...
main.c: In function 'sum': main.c:22:16: error: called object 'sum' is not a function or function pointer 22 | return sum(n / i, 10, sum + n % i) + sum(n, i * 10, sum); | ^~~ main.c:19:33: note: declared here 19 | TLong sum(TLong n,TLong i,TLong sum) | ...
s105637606
p04001
C
/* submission # - User: herp_sy https://atcoder.jp/contests/ coding: utf-8 lang: C (GCC 5.4.1) */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <stdbool.h> #define _CRT_SECURE_NO_WARNINGS #define TLong long long #define TBMod 1000000007 TLong sum(TLong n,TLong i,TLong sum...
main.c: In function 'sum': main.c:22:16: error: called object 'sum' is not a function or function pointer 22 | return sum(n / i, 10, sum + n % i) + cal_sum(n, i * 10, sum); | ^~~ main.c:19:33: note: declared here 19 | TLong sum(TLong n,TLong i,TLong sum) | ...
s870559726
p04001
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { var S = Console.ReadLine(); Console.WriteLine(Plus(S,0)); } ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s877802159
p04001
C++
#include <iostream> #include<vector> #include<algorithm> #include <queue> #include <string> #include <set> #include <bitset> using namespace std; #define ff(i,n,m) for(int i=n;i<m;i++) #define i64 int64_t #define tos(x) to_string(x) int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; } in...
a.cc: In function 'int main()': a.cc:41:42: error: 'pow' was not declared in this scope 41 | ans += a.at(j) * pow(10, x); | ^~~
s393283917
p04001
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String S = scanner.nextLine(); scanner.close(); int length = S.length(); long total = 0; // bit全探索 // 集合 (1, 2, 3) の部分集合(1, 12,...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s969658483
p04001
C++
include<bits/stdc++.h> using namespace std; using ll =long long; #define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i) #define rep(i,n) REP(i,0,n) #define SORT(i) sort((i).begin(),(i).end()) constexpr int INF = 2000000000; constexpr int mod = 1000000007; int main() { string s; cin >> s; ll ans = 0; rep(bit, (1 << (...
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:11:9: error: 'string' was not declared in this scope 11 | string s; cin >> s; | ^~~~~~ a.cc:11:19: error: 'cin' was not declared in this scope 11 | stri...
s449312351
p04001
C++
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String s = scan.next(); long n = Long.valueOf(s); System.out.println(dfs(n,1,0)); } static long dfs(long n, int m, long sum) {//mは何桁目まで調べたか if(NumberOfDigit(n) == m) { return...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:15: error: expected ':' before 'static' 4 | public static void main(String[] args) { | ^~~~~~~ | : ...
s481349920
p04001
C++
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); String s = scan.next(); long n = Long.valueOf(s); System.out.println(dfs(n,1,0)); } static long dfs(long n, int m, long sum) {//mは何桁目まで調べたか if(NumberOfDigit(n) == m) { ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main{ | ^~~~~~
s986786091
p04001
C++
#include <bits/stdc++.h> using namespace std; long long ManyFormula(long long S, long long head, long long cnt){ long long sum = 0; if(cnt == 1){ return 0; } else{ for(long long i=1; i < cnt; i++){ long long cnt_next=0; long long S_next = S % (long long)pow(10...
cc1plus: error: '::main' must return 'int'
s016756919
p04001
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const double EPS = 1e-9; typedef vector<int> vint; typedef pair<int, int> pint; #define rep(i, n) REP(i, 0, n) #define ALL(v) v.begin(), v.end() #define MSG(a) cout << #a << " " << a << endl; #define REP(i, x, n) for(int i = x; i < n; i++) int main()...
a.cc: In function 'int main()': a.cc:20:11: error: 's2' was not declared in this scope; did you mean 's'? 20 | s2=s; | ^~ | s
s692034766
p04001
C++
S = int(input()) numbers = str(S) L = len(numbers) prev = 0 for bit in range(1<<L-1): now = int(numbers[0]) for i in range(L-1): if bit & (1<<i): prev += now now = int(numbers[i+1]) else: now = now * 10 + int(numbers[i+1]) prev += now print(prev)
a.cc:1:1: error: 'S' does not name a type 1 | S = int(input()) | ^
s270172362
p04001
C++
#include "stdafx.h" #include <iostream> #include <string> #include <vector> #include <algorithm> //#include <bits/stdc++.h> using namespace std; // +を入れるか入れないかを分岐させて再帰する関数 void ReFunc(vector<int> vec, int place, int left, int right, long long &sum) { // 最後まで終わったら算出する。 if (place == vec.size() - 1) { ...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s347796490
p04001
C++
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <algorithm> #include <functional> #include <iomanip> #include <stdlib.h> #include <string.h> #include <cstring> #include <cmath> #include <map> #include <queue> #include <deque> #include <stack> #include <set> #include <stdio.h> #include...
a.cc:116:1: error: expected declaration before '}' token 116 | } | ^ a.cc:118:8: error: redefinition of 'int main()' 118 | signed main() { | ^~~~ a.cc:104:8: note: 'int main()' previously defined here 104 | signed main() { | ^~~~
s978874598
p04001
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) typedef long long ll; using vi=vector<int>; using vvi=vector<vector<int>>; void chmin(int a,int b){if(b<a)a=b;} void chmax(int a,int b){if(a<b)a=b;} int ans,n; int a[11]; void dfs(int i,int sum,int s){ ans+...
a.cc: In function 'int main()': a.cc:24:5: error: 'sum' was not declared in this scope 24 | sum+=d%10; | ^~~ a.cc:28:7: error: 'sum' was not declared in this scope 28 | ans=sum; | ^~~
s876258278
p04001
C++
#include <stdio.h> #include <string> #include <bits/stdc++.h> using namespace std; int sum(string S) { int a,b; a = S.size(); if (a >= 2){ for (int i=0; i<a-1; ++i) { string c = S.substr(0,i+1); int d; sscanf(c.c_str(),"%d",&d); b += d+sum(S.substr(i+1)); } } else if (S == "1"...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s445148989
p04001
C++
#include <bits/stdc++.h> #include <stdio.h> #include <string> using namespace std; int sum(string S) { int a,b; a = S.size(); if (a >= 2){ for (int i=0; i<a-1; ++i) { string c = S.substr(0,i+1); int d = atoi(c.c_str()); b += d+sum(S.substr(i+1)); } } else if (S == "1") { b = 1; ...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s182672373
p04001
C++
#include <bits/stdc++.h> using namespace std; int sum(string S) { int a,b; a = S.size(); if (a >= 2){ for (int i=0; i<a-1; ++i) { string c = S.substr(0,i+1); int d = atoi(c.c_str()); b += d+sum(S.substr(i+1)); } } else if (S == "1") { b = 1; } else if (S == "2") { b = 2;...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s581913508
p04001
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int n = s.size(); long long ans = 0; for(int bit = 0; i < (1 << n-1); bit++){ int l = 0; for(int r = 0; r < n; r++){ if(r == n-1){ ans += stoll(s.substr(l, r-l+1)); ...
a.cc: In function 'int main()': a.cc:10:22: error: 'i' was not declared in this scope 10 | for(int bit = 0; i < (1 << n-1); bit++){ | ^