submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s154109144 | p03999 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <cstdlib>
using namespace std;
int main(){
string str_input;
cin >> str_input;
long long result_sum = 0;
for(int bit = 0; bit < (1 << (str_input.size()-1)); bit++){
vector<long long> num_list;
vector <b... | a.cc: In function 'int main()':
a.cc:47:14: error: expected '}' at end of input
47 | return 0;
| ^
a.cc:8:11: note: to match this '{'
8 | int main(){
| ^
|
s743022467 | p03999 | C++ | s=input()
n=len(s)
ans=0
for i in range(1<<(n-1)):
tmp=int(s[0])
for j in range(n-1):
if (i&(1<<j)):
tmp*=10
tmp+=int(s[j+1])
else:
ans+=tmp
tmp=int(s[j+1])
ans+=tmp
print(ans)
| a.cc:1:1: error: 's' does not name a type
1 | s=input()
| ^
|
s545607946 | p03999 | C++ | #include <iostream>
using namespace std;
int main(){
string S; cin >> S;
int n = S.size();
int ans = S-'0';
printf("%d", ans);
/*
for(int bit=0; bit<<(1<<n); bit++){
for(int i=0; i<n; i++){
}
}
*/
} | a.cc: In function 'int main()':
a.cc:7:14: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
7 | int ans = S-'0';
| ~^~~~
| | |
| | char
| std::string {aka std::__cxx11::basi... |
s109524768 | p03999 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
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) に... | a.cc:14:45: error: extended character is not valid in an identifier
14 | // strlen(s) にすると、i=(111)_2までになる。
| ^
a.cc:23:20: error: extended character is not valid in an identifier
23 | ans += tmp; // 最後の分割部... |
s374731030 | p03999 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin >> S;
long long ans=0LL; // long long(でかい整数)は0LLで初期化
for(int i=0; i<(1<<S.size()-1); ++i){ // bit全探索
string tmp = "";
tmp += s[0];
for(int j=0; j<S.size()-1; ++j){ // jはiと同じだけ回す
// 例えばbitset<4>に対しi... | a.cc: In function 'int main()':
a.cc:11:16: error: 's' was not declared in this scope
11 | tmp += s[0];
| ^
a.cc:15:31: error: expected ')' before '{' token
15 | if((i&(1<<j) != 0){
| ~ ^
| )
a.cc:21:9: ... |
s805414491 | p03999 | C++ | #include <bits/stdc++.h
using namespace std;
int N;
string s;
long long res;
void calc(long long p, long long q){
long long ret = 0;
if(p == N){
res += q;
return;
}
for(int i=p; i<N; ++i){
ret = 10*ret + (s[i] - '0');
calc(i+1, q+ret);
}
return;
}
int main(){
ios_base::sync_with_stdio(... | a.cc:1:24: error: missing terminating > character
1 | #include <bits/stdc++.h
| ^
|
s270357323 | p03999 | C++ | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>... | a.cc: In function 'void algo(std::string&, int, long long int)':
a.cc:55:5: error: 'wy' was not declared in this scope
55 | wy+=sum+n;
| ^~
a.cc: In function 'int main()':
a.cc:63:13: error: 'wy' was not declared in this scope
63 | cout << wy;
| ^~
|
s748401397 | p03999 | C++ | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>... | a.cc: In function 'void algo(std::string&, int, long long int)':
a.cc:55:5: error: 'wy' was not declared in this scope
55 | wy+=sum+n;
| ^~
a.cc: In function 'int main()':
a.cc:63:13: error: 'wy' was not declared in this scope
63 | cout << wy;
| ^~
a.cc: At global scope:
a.cc:7... |
s446645031 | p03999 | C++ | #include <iostream>
using namespace std;
string s;
long long dfs(int n,long long nw,long long tmp){
long long ans = nw + tmp * 10 + (s[n] - '0');
if(s.size()-1 == n){
return ans;
}
return (long long)dfs(n + 1, ans, 0) + dfs(n + 1, nw, ans - nw));
}
int main()
{
cin >> s;
cout << (long long)dfs(0 ,0... | a.cc: In function 'long long int dfs(int, long long int, long long int)':
a.cc:12:66: error: expected ';' before ')' token
12 | return (long long)dfs(n + 1, ans, 0) + dfs(n + 1, nw, ans - nw));
| ^
| ... |
s505291402 | p03999 | C++ | #define ipair pair<int,int>
#define rep(I,N) for(int I=0; I<N; I++)
#define rrep(I,N) for(int I=N; I>=0; I--)
#define repj(i,j,n) for(int i=j;i<n;i++)
#define PB(a,i) (a).push_back(i)
#define ALL(a) (a).begin(),(a).end()
#define OK(i) cout<<"OK "<<i<<endl
#define Yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
... | a.cc: In function 'int main()':
a.cc:17:3: error: 'cin' was not declared in this scope
17 | cin >> s;
| ^~~
a.cc:18:11: error: 'strlen' was not declared in this scope
18 | int N = strlen(s);
| ^~~~~~
a.cc:1:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by... |
s642589901 | p03999 | C++ | s = input().rstrip()
length = len(s) - 1
ans = 0
for i in range(2**length):
val = 0
nums = s[:]
prev_j = 0
for j in range(length):
if i >> j & 1:
val += int(nums[prev_j:j+1])
prev_j = j+1
val += int(nums[prev_j:])
ans += val
print(ans) | a.cc:1:1: error: 's' does not name a type
1 | s = input().rstrip()
| ^
|
s815903248 | p03999 | C | #include<iostream>
#include<bitset>
using namespace std;
int main(){
string s;
cin>>s;
bitset<9>b(0);
long ans=0,l,r;
for(int i=0;i<(1<<s.size()-1);i++){
b=i;
l=0,r=1;
for(int i=0;i<s.size();i++,r++,b>>=1)if(b[0])ans+=stol(s.substr(l,r-l)),l=r;
ans+=stol(s.substr(l,r-... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s690151748 | p03999 | C++ | lude <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
long dfs(const string& s, long& g) {
cout << s << endl;
if(s.size() == 1) return stol(s);
g++;
long sum = stol(s) * g;
for (int i = 1; i < s.size(); ++i ) {
g++;
cout << sum << endl;
sum += dfs(s.substr(i,... | a.cc:1:1: error: 'lude' does not name a type
1 | lude <iostream>
| ^~~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 |... |
s801412334 | p03999 | C | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
string s;
ll Sum(int pre, int now, ll sum) {
ll ans = 0;
for (int i = 0; i < now - pre; i++)
ans += (s[now - i] - '0')*ll(pow(10, i));
if (now == s.size() - 1)
return ans + sum;
return Sum(pre, now + 1, sum) + S... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s574938352 | p03999 | C++ | #include <iostream>
#include <string>
using namespace std;
typedef long long ll;
string s;
ll Sum(int pre, int now, ll sum) {
ll ans = 0;
for (int i = 0; i < now - pre; i++)
ans += (s[now - i] - '0')*ll(pow(10, i));
if (now == s.size() - 1)
return ans + sum;
return Sum(pre, now + 1, sum) + Sum(now, now + 1, ... | a.cc: In function 'll Sum(int, int, ll)':
a.cc:12:46: error: 'pow' was not declared in this scope; did you mean 'now'?
12 | ans += (s[now - i] - '0')*ll(pow(10, i));
| ^~~
| now
|
s953355973 | p03999 | C++ | // 挑戦中なので、わざと間違っている | /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
|
s967935810 | p03999 | 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:131:15: error: extended character is not valid in an identifier
131 | ans += tmp;
| ^
a.cc:132:15: error: extended character is not valid in an identifier
132 | tmp = 0;
| ^
a.cc: In function 'int main()':
a.cc:131:15: error: '\U00003000... |
s442292370 | p03999 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
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) に... | main.c: In function 'main':
main.c:14:45: error: stray '\343' in program
14 | <U+3000> // strlen(s) <U+306B><U+3059><U+308B><U+3068><U+3001>i=(111)_2<U+307E><U+3067><U+306B><U+306A><U+308B><U+3002>
| ^~~~~~~~
main.c:23:20:... |
s952128400 | p03999 | 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:132:15: error: extended character is not valid in an identifier
132 | ans += tmp; // ⇒ (10) ⇒ 12 + 5
| ^
a.cc:133:15: error: extended character is not valid in an identifier
133 | tmp = 0; // 分割した分を足して、tmpを初期化
... |
s608426457 | p03999 | 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:129:45: error: extended character is not valid in an identifier
129 | // strlen(s) にすると、i=(111)_2までになる。
| ^
a.cc:138:20: error: extended character is not valid in an identifier
138 | ans += tmp; // 最後の分... |
s190881188 | p03999 | 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:129:45: error: extended character is not valid in an identifier
129 | // strlen(s) にすると、i=(111)_2までになる。
| ^
a.cc:138:20: error: extended character is not valid in an identifier
138 | ans += tmp; // 最後の分... |
s948058691 | p03999 | 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:129:45: error: extended character is not valid in an identifier
129 | // strlen(s) にすると、i=(111)_2までになる。
| ^
a.cc:138:20: error: extended character is not valid in an identifier
138 | ans += tmp; // 最後の分... |
s701354809 | p03999 | 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:140:32: error: 'r' was not declared in this scope
140 | string t = s.substr(l, r - l + 1);
| ^
|
s407469554 | p03999 | 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:133:26: error: 'i' was not declared in this scope
133 | if (bit & (1<<i)) { // i が bit に入るかどうか
| ^
|
s861658802 | p03999 | Java |
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.NoSuchElementException;
public class Main {
public static void main(String[] args) throws IOException {
new Main().solve();
}
private void solve() throws IOException {
try {
// s... | Main.java:128: error: cannot find symbol
return res + Long.parseLong(builderAll.toString());
^
symbol: variable builderAll
location: class Main
1 error
|
s819185935 | p03999 | C++ | def main():
S = input()
n = len(S)-1
val_sum = 0
for i in range(2**n):
idx = 0
for j in range(n):
if 1 & (i >> j) == 1:
val_sum += int(S[idx:j+1])
idx = j+1
val_sum += int(S[idx:])
print(val_sum)
if __name__ == "__main__":
m... | a.cc:1:1: error: 'def' does not name a type
1 | def main():
| ^~~
|
s115876576 | p03999 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
string s; cin>>s;
long long ans=0,t;
for(int i=0;i<(1<<s.size-1);i++){
t=s[0]-'0';
for(int j=0;j<s.size();j++){
if(j==s.size()-1||i&1<<j){
ans+=t;
t=0;
}
t*=10;
t+=s[j+1]-'0';
}
}
cout<<an... | a.cc: In function 'int main()':
a.cc:8:23: 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 unsign... |
s101598423 | p03999 | C++ | #include<iostream>
using namespace std;
int k(int a) {
int k = 0;
while(a) {
a /= 10;
k ++;
}
return k;
}
int main () {
int N;
cin >> N;
int bi[10];
bi[0] = 1;
for (int i = 0; i < 9; i ++) bi[i + 1] = bi[i] * 2;
int ju = keta(N);
int ans = 0;
for (int i_ = 0; i_ < bi[ju]; i_ ++) {
... | a.cc: In function 'int main()':
a.cc:18:12: error: 'keta' was not declared in this scope
18 | int ju = keta(N);
| ^~~~
a.cc:22:5: error: expected ',' or ';' before 'int'
22 | int a = N;
| ^~~
a.cc:26:16: error: 'a' was not declared in this scope
26 | ans += a % b;
... |
s266581299 | p03999 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <string>
typedef long long ll;
using namespace std;
int main()
{
ios::sync_with_stdio(false);
string s; cin >> s;
reverse(s.begin(), s.end());
ll l = s.size(), sum... | a.cc: In function 'int main()':
a.cc:21:9: error: 'n' was not declared in this scope
21 | if (n = 1){
| ^
a.cc:30:28: error: 'n' was not declared in this scope
30 | for(int j = 0; j < n - 1; j++){
| ^
|
s945470609 | p03999 | C++ | //file_name:ABC45_C.cpp
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define max... | a.cc:93:13: error: macro "rep" requires 2 arguments, but only 1 given
93 | rep()
| ^
a.cc:5:9: note: macro "rep" defined here
5 | #define rep(i,n) for(int i = 0; i < (n); ++i)
| ^~~
a.cc: In function 'int main()':
a.cc:93:9: error: 'rep' was not declared in this scope
9... |
s343140781 | p03999 | C++ | #include<iostream>
#include<vector>
#include<string>
using namespace std;
long long ctoi(char num) {
return num - '0';
}
long long eval(vector<char>s) {
vector<long long> num; vector<char>ope;
long long number = ctoi(s[0]);
for (int i = 1; i < s.size(); i++) {
if (s[i] == '+') {
ope.push_back('+');
num.pu... | a.cc: In function 'int main()':
a.cc:49:29: error: 'pow' was not declared in this scope
49 | for (int i = 0; i < pow(2, s.length()-1); i++) {
| ^~~
|
s726631826 | p03999 | C++ | S=input()
ans=0
for i in range(2**(len(S)-1)):
tmp=S[0]
for j in range(len(S)-1):
if i&(1<<j):tmp+="+"
tmp+=S[j+1]
ans+=eval(tmp)
print(ans) | a.cc:1:1: error: 'S' does not name a type
1 | S=input()
| ^
|
s443198643 | p03999 | C++ | #include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <numeric>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
int main(int argc, const char * argv[]) {
string s;
cin >> s;
int a[20];
memset(a, 0, sizeof(a));
for (int i = ... | a.cc: In function 'int main(int, const char**)':
a.cc:17:3: error: 'memset' was not declared in this scope
17 | memset(a, 0, sizeof(a));
| ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
7 | #include <numeric>
+++ |+#include <c... |
s182619261 | p03999 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
string s;
cin>>s;
int len = s.size();
int n = 1<<(len-1);
ll sum = 0;
for(int i=0 ; i<n; i++)
{
int cnt = s[0] - '0';//将字符ascii转换
for(int j=0; j<len; j++)
{
if(j==len-1||i&1<... | a.cc: In function 'int main()':
a.cc:21:20: error: expected unqualified-id before '+=' token
21 | ll +=cnt;
| ^~
|
s342243952 | p03999 | C++ | ans = 0
def dfs(S, i, cur, sum_v):
global ans
if i == len(S)-1:
ans += sum_v
return
dfs(S, i+1, int(S[i+1]), sum_v+int(S[i+1]))
dfs(S, i+1, cur*10+int(S[i+1]), sum_v+cur*9+int(S[i+1]))
S = input()
dfs(S, 0, int(S[0]), int(S[0]))
print(ans)
| a.cc:1:1: error: 'ans' does not name a type
1 | ans = 0
| ^~~
|
s502556641 | p03999 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 1000000005
#define NIL -1
ll mod = 1e9+7;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int dp[201010];
int main(){
string s; cin >> s;
ll ans = atoi(s);
for... | a.cc: In function 'int main()':
a.cc:15:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
15 | ll ans = atoi(s);
| ^
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included fr... |
s065834233 | p03999 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 1000000005
#define NIL -1
ll mod = 1e9+7;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int dp[201010];
int main(){
string s; cin >> s;
ll ans = atoi(s);
for... | a.cc: In function 'int main()':
a.cc:15:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
15 | ll ans = atoi(s);
| ^
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included fr... |
s113469568 | p03999 | C++ | #include <iostream>
#include <string.h>
using namespace std;
int main(void){
char str[15];
cin>>str;
int N;
int ans=0;
N=strlen(str);
for(int i=0;i<(1<<(N-1));i++){
int add=s[0]-'0';
int sum=0;
for(int j=0;j<N-1;j++){
if(i&(1<<j)){
sum+=a;
... | a.cc: In function 'int main()':
a.cc:11:16: error: 's' was not declared in this scope
11 | int add=s[0]-'0';
| ^
a.cc:15:21: error: 'a' was not declared in this scope
15 | sum+=a;
| ^
|
s619481405 | p03999 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
using namespace std ;
typedef long long ll ;
#define rep (i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " <<... | a.cc: In function 'int main()':
a.cc:32:19: error: request for member 'size' in 's', which is of non-class type 'll' {aka 'long long int'}
32 | int n = s.size();
| ^~~~
a.cc:38:27: error: invalid types 'll {aka long long int}[int]' for array subscript
38 | ll num = ... |
s679497786 | p03999 | C++ | s = input()
ans = 0
for i in range((len(s) - 1) ** 2):
tmp = ''
for j in range(len(s)):
tmp += s[j]
if i >> j & 1:
tmp += '+'
else:
ans += eval(tmp)
else:
print(ans) | a.cc:4:11: error: empty character constant
4 | tmp = ''
| ^~
a.cc:1:1: error: 's' does not name a type
1 | s = input()
| ^
|
s994042502 | p03999 | C | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
string g,p,q;
long long x=0,a,b,i;
cin>>g;
for(i=0;i<g.length();i++)
{
p=g.substr(0,i);
q=g.substr(0+i,g.length()-(0+i));
a=atoi( p.c_str() );
b=atoi( q.c_str() );
x=x+a+b;
}
if(atoi(g.c_str())>=10)
for(i=0;i<g.... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s688969000 | p03999 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<list>
#include<cmath>
#include<map>
using namespace std;
using ll = long long;
const int INF = 1e9;
#define rep(i,n)for(int i=0;i<n;++i)
#define p pair<int,int>
int main() {
string S;
cin >> S;
ll ans = 0;
for (int i = 0; i < 1 << S.s... | a.cc:20:39: error: macro "rep" passed 3 arguments, but takes just 2
20 | rep(j, 0, S.size() - 1) {
| ^
a.cc:11:9: note: macro "rep" defined here
11 | #define rep(i,n)for(int i=0;i<n;++i)
| ^~~
a.cc: In function 'int main()':
a.cc:20:17: err... |
s977457753 | p03999 | C++ | #include<stdio.h>
#include<iostream>
#include<string.h>
#include<cmath>
using namespace std;
char s[15];
int n;
long long int sum=0,op,p,q;
int main()
{
int i,j,k;
//freopen("we.in","r",stdin);
//freopen("we.out","w",stdout);
gets(s+1);
n=strlen(s+1);
for(i=1;i<=n;i++)
s[i]-=48;
for(i=1;i<=n;i++)
{
for(j=1;j... | a.cc: In function 'int main()':
a.cc:14:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
14 | gets(s+1);
| ^~~~
| getw
|
s058563140 | p03999 | C++ | #include<iostream>
using namespace std;
typedef long long ll;
int main(){
string s;
cin >>s;
int N=s.size();
ll ans=0;
for(int i=0;i<N;i++){
ll num=s[0] - '0';
for(int j=0;j<n-1;j++){
if(i&(1<<j)){
ans += num;
num=0;
}
num = num * 10 +a[j+1] - '0';
}
ans += num;
}
cout... | a.cc: In function 'int main()':
a.cc:12:19: error: 'n' was not declared in this scope
12 | for(int j=0;j<n-1;j++){
| ^
a.cc:17:23: error: 'a' was not declared in this scope
17 | num = num * 10 +a[j+1] - '0';
| ^
a.cc:21:18: error: 'ensdl' was not decla... |
s692491397 | p03999 | C++ | #include<iostream>
using namespace std;
int main() {
string s;
cin >> s;
int n = s.size();
long long ans = 0;
for (int i = 0;i < 1 << n - 1; i++) {
long long num = s[0] - '0';
for (int i = 0;i < n - 1;i++) {
if (t & (1 << i)) {
ans += num;
num = 0;
}
num = num * 10 + s[i + 1] - '0';
}
ans... | a.cc: In function 'int main()':
a.cc:12:29: error: 't' was not declared in this scope
12 | if (t & (1 << i)) {
| ^
|
s865155178 | p03999 | C++ | #include <iostream>
#include <cstdint>
#include <string>
#include <vector>
#include <iterator>
#include <algorithm>
int main() {
std::string s;
std::cin >> s;
std::vector<std::int_fast64_t> digits;
std::transform(s.begin(), s.end(), std::back_inserter(digits), [](const char c) {
return std::stoi(std::strin... | a.cc: In function 'int main()':
a.cc:17:54: error: 'tools' has not been declared
17 | for (std::uint_fast64_t bit_flags = 0; bit_flags < tools::pow2<std::uint_fast64_t>(digits.size() - 1); ++bit_flags) {
| ^~~~~
a.cc:17:84: error: expected primary-expressi... |
s809934461 | p03999 | C++ | #include <bits/stdc++.h>
//#include <mylib.h>
using namespace std;
//cin.sync_with_stdio(false);
#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define FOR_EQ(i,a,b) for(int i = (a); i <= (b); ++i)
#define FOR_RE(i,a,b) for(int i = (a); i > (b); --i)
#define rep(i,n) FOR(i,0,n)
#define rep_eq(i,n) FOR_EQ(i,0,n)
#de... | a.cc: In function 'int main(int, const char**)':
a.cc:38:16: error: 'N' was not declared in this scope
38 | rep(j, N - 1) {
| ^
a.cc:6:42: note: in definition of macro 'FOR'
6 | #define FOR(i,a,b) for(int i = (a); i < (b); ++i)
| ^
a.cc:... |
s922673664 | p03999 | C++ | #include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
using namespace std;
char s[102];
long long ans,n,t;
long long ww(int b,int l)
{
int ret=0,e=b+l-1;
for(int i=b;i<=e;i++)
ret=ret*10+s[i]-'0';
return ret;
}
int main()
{
scanf("%s",s+1);
int len=strlen(s+1);
sscanf(s+1,"%lld",&n);
for(in... | a.cc: In function 'int main()':
a.cc:26:21: error: expected ';' before 't'
26 | max(0,c)
| ^
| ;
27 | t=ww(j,i)*pow(2,c);
| ~
a.cc:26:16: warning: ignoring return value of 'constexpr const _Tp& std::max(const _Tp... |
s384027618 | p03999 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
using namespace std;
using ll = long long;
map <int ,int> mpa,mp... | a.cc:33:3: error: expected unqualified-id before 'return'
33 | return;
| ^~~~~~
a.cc:34:1: error: expected declaration before '}' token
34 | }
| ^
|
s883814372 | p03999 | C++ | #include <bits/stdc++.h>
using namespace std;
#define LL long long
char s[15];
int index[15];
LL A(int n)
{
LL sum=0;
index[n-1]=1;//目的就是让其有结束的时候,不写这个,那么像000这个情况就会没考虑到
/*for(int i=0; i<n; i++){
printf("%d",pos[i]);
}
printf("\n");*/
LL ss=0;
for(int i=0; i<n; i++)
{
if(in... | a.cc:5:13: error: 'int index [15]' redeclared as different kind of entity
5 | int index[15];
| ^
In file included from /usr/include/string.h:462,
from /usr/include/c++/14/cstring:43,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
fro... |
s865619991 | p03999 | C++ | #include<iostream>
#include<stdio.h>
#include<string.h>
typedef long long LL;
using namespace std;
int main()
{
char s[15];
int a[15]={0};
LL hs=0;
int flg1,flg2;
gets(s);
int n=strlen(s);
for(int i=0;i<n;i++)
{ flg1=1;flg2=1;
if(i==n-1)
{ for(int i=0;i<n;i++)
{
hs+=... | a.cc: In function 'int main()':
a.cc:12:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
12 | gets(s);
| ^~~~
| getw
|
s750555667 | p03999 | C | #include<iostream>
#include<stdio.h>
#include<string.h>
typedef long long LL;
using namespace std;
int main()
{
char s[15];
int a[15]={0};
LL hs=0;
int flg1,flg2;
gets(s);
int n=strlen(s);
for(int i=0;i<n;i++)
{ flg1=1;flg2=1;
if(i==n-1)
{ for(int i=0;i<n;i++)
{
hs+=... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s470563126 | p03999 | C++ | #include<iostream>
#include<stdio.h>
#include<string.h>
typedef long long LL;
using namespace std;
int main()
{
char s[15];
int a[15]={0};
LL hs=0;
int flg1,flg2;
gets(s);
int n=strlen(s);
for(int i=0;i<n;i++)
{ flg1=1;flg2=1;
if(i==n-1)
{ for(int i=0;i<n;i++)
{
hs+=... | a.cc: In function 'int main()':
a.cc:12:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
12 | gets(s);
| ^~~~
| getw
|
s935918279 | p03999 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
char ch[11];
char num[11]={0};
scanf("%s",ch);
int l = strlen(ch);
int sum=1;
long long cnt=0;
for(int i=0;i<l-1;i++)
sum*=2;
for(int i=0;i<sum;i++)
{
_itoa(i,num,2);
int j;
int ll =strlen(n... | a.cc: In function 'int main()':
a.cc:17:9: error: '_itoa' was not declared in this scope
17 | _itoa(i,num,2);
| ^~~~~
a.cc:24:13: error: 'itoa' was not declared in this scope
24 | itoa(i,num+j-ll,2);
| ^~~~
|
s037084673 | p03999 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
char ch[11];
char num[11]={0};
scanf("%s",ch);
int l = strlen(ch);
int sum=1;
long long cnt=0;
for(int i=0;i<l-1;i++)
sum*=2;
for(int i=0;i<sum;i++)
{
itoa(i,num,2);
int j;
int ll =strlen(nu... | a.cc: In function 'int main()':
a.cc:17:9: error: 'itoa' was not declared in this scope
17 | itoa(i,num,2);
| ^~~~
|
s001569338 | p03999 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
char ch[11];
char num[11]={0};
scanf("%s",ch);
int l = strlen(ch);
int sum=1;
long long cnt=0;
for(int i=0;i<l-1;i++)
sum*=2;
for(int i=0;i<sum;i++)
{
itoa(i,num,2);
int j;
int ll =strlen(nu... | a.cc: In function 'int main()':
a.cc:17:9: error: 'itoa' was not declared in this scope
17 | itoa(i,num,2);
| ^~~~
|
s392101456 | p03999 | C++ | #include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <string>
#include <stdio.h>
#include <math.h>
#include <string.h>
#define N 15
using namespace std;
long long number[N];
char s[N];
long long sum;
int len;
void cal()... | a.cc: In function 'int main()':
a.cc:60:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
60 | gets(s);
| ^~~~
| getw
|
s522099980 | p03999 | C++ | #include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <string>
#include <stdio.h>
#include <math.h>
#include <string.h>
#define N 15
using namespace std;
long long number[N];
char s[N];
long long sum;
int len;
void cal()... | a.cc: In function 'int main()':
a.cc:60:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
60 | gets(s);
| ^~~~
| getw
|
s496347884 | p03999 | C++ | #include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <string>
#include <stdio.h>
#include <math.h>
#include <cstring>
#define N 15
using namespace std;
long long number[N];
char s[N];
long long sum;
int len;
void cal()
... | a.cc: In function 'int main()':
a.cc:60:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
60 | gets(s);
| ^~~~
| getw
|
s384288533 | p03999 | C++ | #include <stdio.h>
#include <string.h>
int sum[15]={0};
char s[11];
int f(int i,int j)
{
int k,l,d;
for(k=i;k<=j;k++)
sum[j-k+1]+=s[k]-48;
for(l=15;l>=0;l--)
if(sum[l])
break;
for(d=1;d<=l;d++)
if(sum[d]>9)
{
sum[d+1]+=sum[d]/10;
sum[d]%=10;
}
return 0;
}
int ff(int x,int y,int d)
{
int i;
if(... | a.cc: In function 'int main()':
a.cc:39:23: error: expected ';' before 'l'
39 | scanf("%s",&s)
| ^
| ;
40 | l=strlen(s);
| ~
|
s108538148 | p03999 | C++ | #include <stdio.h>
#include <string.h>
int sum[15]={0};
char s[11];
int f(int i,int j)
{
int k,l,d;
for(k=i;k<=j;k++)
sum[j-k+1]+=s[k]-48;
for(l=15;l>=0;l--)
if(sum[l])
break;
for(d=1;d<=l;d++)
if(sum[d]>9)
{
sum[d+1]+=sum[d]/10;
sum[d]%=10;
}
return 0;
}
int ff(int x,int y,int d)
{
int i;
if(... | a.cc: In function 'int main()':
a.cc:39:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
39 | gets(s);
| ^~~~
| getw
|
s634839946 | p03999 | C++ | #include <stdio.h>
#include <string.h>
char s[11];
_int64 f(int i,int j)
{
_int64 sum=0,k,l,d;
for(k=i;k<=j;k++)
{
d=1;
for(l=1;l<=j-k;l++)
d*=10;
sum+=(s[k]-48)*d;
}
return sum;
}
_int64 ff(int x,int y,int d)
{
int i;
_int64 sum=0;
if(d==0)
return f(x,y);
for(i=x;i<=y-d;i++)
sum+=f(x,i)+ff(i... | a.cc:4:1: error: '_int64' does not name a type
4 | _int64 f(int i,int j)
| ^~~~~~
a.cc:16:1: error: '_int64' does not name a type
16 | _int64 ff(int x,int y,int d)
| ^~~~~~
a.cc: In function 'int main()':
a.cc:29:9: error: '_int64' was not declared in this scope
29 | _int64 sum=0;
| ... |
s660735106 | p03999 | C++ | #include<iostream>
#include<string>
#include<stdlib.h>
using namespace std;
long long ans = 0;
void dfs(long long s,long long n)
{
if (s == 0) ans+=n;
else {
int t = log10(s);
//ans += s;
while (t >= 0)
{
long long a = s / pow(10, t);
//ans += a+n;
// cout << a << endl;
long long b = s - a*pow(10... | a.cc: In function 'void dfs(long long int, long long int)':
a.cc:10:25: error: 'log10' was not declared in this scope
10 | int t = log10(s);
| ^~~~~
a.cc:14:43: error: 'pow' was not declared in this scope
14 | long long a = s / pow(10, t);
... |
s367322177 | p03999 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#include <cstdlib>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#def... | a.cc: In function 'int main()':
a.cc:28:8: error: 'S' was not declared in this scope
28 | cin>>S;
| ^
a.cc:36:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
36 | cnt+=num*K;
| ^~~
| int
a.cc:39:9: error: 'cnt' was not declared in this scope; did yo... |
s977026593 | p03999 | C++ | // code by MC
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
#include<sstream>
#include<cmath>
#include<string>
#include<vector>
#include<deque>
#include<set>
#include<bitset>
#include<map>
#include<functional>
#include<utility>
#include<cstdio>
#include<cstdlib>
#include<c... | a.cc:24:9: fatal error: IOS: No such file or directory
24 | #include<IOS>
| ^~~~~
compilation terminated.
|
s595146931 | p03999 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String S = sc.next();
int len = S.length();
long sum = 0;
for(int i = len - 1; i >= 0; i--) {
String s = String.valueOf(S.charAt(i));
long digit = Integer.parseLong(s)... | Main.java:11: error: cannot find symbol
long digit = Integer.parseLong(s);
^
symbol: method parseLong(String)
location: class Integer
1 error
|
s432712724 | p03999 | C++ | #include <stdio.h>
char s[11];
typedef long long ll;
ll res = 0;
int p[11], sz=0;
void solve(int a, ll b, ll c) {
if (!s[a]) {
res += b+c;
return;
}
solve(a+1, b+c, s[a]-'0');
solve(a+1, b, (s[a]-'0')+c*10);
}
int main(void) {
scanf_s("%s", s);
solve(0, 0, 0);
printf("%lld\n", res/2);
... | a.cc: In function 'int main()':
a.cc:19:3: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
19 | scanf_s("%s", s);
| ^~~~~~~
| scanf
|
s070683167 | p03999 | C++ | #include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<string> hako;
void saiki(string cs,int i){
if(i>=cs.length()) hako.push_back(cs);
else {
saiki(cs,i+1);
saiki(cs.insert(i,"+"),i+2);
}
}
int main(void){
int i,j,k;
string s;
i... | a.cc: In function 'int main()':
a.cc:26:3: error: 'N' was not declared in this scope
26 | N=k+k-1;
| ^
|
s890775516 | p03999 | C++ | #include <vector>
#include <string>
using namespace std;
int N;
vector<string> hako;
void saiki(string cs,int i){
if(i>=cs.length()) hako.push_back(cs);
else {
saiki(cs,i+1);
saiki(cs.insert(i,"+"),i+2);
}
}
int main(void){
int i,j,k;
string s;
int a,b,c;
long long int res,tmp,t;
cin>>s;
tm... | a.cc: In function 'int main()':
a.cc:21:3: error: 'cin' was not declared in this scope
21 | cin>>s;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <string>
+++ |+#include <iostream>
3 | using namespace std;... |
s494066398 | p03999 | C++ | #include<iostream>
#include<string>
#include <math.h>
using namespace std;
int main() {
string s;
__int64 ans =0;
__int64 a[10];
cin >> s;
int array_length = s.length();
for(int i=0;i<array_length;i++){
a[i] = s[i]-'0';
}
int n=1;
int nn=1;
int nnn=1;
int temp;
int b = array_length;
for(int i=0;i<array_... | a.cc: In function 'int main()':
a.cc:8:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
8 | __int64 ans =0;
| ^~~~~~~
| __ynf64
a.cc:9:16: error: expected ';' before 'a'
9 | __int64 a[10];
| ^~
| ;
a... |
s636610164 | p03999 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
string s;
long long int ans =0;
long long int a[10];
cin >> s;
int array_length = s.length();
for(int i=0;i<array_length;i++){
a[i] = s[i]-'0';
}
int n=1;
int nn=1;
int nnn=1;
int temp;
int b = array_length;
for(int i=0;i<array_length... | a.cc: In function 'int main()':
a.cc:22:43: error: 'pow' was not declared in this scope
22 | ans += a[i] * n * pow(10,temp);
| ^~~
|
s225939692 | p03999 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
string s;
__int64 ans =0;
__int64 a[10];
cin >> s;
int array_length = s.length();
for(int i=0;i<array_length;i++){
a[i] = s[i]-'0';
}
int n=1;
int nn=1;
int nnn=1;
int temp;
int b = array_length;
for(int i=0;i<array_length;i++){
tem... | a.cc: In function 'int main()':
a.cc:7:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
7 | __int64 ans =0;
| ^~~~~~~
| __int64_t
a.cc:8:16: error: expected ';' before 'a'
8 | __int64 a[10];
| ^~
| ... |
s792193574 | p03999 | C++ | # coding: utf-8
answer = 0
def calc(leftnum, sum, tempsum , is_insert):
hitoketa = leftnum % 10
leftnum = int(leftnum / 10)
if tempsum == 0:
tempsum = hitoketa
else:
tempsum = int(str(hitoketa) + str(tempsum))
if is_insert:
sum += tempsum
tempsum = 0
if lef... | a.cc:1:3: error: invalid preprocessing directive #coding
1 | # coding: utf-8
| ^~~~~~
a.cc:29:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
29 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:3:1: error: 'answer' does not name a type
3 | answe... |
s501677772 | p03999 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//double pi=3.1415926535898;
//double pi=acos(-1.0);
#define scarr(a,s,e) for(int i=s;i<=int(e);i++) scanf("%d ",&a[i]);
#define prarr(a,s,e) for(int i=s;i<=int(e);i++) printf("%d ",a[i]);
#define speed ios::sync_with_stdio(false);cin.tie(NULL); ... | a.cc:35:16: warning: overflow in conversion from 'double' to 'll' {aka 'long long int'} changes value from '1.0e+19' to '9223372036854775807' [-Woverflow]
35 | const ll inf = 1e19 ;
| ^~~~
a.cc: In function 'void solve(ll, ll, ll)':
a.cc:42:11: error: 'n' was not declared in this scope
42 | ... |
s555131583 | p03999 | C++ | #include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdlib.h>
using namespace std;
long long int calc(long long int pre, int offset, const char *str) {
long long int res = 0;
string tmp = "";
char* pEnd;
if (strlen(str) == offset) {
res = pre + strtoll(str, ... | a.cc: In function 'long long int calc(long long int, int, const char*)':
a.cc:16:13: error: 'strlen' was not declared in this scope
16 | if (strlen(str) == offset) {
| ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
... |
s249547579 | p03999 | C++ | #include<stdio.h>
typedef long long int ll;
char a[11];
ll as(int b, ll c. ll d){
if(a[b]=='\0') return c+d;
else return as(b+1, c*10+a[n]-'0')+as(b+1,a[b]-'0',d+c);
}
int main(){
scanf("%s",a);
printf("%lld\n",as(1,a[0]-'0',0));
return 0;
} | a.cc:4:18: error: expected ',' or '...' before '.' token
4 | ll as(int b, ll c. ll d){
| ^
a.cc: In function 'll as(int, ll)':
a.cc:5:33: error: 'd' was not declared in this scope
5 | if(a[b]=='\0') return c+d;
| ^
a.cc:6:36: error: 'n' was no... |
s251761367 | p03999 | C++ | #include<stdio.h>
typedef long long int ll;
char a[11];
ll as(int b, ll c, ll d){
if(a[b]=='\0') return c+d
else return as(b+1, c*10+a[b]-'0',d)+as(b+1,a[b]-'0',d+c);
}
int main(){
scanf("%s",a);
printf("%11d\n",as(1,a[0]-'0',0));
} | a.cc: In function 'll as(int, ll, ll)':
a.cc:5:34: error: expected ';' before 'else'
5 | if(a[b]=='\0') return c+d
| ^
| ;
6 | else return as(b+1, c*10+a[b]-'0',d)+as(b+1,a[b]-'0',d+c);
| ~~~~ ... |
s344250433 | p03999 | C++ | #include<stdio.h>
typedef long long int ll;
char a[11];
ll as(int b, ll c, ll d){
if(a[b]=='\0') return c+d;
else return as(b+1, c*10+a[b]-'0',d)+as(b+1,a[b]-'0',d+c);
}
int mian(){
scanf("%s",a);
printf("%11d\n",as(1,a[0]-'0',0));
return 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
|
s326516412 | p03999 | C++ | #include<stdio.h>
typedef long long int ll
char a[11];
ll as(int b, ll c, ll d){
if(a[b]=='\0') return c+d
else return as(b+1, c*10+a[b]-'0',d)+as(b+1,a[b]-'0',d+c);
}
int main(){
scanf("%s",a);
printf("%11d\n",as(1,a[0]-'0',0));
} | a.cc:3:1: error: expected initializer before 'char'
3 | char a[11];
| ^~~~
a.cc:4:1: error: 'll' does not name a type
4 | ll as(int b, ll c, ll d){
| ^~
a.cc: In function 'int main()':
a.cc:10:20: error: 'a' was not declared in this scope
10 | scanf("%s",a);
| ^
a... |
s725497740 | p03999 | C++ | #include <stdio.h>
typedef long long int ll;
char a[11];
ll as(int b, llc, lld){
if(a[b]=='\0') return c+d;
else return as(b+1, c*10+a[b]-'0',d)+as(b+1,a[b]-'0',d+c);
}
int main(){
scanf("%s",a);
printf("%lld",as(1,a[0]-'0',0));
return 0;
} | a.cc:4:14: error: 'llc' has not been declared
4 | ll as(int b, llc, lld){
| ^~~
a.cc:4:19: error: 'lld' has not been declared
4 | ll as(int b, llc, lld){
| ^~~
a.cc: In function 'll as(int, int, int)':
a.cc:5:31: error: 'c' was not declared in this scope
5 | ... |
s211640838 | p03999 | C++ |
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#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 <cs... | a.cc:162:31: error: macro "rep" passed 3 arguments, but takes just 2
162 | rep(i, 0, 1 << (N - 1)) {
| ^
a.cc:43:9: note: macro "rep" defined here
43 | #define rep(i,n) FOR(i,0,n)
| ^~~
a.cc:165:32: error: macro "rep" passed 3 arguments, but takes just 2
... |
s894120324 | p03999 | C++ | #include <iostream>
#include <vector>
//#include <cstdio>
//#include <cstdlib>
#include <sstream>
using namespace std;
int stoi(string s)
{
int x;
istringstream stream(s);
stream >> x;
return x;
}
vector<int> split(const string &input, char delimiter)
{
istringstream stream(input);
string field;
vector... | a.cc: In function 'std::vector<int> split(const std::string&, char)':
a.cc:23:26: error: call of overloaded 'stoi(std::string&)' is ambiguous
23 | result.push_back(stoi(field));
| ~~~~^~~~~~~
a.cc:9:5: note: candidate: 'int stoi(std::string)'
9 | int stoi(string s)
| ^~~~... |
s184090095 | p03999 | C++ | int power10_memo[11];
int fact_memo[11];
int nchoosek(int n, int k){
return fact_memo[n]/(fact_memo[n-k]*fact_memo[k]);
}
long long formulas(string in){
vector<int> digit_nums;
fact_memo[0] = 1;
power10_memo[0] = 1;
for(int i = 1; i < 11; i++){
fact_memo[i] = fact_memo[i-1]*i;
... | a.cc:7:20: error: 'string' was not declared in this scope
7 | long long formulas(string in){
| ^~~~~~
a.cc: In function 'int main()':
a.cc:37:5: error: 'string' was not declared in this scope
37 | string input;
| ^~~~~~
a.cc:38:5: error: 'cin' was not declared in this scope... |
s606634587 | p03999 | C++ | long a,b;main(i,c){for(;c=getchar()-48,c>0;b=b*10+i*c,i*=2)a+=a+b;printf("%ld\n",a+b);}/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... | a.cc:1:14: error: expected constructor, destructor, or type conversion before '(' token
1 | long a,b;main(i,c){for(;c=getchar()-48,c>0;b=b*10+i*c,i*=2)a+=a+b;printf("%ld\n",a+b);}/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... |
s028007884 | p03999 | C++ | long a,b;main(i,c){for(;c=getchar()-48,c>0;b=b*10+i*c,i*=2)a+=a+b;printf("%ld\n",a+b);}/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... | a.cc:1:14: error: expected constructor, destructor, or type conversion before '(' token
1 | long a,b;main(i,c){for(;c=getchar()-48,c>0;b=b*10+i*c,i*=2)a+=a+b;printf("%ld\n",a+b);}/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... |
s161986954 | p03999 | C++ | long a,b,i;main(c){for(;c=getchar()-48,c;b=b*10+(1l<<i++)*c)a+=a+b;printf("%ld\n",a+b);} | a.cc:1:16: error: expected constructor, destructor, or type conversion before '(' token
1 | long a,b,i;main(c){for(;c=getchar()-48,c;b=b*10+(1l<<i++)*c)a+=a+b;printf("%ld\n",a+b);}
| ^
|
s785180310 | p03999 | C++ | #include<iostream>
#include<string>
using namespace std;
int main()
{
char str[11];
int s = 0, ss = 0, l, m[11], a, b, c;
cin >> str;
l = strlen(str);
for (a = 0; a < l; a++) {
for (b = 0; b < l - a; b++) {
for (c = 0; c < a; c++) {
m[c] = str[c];
s = s * 10 + m[c];
}
cout << s << endl;
... | a.cc: In function 'int main()':
a.cc:13:13: error: 'strlen' was not declared in this scope
13 | l = strlen(str);
| ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
... |
s709786722 | p03999 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <utility>
using namespace std;
int main(){
_int64 s, m[10],sum;
cin >> s;
int j = 0;
while (1){
m[j] = s % 10;
s = s / 10;
j++;
if (s == 0)break;
}
//sはj桁の数、m[0]は一の位
sum = 0;
for (int i = 0; i < pow(2, j - 1); i++){
... | a.cc: In function 'int main()':
a.cc:9:9: error: '_int64' was not declared in this scope; did you mean 'sinf64'?
9 | _int64 s, m[10],sum;
| ^~~~~~
| sinf64
a.cc:10:16: error: 's' was not declared in this scope
10 | cin >> s;
| ^
a.cc:13:17: error: ... |
s091684976 | p03999 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
typedef long long ll;
using namespace std;
string S;
ll ans = 0;
int keta(ll num) {
int ret = 0;
while (num > 0) {
ret++;
num /= 10;
}
return ret;
}
ll stoi(string s) {
ll ten = 1;
ll ans = 0;
for (int i=s.length()-1; i>... | a.cc: In function 'int main()':
a.cc:44:43: error: call of overloaded 'stoi(std::string&)' is ambiguous
44 | wa += stoi(pre_num);
| ~~~~^~~~~~~~~
a.cc:20:4: note: candidate: 'll stoi(std::string)'
20 | ll stoi(string s) {
| ^~~~
... |
s382949048 | p04000 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_b... | a.cc: In function 'int main()':
a.cc:573:18: error: no matching function for call to 'max(int, long long int)'
573 | for(int j=max(1,d[i].fi-2);j<=min(a,d[i].fi+2);j++){
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-g... |
s345109922 | p04000 | C++ | #ifndef _TEMPLATE_ROOT
#define _TEMPLATE_ROOT
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define repl(i, a, b) for(ll i = a; i < (b); ++i)
#define repd(i, a, b) for(int i = b; i >= (a); --i)
#define repdl(i, a, b) for(ll i = b; i >= (a); --i)
#define all(x) begin(x),... | a.cc: In function 'int main()':
a.cc:49:20: error: wrong number of template arguments (1, should be at least 2)
49 | map<pair<int, int>> cons;
| ^~
In file included from /usr/include/c++/14/map:63,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
... |
s671759194 | p04000 | C | #include<stdio.h>
#include<math.h>
int main(){
int a[10000][2];
int f[10000];
int list[5][5];
int k[10];
int h,w,n,i,j,k,x,y,z,x2,y2;
for(i=0;i<10;i++)k[i]=0;
scanf("%d%d%d",&h,&w,&n);
for(i=0;i<n;i++){
scanf("%d%d",&a[i][0],&a[i][1]);
f[i]=0;
if(a[i][0]-2<1||a[i][0]+2>w)f[i]|=(1<<1)+(1<<4)+... | main.c: In function 'main':
main.c:8:17: error: conflicting types for 'k'; have 'int'
8 | int h,w,n,i,j,k,x,y,z,x2,y2;
| ^
main.c:7:7: note: previous declaration of 'k' with type 'int[10]'
7 | int k[10];
| ^
main.c:26:10: error: implicit declaration of function 'abs' [-Wimp... |
s164704787 | p04000 | 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:28:31: error: conflicting declaration 'std::vector<long long int> S'
28 | vi R={0,0,1,1,1,-1,-1,-1,0},S={1,-1,0,-1,1,-1,0,1,0};
| ^
a.cc:23:12: note: previous declaration as 'std::set<std::pair<long long int, long long int> > S'
23 | set... |
s584777962 | p04000 | C++ | #include<bits/stdc++.h>
#define rep(i, s, n) for (int i=(s); i<(n); i++)
#define ll long long
using namespace std;
int main() {
set<pair<int, int>> S;
set<pair<int, int>> S2;
ll H,W,N;
ll res[10];
cin>>H>>W>>N;
rep(i, 0, N) {
int x,y; cin>>x>>y;
S.insert({x, y});
rep(j, -1, 2) {
rep(k, -1... | a.cc:34:1: error: 'F' does not name a type
34 | F
| ^
|
s722703813 | p04000 | C++ | import sys
input = sys.stdin.readline
from collections import Counter
h,w,n=map(int,input().split())
c=Counter()
for _ in range(n):
a,b=map(int,input().split())
for i in [-1,0,1]:
for j in [-1,0,1]:
if 2<=a+i<w and 2<=b+j<h:
c[a+i,b+j]+=1
#print(c.items())
c2=Counter(c.values... | a.cc:12:2: error: invalid preprocessing directive #print
12 | #print(c.items())
| ^~~~~
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'
|
s609730551 | p04000 | Java | import java.util.*;
import javafx.util.Pair;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int H = Integer.parseInt(sc.next());
int W = Integer.parseInt(sc.next());
int N = Integer.parseInt(sc.next());
// HashMap<ArrayList<... | Main.java:2: error: package javafx.util does not exist
import javafx.util.Pair;
^
Main.java:11: error: cannot find symbol
HashMap<Pair<Integer, Integer>, Integer> map = new HashMap<Pair<Integer, Integer>, Integer>();
^
symbol: class Pair
location: class Main
Main.java:11:... |
s348316186 | p04000 | Java | import java.util.*;
import javafx.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int H = Integer.parseInt(sc.next());
int W = Integer.parseInt(sc.next());
int N = Integer.parseInt(sc.next());
// HashMap<ArrayList<Int... | Main.java:2: error: package javafx.util does not exist
import javafx.util.*;
^
Main.java:11: error: cannot find symbol
HashMap<Pair<Integer, Integer>, Integer> map = new HashMap<Pair<Integer, Integer>, Integer>();
^
symbol: class Pair
location: class Main
Main.java:11: error: cannot find s... |
s034132557 | p04000 | C++ | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define f first
#define s second
#define all(container) container.begin(),container.end()
#define fast ios::sync_with_stdio(0); cin.tie(0)
#ifndef ONLINE_JUDGE
#include "debug.cpp"
#endif
#define int long long
const int mod = 1e9+7;
int power(int a,int... | a.cc:9:10: fatal error: debug.cpp: No such file or directory
9 | #include "debug.cpp"
| ^~~~~~~~~~~
compilation terminated.
|
s193867962 | p04000 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<un... | a.cc: In function 'void solve()':
a.cc:61:37: error: wrong type argument to unary minus
61 | if(x[i].fr - a >= - && x[i].sc - b >= 0) mp[P(x[i].fr - a, x[i].sc - b)] ++;
| ^~~~
a.cc:61:41: error: expected ')' before '[' token
61 | if(x[i].f... |
s494637208 | p04000 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<un... | a.cc: In function 'void solve()':
a.cc:43:12: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
43 | #define fr first
| ^~~~~
a.cc:58:18: note: in expansion of macro 'fr'
58 | cin >> x.fr >> x.sc;
| ^~
a.cc:44:12: error: 'class std::vector... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.