submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s480360850 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
string s;
long long bt(int x, long long sum) {
if (x == s.size())
return sum;
long long ret = 0;
for (int i = x + 1; i <= s.size(); i++)
ret += bt(i, stoll(s.substr(x, i - x)) + sum);
return ret;
}
int main() {
cin >> s;
cout << bt(0, 0) << "\n;
return 0;
... | a.cc:18:29: warning: missing terminating " character
18 | cout << bt(0, 0) << "\n;
| ^
a.cc:18:29: error: missing terminating " character
18 | cout << bt(0, 0) << "\n;
| ^~~~
a.cc: In function 'int main()':
a.cc:19:9: error: expec... |
s699311302 | p04001 | C++ | #include<iostream>
#include<string>
#include<cstdio>
using namespace std;
typedef long long ll;
int main(){
char s[12345];
scanf("%s", s);
int len = strlen(s);
ll ans = 0;
// 2^(len-1) 回す
for(int t = 0; t < (1<<(len-1)); t++){
ll num = s[0] - '0'; //先頭の文字を数字に変換
for(int i=0;i<l... | a.cc: In function 'int main()':
a.cc:11:15: error: 'strlen' was not declared in this scope
11 | int len = strlen(s);
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<cstdio>
+++ |+#include <cstring>
... |
s714658524 | p04001 | C++ | どこで間違えてるか分からない
#include <bits/stdc++.h>
#include <algorithm>
#include <math.h>
#include <queue>
#include <cstdio>
using namespace std;
template <class T> using V = vector<T>;
template <class S, class T> using P = pair<S, T>;
template <class... T> using TP = tuple<T...>;
using ll = long long;
using db = double;
using ... | a.cc:1:1: error: '\U00003069\U00003053\U00003067\U00009593\U00009055\U00003048\U00003066\U0000308b\U0000304b\U00005206\U0000304b\U00003089\U0000306a\U00003044' does not name a type
1 | どこで間違えてるか分からない
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
... |
s729863185 | p04001 | C++ | +の入った文字列が作れない
#include <bits/stdc++.h>
#include <algorithm>
#include <math.h>
#include <queue>
#include <cstdio>
using namespace std;
template <class T> using V = vector<T>;
template <class S, class T> using P = pair<S, T>;
template <class... T> using TP = tuple<T...>;
using ll = long long;
using db = double;
using l... | a.cc:1:1: error: expected unqualified-id before '+' token
1 | +の入った文字列が作れない
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/... |
s971518879 | p04001 | C++ | s = ""
def rec(i, word):
if i == len(s):
return eval("".join(word))
ans = 0
word.append('+')
word.append(s[i])
ans += rec(i+1, word)
word.pop()
word.pop()
word.append(s[i])
ans += rec(i+1, word)
word.pop()
return ans
def main():
global s
s = input()
prin... | a.cc:22:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
22 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:1:1: error: 's' does not name a type
1 | s = ""
| ^
|
s003214124 | p04001 | C++ |
//In The Name Of GOD
#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
const int mod = 1000000007;
const int inf = 2000000000;
const int maxn = 500*1000+500*1000+15;
const int MLOG = 18;
#define pb push_back
#define pp pop_back
#define X first
#define Y second
#define IO ios_base::sync_with_s... | a.cc: In function 'int main()':
a.cc:93:12: error: no matching function for call to 'reverse(<unresolved overloaded function type>, std::__cxx11::basic_string<char>::iterator)'
93 | reverse(s.begin, s.end());
| ~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
... |
s775164062 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string ST; cin >> ST;
vector<int> S;
int n = ST.sinze();
long long ans;
for(int i=0; i<n; i++){
S[i]= ST[i] - '0';
}
for(int bit=0; bit < (1 << n-1) ; bit++){
int jud = S[0];
for(int i=0; i<n-1; i++){
if(bit & (1 << i)){
... | a.cc: In function 'int main()':
a.cc:7:14: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sinze'; did you mean 'size'?
7 | int n = ST.sinze();
| ^~~~~
| size
a.cc:27:10: error: 'jud' was not declared in this scope
27 | ans += jud... |
s939137231 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int search(int s){
int count=0;
while (s!=0){
count++;
s /= 10;
}
return count;
}
int mult(int i,int s){
int count=search(s),x=1;
int ans=i*pow(10,count);
if (count>1){
for (int j=1;j<=pow(2,count-1);j*2){
ans += i*pow(10,count-x);
x-... | a.cc: In function 'int sum(int, int)':
a.cc:37:65: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
37 | return i*pow(2,count) + mult(i,s) +2*sum(s/pow(10,count-1),s%pow(10,count-1));
| ... |
s172283909 | p04001 | C++ | #include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(void){
string S;
string adding_S;
cin >> S;
int size = S.length();
int i,j;
int sum;
for(i=0;i<size;i++){
sum = sum + int(S[i]-'0');
adding_S = adding_S + S[i];
if(i==0) sum = s... | a.cc: In function 'int main()':
a.cc:18:42: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
18 | if(i==0) sum = sum + int(adding_S - '0');
| ~~~~~~~~ ^ ~~~
| | ... |
s264914198 | p04001 | C++ | #include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(void){
string S;
string adding_S;
cin >> S;
int size = S.length();
int i,j;
int sum;
for(i=0;i<size;i++){
sum = sum + int(S[i]-'0');
adding_S = adding_S + c;
sum = sum + stoi(a... | a.cc: In function 'int main()':
a.cc:17:31: error: 'c' was not declared in this scope
17 | adding_S = adding_S + c;
| ^
|
s068076453 | p04001 | C++ | #include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(void){
string S;
string adding_S;
cin >> S;
int size = S.length();
int i,j;
int sum;
for(i=0;i<size;i++){
char c= S[i];
sum = sum + stoi(c);
adding_S = adding_S + c;
sum... | a.cc: In function 'int main()':
a.cc:17:25: error: no matching function for call to 'stoi(char&)'
17 | sum = sum + stoi(c);
| ~~~~^~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/i... |
s854146302 | p04001 | C++ | #include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(void){
string S;
string adding_S;
cin >> S;
int size = S.length();
int i,j;
int sum;
for(i=0;i<size;i++){
sum = sum + stoi(S[i]);
adding_S = adding_S + S[i];
sum = sum + sto... | a.cc: In function 'int main()':
a.cc:16:25: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
16 | sum = sum + stoi(S[i]);
| ~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/in... |
s720177577 | p04001 | C++ | #include<iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(void){
string S;
string adding_S;
char* Sp=&S;
cin >> S;
int size = S.length();
int i,j;
int sum;
for(i=0;i<size;i++){
sum = sum + stoi(S[i]);
adding_S = adding_S + S[i];
... | a.cc:9:3: error: extended character is not valid in an identifier
9 | char* Sp=&S;
| ^
a.cc: In function 'int main()':
a.cc:9:3: error: '\U00003000char' was not declared in this scope
9 | char* Sp=&S;
| ^~~~~~
a.cc:9:11: error: 'Sp' was not declared in this scope; did you mean 'S'?
9... |
s852480020 | p04001 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(void){
string S;
string adding_S;
cin >> S;
int size = S.length();
int i,j;
int sum;
for(i=0;i<size;i++){
sum = sum + stoi(S[i]);
adding_S = adding_S + S[i];
sum = sum + stoi(adding_S);
... | a.cc: In function 'int main()':
a.cc:15:25: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
15 | sum = sum + stoi(S[i]);
| ~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/in... |
s367913183 | p04001 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(void){
string S;
string adding_S;
cin >> S;
int size = S.length();
int i,j;
int sum;
for(i=0;i<size;i++){
sum = sum + atoi(S[i].c_str());
adding_S = adding_S + S[i];
sum = sum + atoi(adding_S... | a.cc: In function 'int main()':
a.cc:15:31: error: request for member 'c_str' in 'S.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
15 | sum = sum + ato... |
s298378657 | p04001 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(void){
string S;
string adding_S;
cin >> S;
int size = S.length();
int i,j;
int sum;
for(i=0;i<size;i++){
sum = sum + atoi(S[i]);
adding_S = adding_S + S[i];
sum = sum + atoi(adding_S);
... | a.cc: In function 'int main()':
a.cc:15:25: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
15 | sum = sum + atoi(S[i]);
| ~~~~^~~~~~
| |
| ... |
s370337422 | p04001 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(void){
string S;
string adding_S;
cin >> S;
int size = S.length;
int i,j;
int sum;
for(i=0;i<size;i++){
sum = sum + atoi(S[i]);
adding_S = adding_S + S[i];
sum = sum + atoi(adding_S);
... | a.cc: In function 'int main()':
a.cc:10:18: 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'
10 |... |
s898991317 | p04001 | C++ | #include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;
void ARC060C()
{
int N, A;
cin >> N >> A;
vector<int> vals(N);
for (auto& x : vals)
{
cin >>... | a.cc: In function 'int main()':
a.cc:52:9: error: 'ARC061C' was not declared in this scope; did you mean 'ARC060C'?
52 | ARC061C();
| ^~~~~~~
| ARC060C
|
s297189419 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin>>S;
if(S.size()==1){
int n = stoi(S);
cout<<n;
}
else{
vector<string> op;
op = {"","+"};
vector<string> score(pow(2,S.size()-1));
for(int i;i<S.size();i++){
for(int j=0;j<2;j++){
if(i<S.size()-1){
scor... | a.cc: In function 'int main()':
a.cc:19:13: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::at()'
19 | score.at()+=S.at(i)+op.at(j);
| ~~~~~~~~^~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
... |
s082107356 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin>>S;
if(S.size()==1){
int n = stoi(S);
cout<<n;
}
else{
vector<string> op;
op = {"","+"};
vector<string> score();
for(int i;i<S.size();i++){
for(int j=0;j<2;j++){
if(i<S.size-1){
score+=S.at(i)+op.at(j)... | a.cc: In function 'int main()':
a.cc:14:23: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
14 | vector<string> score();
| ^~
a.cc:14:23: note: remove parentheses to default-initialize a variable
14 | vector<string> score();
| ... |
s318052893 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin>>S;
if(S.size()==1){
int n = stoi(S);
cout<<n;
}
else{
vector<string> op;
op = {,+};
vector<string> score();
for(int i;i<S.size();i++){
for(int j=0;j<2;j++){
if(i<S.size-1){
score+=S.at(i)+op.at(j);
... | a.cc: In function 'int main()':
a.cc:13:9: error: expected primary-expression before ',' token
13 | op = {,+};
| ^
a.cc:13:11: error: expected primary-expression before '}' token
13 | op = {,+};
| ^
a.cc:13:11: error: no match for 'operator=' (operand types are 'std::vector<std::... |
s083369740 | p04001 | C++ | s = input()
l = len(s)
ans = 0
for mask in range(2 ** (l-1)):
f = s
last_plus = 0
for bit in range(l-1):
if (mask >> bit) & 1:
ans += int(s[last_plus: bit+1])
last_plus = bit + 1
ans += int(s[last_plus:])
print(ans)
| a.cc:1:1: error: 's' does not name a type
1 | s = input()
| ^
|
s545099405 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int kotae(int a){
if(a/10==0){
return a;
}
int t=0;
for(int i<=10;i<a;i=i*10){
t=t+kotae(a/i)+a%i*std::pow(2,log10(a/i));
}
return a+t;
}
int main() {
int suuzi;
cin >>suuzi;
cout<<kotae(suuzi)<<endl;
} | a.cc: In function 'int kotae(int)':
a.cc:9:13: error: expected ';' before '<=' token
9 | for(int i<=10;i<a;i=i*10){
| ^~
| ;
a.cc:9:13: error: expected primary-expression before '<=' token
9 | for(int i<=10;i<a;i=i*10){
| ^~
a.cc:9:21: error: expected ... |
s095278771 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int dfs(int sum, int r, string s, int dp){
if(dp=s.size()){
return sum + r;
}
else{
int a = dfs(sum + r, s(dp)-'0', s, dp+1);//'+'in
int b = dfs(sum, r*10+s(dp)-'0',s,dp+1);//not'+'in
return a+b;
}
}
int main(){
string s;
cin >> s;
cout << df... | a.cc: In function 'int dfs(int, int, std::string, int)':
a.cc:9:27: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int&)'
9 | int a = dfs(sum + r, s(dp)-'0', s, dp+1);//'+'in
| ~^~~~
a.cc:10:28: error: no match for call to '(std::string {aka std... |
s700225345 | p04001 | C++ | #include <iostream>
#include <vector>
#include <array>
#include <unordered_map>
#include <unordered_set>
using namespace std;
int main (int argc, char* argv[]) {
string s;
cin >> s;
vector<long long> dp(s.size());
for (int i = 0; i < s.size(); i++) {
long long total = 0;
long long current = 0;
long long... | a.cc: In function 'int main(int, char**)':
a.cc:23:56: error: 'pow' was not declared in this scope; did you mean 'power'?
23 | total += prev_res + (current * pow(2, j == 0 ? 0 : j - 1));
| ^~~
| ... |
s075189960 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
//文字列1+23+4を計算する
S.push_back('+');
string l;
int sum = 0;
for(int i=0;i<S.size();i++){
if(S[i] != '+'){
l.push_back(S[i]);
}
else {
sum += stoi(l);
l = " ";
}
}
for(int bit = 0;bit< (1<<S.size()-... | a.cc:22:1: error: extended character is not valid in an identifier
22 | if (bit & (1<<i)) { // i が bit に入るかどうか
| ^
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:23:1: error: extended character is not valid i... |
s667545231 | p04001 | C++ | #include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
typedef long long ll;
int main(void){
string S;
cin >> S;
int len = S.length();
ll ans = 0;
for(int i=0; i<(1 << (len - 1)); i++){
ll res = 0, last = 0;
for(int j=0; j<len; j++){
last = 10 * last + (s[j] - '0');
if(i & (1 <... | a.cc: In function 'int main()':
a.cc:20:45: error: 's' was not declared in this scope
20 | last = 10 * last + (s[j] - '0');
| ^
|
s426441564 | p04001 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1<<30;
string s;int n;
ll calc(int a, int b){
ll tmp=0;
while(a!=b){
tmp = tmp*(ll)10+ll(s[a]-'0');
a++;
}
return tmp;
}
int main(){
cin>>s;
n=(int)s.size();
ll ans=0;
for(int i=0;i<(1<<n-1);i++){
ll res=... | a.cc: In function 'int main()':
a.cc:24:19: error: expected primary-expression before '!=' token
24 | if((i>>j)&1)!=0){
| ^~
|
s563691911 | p04001 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long i,j,k,N,ans=0,pow[12],x;
char ss[20];
scanf("%s",ss);
N=strlen(ss);
pow[0]=1;
for(i=1;i<10;i++)pow[i]=pow[i-1]*2;
pow[10]=1;pow[11]=1;
for(i=1,i<=N;i++){
for(j=0,j<=N-i;j++){
x=0;
for(k=0;k<i;k++){
x*=10;
x+=ss[j+k];
}
if(j==0||j==N-i){
ans+=x*pow[(N-i+10)%... | a.cc: In function 'int main()':
a.cc:12:17: error: expected ';' before ')' token
12 | for(i=1,i<=N;i++){
| ^
| ;
a.cc:13:19: error: expected ';' before ')' token
13 | for(j=0,j<=N-i;j++){
| ^
| ;
|
s682105969 | p04001 | C++ | #include <iostream>
#include <string>
#include <cstdio>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
//positionbit目が立っているか判定
bool contain(int mask, int position){
if((mask & (1 << position)) != 0) return true;
else return false;
}
int main(void){
string s; cin >> s;
... | a.cc:39:12: error: found ':' in nested-name-specifier, expected '::'
39 | mmxsrup (id:mmxsrup) 2年前
| ^
| ::
a.cc:39:9: error: expected constructor, destructor, or type conversion before '(' token
39 | mmxsrup (id:mmxsrup) 2年前
| ^
|
s664146739 | p04001 | C++ | #include <iostream>
#include <string>
#include <cstdio>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
//positionbit目が立っているか判定
bool contain(int mask, int position){
if((mask & (1 << position)) != 0) return true;
else return false;
}
int main(void){
string s; cin >> s;
... | a.cc:39:12: error: found ':' in nested-name-specifier, expected '::'
39 | mmxsrup (id:mmxsrup) 2年前
| ^
| ::
a.cc:39:9: error: expected constructor, destructor, or type conversion before '(' token
39 | mmxsrup (id:mmxsrup) 2年前
| ^
|
s768224447 | p04001 | C++ | #include <iostream>
#include <string>
#include <cstdio>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
//positionbit目が立っているか判定
bool contain(int mask, int position){
if((mask & (1 << position)) != 0) return true;
else return false;
}
int main(void){
string s; cin >> s;
... | a.cc:39:12: error: found ':' in nested-name-specifier, expected '::'
39 | mmxsrup (id:mmxsrup) 2年前
| ^
| ::
a.cc:39:9: error: expected constructor, destructor, or type conversion before '(' token
39 | mmxsrup (id:mmxsrup) 2年前
| ^
|
s193427534 | p04001 | C++ | # -*- coding: utf-8 -*-
s = input()
n = len(s)
ans = 0
if n == 1:
print(int(s))
exit()
for i in range(2 ** (n - 1)):
tmp = int(s[0])
for j in range(n - 1):
if (i >> j) & 1:
ans += tmp
tmp = 0
tmp = tmp * 10 + int(s[j + 1])
ans += tmp
print(ans)
| a.cc:1:3: error: invalid preprocessing directive #-
1 | # -*- coding: utf-8 -*-
| ^
a.cc:3:1: error: 's' does not name a type
3 | s = input()
| ^
|
s131497014 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int a = N;
int keta = 0;
while (a > 0) {
keta++;
a /= 10;
}
int sum = N;
for(int i = 1; i < keta; i++) {
sum += pow(2, (keta - i - 1)) * (a % pow(10, i));
sum += pow(2, (i - 1)) * (a / pow(10, i));
}
cout... | a.cc: In function 'int main()':
a.cc:16:40: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
16 | sum += pow(2, (keta - i - 1)) * (a % pow(10, i));
| ~ ^ ~~~~~~~~~~
| ... |
s573499557 | p04001 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
using namespace std;
typedef long long signed int ll;
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(obj) (obj).begin(),(obj).end()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
string S;
vector<in... | a.cc: In function 'int main()':
a.cc:23:38: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
23 | number.push_back(atoi(S[S.length() - i - 1]));
| ~~~~^~~~~~~~~~~~~~~~... |
s372865478 | p04001 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
using namespace std;
typedef long long signed int ll;
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(obj) (obj).begin(),(obj).end()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
string S;
vector<in... | a.cc: In function 'int main()':
a.cc:23:43: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long uns... |
s699862394 | p04001 | C++ |
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#i... | a.cc: In function 'void dijkstra()':
a.cc:48:15: error: no matching function for call to 'std::priority_queue<std::tuple<long long int, long long int, long long int>, std::vector<std::tuple<long long int, long long int, long long int>, std::allocator<std::tuple<long long int, long long int, long long int> > >, std::gre... |
s708156139 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin >> S;
long long ans = 0;
for(int i = 0; s < (1 << (S.size() - 1)); i++){
string now;
now = S.at(0);
for(int j = 0; j < S.size() - 1; j++){
if(i & (1 << j)) now += "+";
now += S.at(j + 1);
}
long long ... | a.cc: In function 'int main()':
a.cc:8:16: error: 's' was not declared in this scope
8 | for(int i = 0; s < (1 << (S.size() - 1)); i++){
| ^
|
s839937934 | p04001 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cmath>
using namespace std;
typedef long long ll;
#define rep(i,n) for(i=0;i<n;i++)
int main() {
ll a, b, c, d, e, f, g, h, i, j, n, m, l, sum = 0,aa[10];
string s;
cin >> s;
l = s.size - 1;
//rep(i, size(s))(cout << s[i]);
rep(... | a.cc: In function 'int main()':
a.cc:14:15: 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... |
s016961794 | p04001 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))
#define REP0(i,n) for(i=0;i<n;i++)
#define REP1(i,n) for(i=1;i<n;i++)
int main(void)
{
char s[11];
int d[11];
scanf("%s",s);
int l;
l = strlen(s);//\0を抜いた文字列の長さ
int i... | main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'REP'; did you mean 'REP0'? [-Wimplicit-function-declaration]
20 | REP(i,l) d[i]=s[i]-'0';
| ^~~
| REP0
main.c:20:11: error: expected ';' before 'd'
20 | REP(i,l) d[i]=s[i]-'0';
| ^~
| ... |
s512962566 | p04001 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))
#define REP0(i,n) for(i=0;i<n;i++)
#define REP1(i,n) for(i=1;i<n;i++)
int main(void)
{
char s[11];
int d[11];
scanf("%s",s);
int l;
l = strlen(s);//\0を抜いた文字列の長さ
int i... | main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'REP'; did you mean 'REP0'? [-Wimplicit-function-declaration]
20 | REP(i,l) d[i]=s[i]-'0';
| ^~~
| REP0
main.c:20:11: error: expected ';' before 'd'
20 | REP(i,l) d[i]=s[i]-'0';
| ^~
| ... |
s821417340 | p04001 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))
#define REP0(i,n) for(i=0;i<n;i++)
#define REP1(i,n) for(i=1;i<n;i++)
int main(void)
{
char s[11];
int d[11];
scanf("%s",s);
int l;
l = strlen(s);//\0を抜いた文字列の長さ
int i... | main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'REP'; did you mean 'REP0'? [-Wimplicit-function-declaration]
20 | REP(i,l) d[i]=s[i]-'0';
| ^~~
| REP0
main.c:20:11: error: expected ';' before 'd'
20 | REP(i,l) d[i]=s[i]-'0';
| ^~
| ... |
s715464138 | p04001 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))
#define REP0(i,n) for(i=0;i<n;i++)
#define REP1(i,n) for(i=1;i<n;i++)
int main(void)
{
char s[11];
int d[11];
scanf("%s",s);
int l;
l = strlen(s);//\0を抜いた文字列の長さ
int i... | main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'REP'; did you mean 'REP0'? [-Wimplicit-function-declaration]
20 | REP(i,l) d[i]=s[i]-'0';
| ^~~
| REP0
main.c:20:11: error: expected ';' before 'd'
20 | REP(i,l) d[i]=s[i]-'0';
| ^~
| ... |
s227768532 | p04001 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))
#define REP0(i,n) for(i=0;i<n;i++)
#define REP1(i,n) for(i=1;i<n;i++)
int main(void)
{
char s[11];
int d[11];
scanf("%s",s);
int l;
l = strlen(s);//\0を抜いた文字列の長さ
int i... | main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'REP'; did you mean 'REP0'? [-Wimplicit-function-declaration]
20 | REP(i,l) d[i]=s[i]-'0';
| ^~~
| REP0
main.c:20:11: error: expected ';' before 'd'
20 | REP(i,l) d[i]=s[i]-'0';
| ^~
| ... |
s601498490 | p04001 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
#define ll long long
using namespace std;
ll stoll(string str)
{
int len=str.size();
ll sum=0;
for(int i=0;i<len;i++)
{
sum=sum*10+(str[i]-'0');
}
return sum;
}
ll int search(string s1,ll presum){
int i;
ll k,sum;
sum =... | a.cc: In function 'long long int search(std::string, long long int)':
a.cc:27:29: error: call of overloaded 'stoll(std::string&)' is ambiguous
27 | sum += stoll(s1)+presum;//---
| ~~~~~^~~~
a.cc:6:4: note: candidate: 'long long int stoll(std::string)'
6 | ll stoll(str... |
s126627183 | p04001 | C++ | #include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
const int INF = 1e7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, k, n) for (int i = (k); i < (int)(n); ++i)
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begi... | a.cc:41:2: error: stray '#' in program
41 | }#include "bits/stdc++.h"
| ^
a.cc:41:3: error: 'include' does not name a type
41 | }#include "bits/stdc++.h"
| ^~~~~~~
a.cc:43:11: error: redefinition of 'const int MOD'
43 | const int MOD = 1e9 + 7;
| ^~~
a.cc:3:11: note: 'const int M... |
s883566635 | p04001 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int search(string s1){
int i,sum,k;
sum = 0;
std::string s3,s2;
for (i=1;i<=s1.size();i++){
s2 = s1.substr(0,i);
s3 = s1.substr(i);
if(s2 == ""){
s2 = "0";
k = stoi(s2);
sum += k + s... | a.cc: In function 'int search(std::string)':
a.cc:20:15: error: a function-definition is not allowed here before '{' token
20 | int main(void){
| ^
a.cc:27:2: error: expected '}' at end of input
27 | }
| ^
a.cc:6:22: note: to match this '{'
6 | int search(string s1){
| ... |
s256417164 | p04001 | C++ | #include <bits/stdc++.h>
#include <string>
using namespace std;
int main(void){
int sum;
string s;
scanf("%s",&s);
sum = search(s);
printf("%d", sum);
return 0;
}
int search(string s){
int i,sum;
sum = 0;
string s2,s3;
for (i=0;i<s.size();i++){
s2 = str.substr(0,i);
s3 = str.subs... | a.cc: In function 'int main()':
a.cc:8:21: error: no matching function for call to 'search(std::string&)'
8 | sum = search(s);
| ~~~~~~^~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s209913040 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
int sum,i,j,prej;
string s;
scanf("%s",&s);
sum = 0;
printf("%d", search(s));
return 0;
}
int search(string s){
int i,sum;
sum = 0;
string s2,s3;
for (i=0;i<s.size();i++){
s2 = str.substr(0,i);
s3 = str.substr(i);
... | a.cc: In function 'int main()':
a.cc:8:28: error: no matching function for call to 'search(std::string&)'
8 | printf("%d", search(s));
| ~~~~~~^~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s490997047 | p04001 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
typedef long long ll;
using namespace std;
//int a[10]={};
int le;
int tot=0;
string s;
int dfs(int i, string s){
if (i == le){
int tsum=0,tsu=0;
for (int j=0;j<s.length();j++){
if (s[j] != '+'){
tsum += ts... | a.cc: In function 'int dfs(int, std::string)':
a.cc:31:11: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(int&, char)'
31 | s.insert(pos,'+');
| ~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_cl... |
s817677248 | p04001 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
typedef long long ll;
using namespace std;
//int a[10]={};
int le;
int tot=0;
string s;
int dfs(int i, string s){
if (i == le){
int tsum=0,tsu=0;
for (int j=0;j<s.length();j++){
if (s[j] != '+'){
tsum += ts... | a.cc: In function 'int dfs(int, std::string)':
a.cc:30:11: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(std::__cxx11::basic_string<char>::size_type, char)'
30 | s.insert(s.length()-(le-i)+1,'+');
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++... |
s450066959 | p04001 | C++ | #include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=a;i<b;i++)
using namespace std;
using ll = long long;
int main() {
string s;
ll ans=sum=0;
cin>>s;
rep(i, 0, 1 << s.size()-1) {
rep(j, 0, s.size()) {
if (1 & i >> j)sum = sum*10 + (int)(s[j] - '0');
else ans += sum * 10 + (int)(s[j] - '0'),sum=0;
}
}
... | a.cc: In function 'int main()':
a.cc:7:16: error: 'sum' was not declared in this scope
7 | ll ans=sum=0;
| ^~~
|
s337041261 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
stack<int> d;
int i;
int dfs(a){
if(i==d.size()) return a;
return dfs(a*10+d[i+1])+a+dfs(d[i+1]);
}
int main(){
long long s;
cin>>s;
for(int j=0;j<10;j++){
if(s%10==0)break;
d.push(s%10);
s/=10;
}
reverse(d.begin(),d.end());
cout<<dfs(d[0])<<endl... | a.cc:5:9: error: 'a' was not declared in this scope
5 | int dfs(a){
| ^
a.cc: In function 'int main()':
a.cc:17:13: error: 'class std::stack<int>' has no member named 'begin'
17 | reverse(d.begin(),d.end());
| ^~~~~
a.cc:17:23: error: 'class std::stack<int>' has no member named ... |
s956111754 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
stack<int> d;
int i;
int dfs(a){
if(i==d.size()) return a;
return dfs(a*10+d[i+1])+a+dfs(d[i+1]);
}
int main(){
int s;
cin>>s;
stack<int> d;
for(int j=0;j<10;j++){
if(s%10==0)break;
d.push(s%10);
s/=10;
}
reverse(d.begin(),d.end());
cout<<dfs(d... | a.cc:5:9: error: 'a' was not declared in this scope
5 | int dfs(a){
| ^
a.cc: In function 'int main()':
a.cc:18:13: error: 'class std::stack<int>' has no member named 'begin'
18 | reverse(d.begin(),d.end());
| ^~~~~
a.cc:18:23: error: 'class std::stack<int>' has no member named ... |
s636077968 | p04001 | C++ | include<iostream>
#include <bits/stdc++.h>
using namespace std;
int ctoi(int x){
if(x == '0'){
return 0;}
if(x == '1'){
return 1;}
if(x == '2'){
return 2;}
if(x == '3'){
return 3;}
if(x == '4'){
return 4;}
if(x == '5'){
return 5;}
if(x =='6'){
return 6;}
if(x == '7'){
re... | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/... |
s684038721 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int a;
cin>>a;
int dfs (int i, int sum){
if (a/i==0)return sum;
else{
sum+=dfs(10,a/i)
sum+=dfs(10*i,a)
}
}
int main(){
cout<<dfs(10,0)<<endl;
} | a.cc:4:1: error: 'cin' does not name a type
4 | cin>>a;
| ^~~
a.cc: In function 'int dfs(int, int)':
a.cc:8:21: error: expected ';' before 'sum'
8 | sum+=dfs(10,a/i)
| ^
| ;
9 | sum+=dfs(10*i,a)
| ~~~
a.cc:8:8: warning... |
s553607391 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int a;
cin>>a;
int dfs (int i, ){
if (a/i==0)return sum;
else{
sum+=dfs(10,a/i)
sum+=dfs(10*i,a)
}
}
int main(){
cout<<dfs(10,0)<<endl;
} | a.cc:4:1: error: 'cin' does not name a type
4 | cin>>a;
| ^~~
a.cc:5:17: error: expected identifier before ')' token
5 | int dfs (int i, ){
| ^
a.cc: In function 'int dfs(int, int)':
a.cc:6:21: error: 'sum' was not declared in this scope
6 | if (a/i==0)return sum;
| ... |
s344646810 | p04001 | C++ | s = input()
space = len(s) - 1
ans = 0
for i in range(2 ** space):
formula = s[0]
for j in range(space):
if (i >> j) & 1:
formula += "+"
formula += s[j + 1]
ans += eval(formula)
print(ans) | a.cc:1:1: error: 's' does not name a type
1 | s = input()
| ^
|
s670488109 | p04001 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace algorithm
{
class Program
{
static void Main(string[] args)
{
char[] c = Console.ReadLine().ToCharArray();
char[] d = new char[c.Length * 2];
char[] tmp = new char[c.Length * 2];
int[] calc = new int[c.L... | 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... |
s726230431 | p04001 | C++ | #include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
#define repprev(i,a,b) for(ll i=b-1;i>=a;i--)
#define reprev(i,n) repprev(i,0,n)
using namespace std;
#define sz(x)... | a.cc: In function 'int main()':
a.cc:141:17: error: 'sum' was not declared in this scope
141 | cout << sum << endl;
| ^~~
|
s042530167 | p04001 | C++ | #include <cstdlib>
using namespace std;
typedef long long ll;
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
int main() {
string S; cin >> S;
int N = S.size();
ll ans = 0;
FOR(bit, 0, (1<<(N - 1))) {
ll sum = 0;
int x = 0;
FOR(i, 0, N - 1) {
if (bit & (... | a.cc: In function 'int main()':
a.cc:8:5: error: 'string' was not declared in this scope
8 | string S; cin >> S;
| ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
1 | #include <cstdlib>
+++ |+#include <string>
2 | u... |
s257120299 | p04001 | C++ | #include <vector>
#include <list>
#include <map>
#include <set>//2分探索木
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#i... | a.cc: In function 'int main()':
a.cc:212:9: error: expected ';' before '}' token
212 | }
| ^
|
s713092332 | p04001 | C++ | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
char C[10];
int S[10];
int len;
int calc(int acc, int pos, int last, int delimiter) {
if (delimiter == len) {
return 0;
}
if (pos == len - 1) {
auto after = 0;
for (auto i = last; i < ... | a.cc: In function 'int main()':
a.cc:36:14: error: 'strlen' was not declared in this scope
36 | len = (int)strlen(C);
| ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <iostream>
+++ |+#include <cstring>... |
s720247819 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
//bit全探索を用いる
string S;
cin >> S;
long long int ans = 0;
for (int bit = 0; bit < (1<<(S.size()-1)); bit++;) { // Sの部分集合の全探索 (数と数の間について+が入るかどうかを全列挙)
int s = 0; //考えている現在地
for (int i=0; i<S.size()-1; i++) {
if (bit & (1 << i)) { /... | a.cc: In function 'int main()':
a.cc:9:51: error: expected ')' before ';' token
9 | for (int bit = 0; bit < (1<<(S.size()-1)); bit++;) { // Sの部分集合の全探索 (数と数の間について+が入るかどうかを全列挙)
| ~ ^
| )
a.cc:9:52: error: e... |
s050241443 | p04001 | C | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
using namespace std;
typedef lon... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s204324821 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
string s; cin>>s;
long int bit,i,n,sum=0; n=s.size()-1; //125でn=2
for(bit=0;bit<(1<<n);bit++){
string str=s; int x=0;
for(i=0;i<n;i++){
string tmp;
if(bit&(1<<i)){
tmp=str.... | a.cc: In function 'int main()':
a.cc:13:22: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'long int'
13 | sum+=long(tmp);
| ^~~~~~~~~
|
s961725106 | p04001 | C++ | S = input()
op_cnt = len(S) - 1
ResSum = 0
for i in range(2**op_cnt):
op = [""] * op_cnt
for j in range(op_cnt):
if((i >> j) & 1):
op[op_cnt - 1 - j] = "+"
formula = ""
for p_S, p_o in zip(S, op + [""]):
formula += (p_S + p_o)
ResSum += eval(formula)
print(ResSum) | a.cc:1:1: error: 'S' does not name a type
1 | S = input()
| ^
|
s077543599 | p04001 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
int main() {
string S;
cin >> S;
int number[S.size()];
for(int i=0;i<S.size();i++){
number[i] = S%10;
S /= 10;
}
int ans = 0;
for(int i=0;i<(1<<S.size());i++){
int temp = i... | a.cc: In function 'int main()':
a.cc:15:18: error: no match for 'operator%' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
15 | number[i] = S%10;
| ~^~~
| | |
| | int
| std::string {aka s... |
s094519119 | p04001 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
int main() {
string S;
cin >> S;
int ans = 0;
for(int i=0;i<(1<<(S.size()-1));i++){
int temp = i+(1<<S.size());
int factor = 1;
int j =S.size()-1;
while(temp){
ans += (sto... | a.cc: In function 'int main()':
a.cc:20:19: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
20 | ans += (stoi(S[j])*factor);
| ~~~~^~~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/includ... |
s926829422 | p04001 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
int main() {
string S;
cin >> S;
int ans = 0;
for(int i=0;i<(1<<(S.size()-1));i++){
int temp = i+(1<<S.size());
int factor = 1;
int j =S.size()-1;
while(temp){
ans += (ato... | a.cc: In function 'int main()':
a.cc:20:19: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
20 | ans += (atoi(S[j])*factor);
| ~~~~^~~~~~
| |
| __g... |
s304708261 | p04001 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
int main() {
string S;
cin >> S;
int ans = 0;
for(int i=0;i<(1<<(S.size()-1));i++){
int temp = i+(1<<S.size());
int factor = 1;
int j =S.size()-1;
while(temp){
ans += (S[j... | a.cc: In function 'int main()':
a.cc:24:23: error: expected ';' before '\U0000ff1b'
24 | temp = (temp>>1);
| ^~
| ;
|
s048462733 | p04001 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
int main() {
string S;
cin >> S;
int ans = 0;
for(int i=0;i<(1<<(S.size()-1));i++){
int temp = i+(1<<S.size());
int factor = 1;
int j =S.size()-1;
while(temp){
ans += (S[j... | a.cc: In function 'int main()':
a.cc:24:23: error: expected ';' before '\U0000ff1b'
24 | temp = (temp>>1);
| ^~
| ;
|
s076155128 | p04001 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
int main() {
string S;
cin >> S;
int ans = 0;
for(int i=0;i<(1<<(S.size()-1));i++){
int temp = i+(1<<S.size());
int factor = 1;
int j =S.size()-1;
while(temp){
ans += (S[j... | a.cc: In function 'int main()':
a.cc:24:20: error: unable to find numeric literal operator 'operator""\U0000ff1b'
24 | temp = temp>>1;
| ^~~
|
s087354890 | p04001 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
int main() {
string S;
cin >> S;
int ans = 0;
for(int i=0;i<(1<<(S.size()-1));i++){
temp = i+(1<<S.size());
int factor = 1;
int j =S.size()-1;
while(temp){
ans += (S[j]*fa... | a.cc: In function 'int main()':
a.cc:16:5: error: 'temp' was not declared in this scope; did you mean 'tm'?
16 | temp = i+(1<<S.size());
| ^~~~
| tm
a.cc:24:20: error: unable to find numeric literal operator 'operator""\U0000ff1b'
24 | temp = temp>>1;
| ^~~
|
s358510153 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define all(x) (x).begin(),(x).end()
#define foreach(u,v) fo... | a.cc:36:36: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<int, int>; _Tp = std::vector<std::tuple<int, int, int> >; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const ... |
s341106813 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string S;
cin>>S;
int N = s.size();
int count = 0;
for(i=0;i<N;++i){
for(j=i;j<N;++j){
count += stoi(S.substr(i,j-i+1));
}
}
cout<<count<<endl;
} | a.cc: In function 'int main()':
a.cc:8:13: error: 's' was not declared in this scope
8 | int N = s.size();
| ^
a.cc:10:9: error: 'i' was not declared in this scope
10 | for(i=0;i<N;++i){
| ^
a.cc:11:13: error: 'j' was not declared in this scope
11 | for(j=i;j<N;... |
s449415809 | p04001 | C++ | import sys
inp = sys.stdin.readline
S = inp().replace('\n', '')
cnt = 0
for i in range(1 << len(S)-1):
tmp = S[0]
for j in range(len(S)-1):
if(((i >> j) & 1) == 1):
tmp += '+'
tmp += S[j+1]
cnt += sum(map(int, tmp.split('+')))
print(cnt) | a.cc:4:25: error: empty character constant
4 | S = inp().replace('\n', '')
| ^~
a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s709824000 | p04001 | C++ | #include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
typedef long long ll;
using namespace std;
int main(){
string s;
cin >> s;
ll ans = 0;
for(int t = 0; t <(1 <<(s.size() - 1)); t ++){... | a.cc: In function 'int main()':
a.cc:19:3: error: 'for\U0000ff08int' was not declared in this scope
19 | for(int t = 0; t <(1 <<(s.size() - 1)); t ++){
| ^~~~~~~~
a.cc:19:19: error: 't' was not declared in this scope
19 | for(int t = 0; t <(1 <<(s.size() - 1)); t ++){
| ^
a.c... |
s744884753 | p04001 | C++ | #include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<map>
#include<numeric>
#include<set>
#include<string>
#include<utility>
#include<vector>
#define rep(i, a, n) for(int i=a; i<n; i++)
#define per(i, a, n) for(int i=n-1; i>=a; i--)
#define fill0(n) setfill('0') << righ... | a.cc: In function 'int main()':
a.cc:29:22: error: expected ';' before '{' token
29 | if(i&(1<<(j-1)){
| ^
| ;
a.cc:33:14: error: expected ')' before ';' token
33 | tmp*=10;
| ^
| )
a.cc:29:9: note: to match th... |
s282693960 | p04001 | C++ | import Control.Applicative
import Text.Printf
import Debug.Trace
solve :: [Integer] -> Integer
solve [] = 0
solve [x] = x
solve (x:xs) = x*(2^((length xs) - 1)) + (solve xs) + (solve ((10*x+(xs!!0)):(tail xs)))
solve_sub :: Int->[Integer] -> Integer
solve_sub n [] = 0
solve_sub n [x] = x*2^n
solve_sub n (x:xs) = x*(2... | a.cc:13:64: error: stray '`' in program
13 | solve_sub n (x:xs) = x*(2^n)*10^(length xs) + (1-5^(length xs))`div`(1-5)*x*2^(length xs - 1 + n) + (solve_sub (n+1) xs)
| ^
a.cc:13:68: error: stray '`' in program
13 | solve_sub n (x:xs) = x*(2^n)*1... |
s720440186 | p04001 | C++ | #include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
u... | a.cc: In function 'int main()':
a.cc:44:23: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
44 | for(int l=j;l<=j+2:l++)
| ^
a.cc:44:29: error: expected ';' before ':' token
44 | for(int l=j;l... |
s095215214 | p04001 | C++ | S = input()
s = len(S)
n = 0
for i in range(s):
n+= int(S[i])*(10**(s-1-i))*2**i
lis = []
for i in range(s-1):
lis.append(2**i)
for i in range(s-1):
for j in range(s-1-i):
n += int(S[i])*(10**(s-2-i-j))*(lis[i+j])
print(n) | a.cc:1:1: error: 'S' does not name a type
1 | S = input()
| ^
|
s093055525 | p04001 | C++ | #include <cstdio>
#include <cstring>
long long mypow(long long x, int n) {
long long ans=1;
for(int i=0; i<n; i++) {
ans *= x;
}
return ans;
}
int main() {
char s[11];
scanf("%s",s);
int len = strlen(s);
long long result=0, sum=0;
for (int cut=0; cut < len; cut++) {
... | a.cc: In function 'int main()':
a.cc:28:14: error: expected '}' at end of input
28 | return 0;
| ^
a.cc:11:12: note: to match this '{'
11 | int main() {
| ^
|
s807073958 | p04001 | C++ | if __name__=='__main__':
S=input()
sums=0
num=[x for x in range(1,len(S))]
for i in range(0,1<<len(num)):
output=[]
for j in range(len(num)):
if ((i>>j)&1)==1:
output.append(num[j])
output.append(10)
t=0
for o in output:
sums+=int(S[t:o])
t=o
print(sums)
| a.cc:1:14: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
1 | if __name__=='__main__':
| ^~~~~~~~~~
a.cc:1:1: error: expected unqualified-id before 'if'
1 | if __name__=='__main__':
| ^~
|
s904405253 | p04001 | C++ | #include <stdio.h>
#include <string.h>
long calc(char *target) {
long ans = 0;
char *p = strtok(target, "+");
while(p) {
ans += atol(p);
p = strtok(NULL, "+");
}
return ans;
}
main() {
char S[21];
scanf("%s", S);
int i;
int n = strlen(S);
char target[41];
int j;
long ans = 0;
for(i=0;i< 1<< (n -... | a.cc: In function 'long int calc(char*)':
a.cc:8:24: error: 'atol' was not declared in this scope
8 | ans += atol(p);
| ^~~~
a.cc: At global scope:
a.cc:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
14 | main() {
| ^~~~
|
s715994784 | p04001 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
string s; cin >> s;
int t = atoi("s");
int a = s.size();
int count = 0;
for(int i = 0; i < a; ++i){
count += atoi(s[0:i]) + atoi(s[i:a - 1]);
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:11:22: error: expected ']' before ':' token
11 | count += atoi(s[0:i]) + atoi(s[i:a - 1]);
| ^
| ]
a.cc:11:22: error: expected ')' before ':' token
11 | count += atoi(s[0:i]) + atoi(s[i:a - 1]);
| ... |
s391527030 | p04001 | C++ | #include <cstdio>
#include <cmath>
int calc(int left, int sum) {
if (left < 10) {
return sum + left;
}
else {
sum += left;
for(int i=1;i < log10(left)+1;i++){
int right = left % (int) pow(10,i);
left = left / pow(10,i);
sum += calc(left,0)+calc(right,0);
}
return sum;
}
}
void s... | /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
|
s279088471 | p04001 | C++ | #define CATCH_CONFIG_MAIN
#include <cstdio>
#include <cmath>
int calc(int left, int sum) {
if (left < 10) {
return sum + left;
}
else {
sum += left;
for(int i=1;i < log10(left)+1;i++){
int right = left % (int) pow(10,i);
left = left / pow(10,i);
sum += calc(left,0)+calc(right,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
|
s904839109 | p04001 | C++ | // https://qiita.com/drken/items/e77685614f3c6bf86f44
// https://,0)arc061.contest.atcoder.jp/tasks/arc061_a
#define CATCH_CONFIG_MAIN
#include <cstdio>
#include <cmath>
#include <catch2/catch.hpp>
int calc(int left, int sum) {
if (left < 10) {
return sum + left;
}
else {
sum += left;
for(int i=1;i < ... | a.cc:6:10: fatal error: catch2/catch.hpp: No such file or directory
6 | #include <catch2/catch.hpp>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
|
s698767510 | p04001 | C++ | #include <iostream>
#include <stdint.h>
using namespace std;
uint64_t test(uint64_t x, char *s) {
if (*s == '\0') {
return x;
}
uint64_t i = x + atoll(s);
for(int j = 1; j < strlen(s); j++) {
char tmp[j + 1];
memcpy(tmp, s, j);
tmp[j] = '\0';
i += test(x + atoll(tmp), s + j);
}
return i... | a.cc: In function 'uint64_t test(uint64_t, char*)':
a.cc:10:22: error: 'strlen' was not declared in this scope
10 | for(int j = 1; j < strlen(s); j++) {
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #in... |
s310667637 | p04001 | C++ | Last login: Tue Sep 11 13:04:54 on ttys000
Kosuke-no-MacBook-Pro:~ Kosuke$ cd Atcorder
Kosuke-no-MacBook-Pro:Atcorder Kosuke$ emacs
Kosuke-no-MacBook-Pro:Atcorder Kosuke$ g++ -o a abc079c.cpp
abc079c.cpp:11:29: error: expected ';' after expression
if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
... | a.cc:1:1: error: 'Last' does not name a type
1 | Last login: Tue Sep 11 13:04:54 on ttys000
| ^~~~
a.cc:7:29: error: expected unqualified-id before '^' token
7 | ^
| ^
a.cc:9:1: error: 'abc079c' does not name a type
9 | abc079c.cpp:11:33: e... |
s404878805 | p04001 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
String ans="";
long sum = 0;
Scanner sc = new Scanner(System.in);
char[] charArray = sc.next().toCharArray();
for(int bit = 0; bit < Math.pow(2, charArray.length -1) ; bit++) {
ans = String.valueOf(charArray[0... | Main.java:27: error: reached end of file while parsing
}
^
1 error
|
s767180476 | p04001 | C++ | if((bit & (1 << i))){
sum += stoi( part );
cout << part << endl;
part = ""; | a.cc:1:1: error: expected unqualified-id before 'if'
1 | if((bit & (1 << i))){
| ^~
|
s725524617 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
char s[12345];
int main(int argc, char const *argv[])
{
scanf("%c",&s);
int n = strlen(s);
long long ret = 0;
for (int i = 0; i < 1<<(n-1); ++i)
{
long long now = 0;
long long sum = 0;
for (int j = 0; j < n; ++j)
{
now=now*10 long long;
... | a.cc: In function 'int main(int, const char**)':
a.cc:15:17: error: expected ';' before 'long'
15 | now=now*10 long long;
| ^~~~~
| ;
a.cc:17:20: error: invalid operands of types 'char [12345]' and 'int' to binary 'operator>>'
17 | if (i<n-1&&(s>>i&1))
... |
s148796371 | p04001 | C++ | #include <bits/stdc++.h>
using namespace std;
char s[12345];
int main(int argc, char const *argv[])
{
scanf("%s",&s);
int n = strlen(s);
long long ret = 0;
for (int i = 0; i < 1<<(n-1); ++i)
{
long long now = 0;
long long sum = 0;
for (int j = 0; j < n; ++j)
{
now=now*10 long long
... | a.cc: In function 'int main(int, const char**)':
a.cc:15:17: error: expected ';' before 'long'
15 | now=now*10 long long
| ^~~~~
| ;
a.cc:17:20: error: invalid operands of types 'char [12345]' and 'int' to binary 'operator>>'
17 | if (i<n-1&&(s>>i&1))
... |
s146888129 | p04001 | C++ | #include <stdlib.h>
using namespace std;
string S;
string S_0 = "0";
int len;
string cut(string str){
S_0 = str[0];
string tmp = str.substr(1);
return tmp;
}
int main(){
int i=0;
cin >> S;
len = S.size();
long long sum = stoll(S.c_str());
string tmp = S;
string tmp3 = S;
for(int i=1; i<len; i++){
sum +... | a.cc:4:1: error: 'string' does not name a type
4 | string S;
| ^~~~~~
a.cc:5:1: error: 'string' does not name a type
5 | string S_0 = "0";
| ^~~~~~
a.cc:8:1: error: 'string' does not name a type
8 | string cut(string str){
| ^~~~~~
a.cc: In function 'int main()':
a.cc:16:9: error: 'cin' wa... |
s232247341 | p04001 | C++ | //Written by Zhu Zeqi
//Come on,baby
//Hack,please
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#inc... | a.cc:159:9: warning: "MAX" redefined
159 | #define MAX 1000005
| ^~~
a.cc:66:9: note: this is the location of the previous definition
66 | #define MAX 1000000000000000000
| ^~~
a.cc:161:8: error: 'pi' was not declared in this scope; did you mean 'pt'?
161 | vector<pi> lian[MAX];
... |
s985469491 | p04001 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#include <unordered_map>
#define Endl endl
#define mp make_pair
#define rep(N) for(int i=0;i<N;i++)
#de... | a.cc:33:25: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<int, int>; _Tp = int; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >]'
33 ... |
s817122059 | p04001 | C++ | /*
* @Author: SugarSBN
* @Date: 2018-07-14 19:06:53
* @Language: C++
*/
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<cmath>
#include<sstream>
#include<fstream>
usin... | /tmp/cc1NOf5t.o: in function `getfa(int)':
a.cc:(.text+0x1b): relocation truncated to fit: R_X86_64_PC32 against symbol `fa' defined in .bss section in /tmp/cc1NOf5t.o
a.cc:(.text+0x37): relocation truncated to fit: R_X86_64_PC32 against symbol `fa' defined in .bss section in /tmp/cc1NOf5t.o
a.cc:(.text+0x56): relocati... |
s340659035 | p04001 | C++ | #pragma GCC optimize(2)
//Happy TLE and WA every day!
#include<bits/stdc++.h>
#define mp make_pair
#define rep(i,n) for(int i = 0; i < n; i++)
#define BINF 0x7fffffff
#define INF 0x3f3f3f3f
#define LINF 3223372036854775807
#define END(s) {cout<<s; return 0;}
#define CON(s) {cout<<s; continue;}
#define BRE(s) {... | a.cc: In function 'long long int stoi(std::string)':
a.cc:31:48: error: call of overloaded 'stoi(std::__cxx11::basic_string<char>)' is ambiguous
31 | return (ss[ss.size() - 1] - '0') + stoi(ss.substr(0, ss.size() - 1)) * 10;
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.