submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s673718867
p00029
C++
import java.io.*; public class aoj0029 { public static void main(String[] args) throws IOException{ BufferedReader buf = new BufferedReader(new InputStreamReader(System.in)); String s; String tmp = ""; String sizetmp = ""; int cmax = -1; int max = -1; int cnt; s = buf.readLine(); ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class aoj0029 { | ^~~~~~
s790402225
p00029
C++
#include <iostream> #include <map> int main() { std::string word, longest, freqest; std::map<std::string, int> table; //入力 while (std::cin >> word) ++table[word]; //演算 longest = table.begin()->first; freqest = table.begin()->first; for (std::map<string, int>::iterator it = table.begin(); it != table.end(); ++i...
a.cc: In function 'int main()': a.cc:12:23: error: 'string' was not declared in this scope 12 | for (std::map<string, int>::iterator it = table.begin(); it != table.end(); ++it) { | ^~~~~~ a.cc:12:23: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:4...
s146236357
p00029
C++
#include <iostream> #include <string> #include <map> using namespace std; int main(){ string s,t,u; int m=0,l=0; map<string,int>m; for(;cin>>u;){ if(++m[u]>m)s=u; if(t.size()<u.size())t=u; } cout<<s<<' '<<t<<endl; }
a.cc: In function 'int main()': a.cc:8:24: error: conflicting declaration 'std::map<std::__cxx11::basic_string<char>, int> m' 8 | map<string,int>m; | ^ a.cc:7:13: note: previous declaration as 'int m' 7 | int m=0,l=0; | ^ a.cc:10:23: error: no match...
s979739702
p00029
C++
#include<iostream> #include<cstring> using namespace std; int const N = 1001; int main(){ char str[N][50]; int num[N],i=0,max=0,l=0; while(cin >> str[i]){ i++; } for(int j=0;j<i;j++){ num[j]=0; } for(int j=0;j<i;j++){ for(int k=0;k<i;k++){ if(strcmp(str[j],str[k])==0) num[j]++; } if(num[max] < num...
a.cc:26:8: error: stray '@' in program 26 | [tebora@tebora | ^ a.cc:26:1: error: expected unqualified-id before '[' token 26 | [tebora@tebora | ^
s675989368
p00029
C++
#include <iostream> using namespace std ; int main() { char get[1000][40] ; char mode[40] ; char longest[40] ; int count = 0 ; int lest = -1 ; int tmp = 0 ; int most = 0 ; int mnum = -1 ; int i = 0 ; while( cin >> get[i] ) { if( count < strlen(get[i]) ) { count = strlen(get[i]) ; lest = i ; ...
a.cc: In function 'int main()': a.cc:22:29: error: 'strlen' was not declared in this scope 22 | if( count < strlen(get[i]) ) | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <...
s684626903
p00029
C++
#include <iostream> #include <string> using namespace std; int main() { char s[1000]; int n=0; cin.getline(s,1000); string tok[1000]; char *sep=" ,."; char *word; word = strtok(s,sep); while(word != NULL) { tok[n] = word; n++; word=strtok(NULL,sep); } int f=1,fmax=1; string max, freq; max=tok[0]; f...
a.cc: In function 'int main()': a.cc:12:19: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 12 | char *sep=" ,."; | ^~~~~ a.cc:14:16: error: 'strtok' was not declared in this scope; did you mean 'strtoq'? 14 | word = strtok(s,sep); |...
s850994296
p00029
C++
#include <iostream> #include <string> using namespace std; int main() { char s[1000]; int n=0; cin.getline(s,1000); string tok[1000]; char *sep=" ,."; char *word; word = strtok(s,sep); while(word != NULL) { tok[n] = word; n++; word=strtok(NULL,sep); } int f=1,fmax=1; string max, freq; max=tok[0]; f...
a.cc: In function 'int main()': a.cc:12:19: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 12 | char *sep=" ,."; | ^~~~~ a.cc:14:16: error: 'strtok' was not declared in this scope; did you mean 'strtoq'? 14 | word = strtok(s,sep); |...
s881851386
p00029
C++
#include<stdio.h> #include<malloc.h> #include<string.h> #include<stdlib.h> typedef struct wordtree{ struct wordtree *next; struct wordtree *prev; char *txt; int t_num; int t_size; }wordtree; wordtree *initTree(char *msg,int num,int size){ wordtree *x; x=(wordtree *)malloc(sizeof(wordtree)); x->prev=NULL; x->...
a.cc:25:11: error: 'often' does not name a type 25 | int cnt=0;often=0;length=0; | ^~~~~ a.cc:25:19: error: 'length' does not name a type 25 | int cnt=0;often=0;length=0; | ^~~~~~ a.cc: In function 'void graphtree(wordtree*, int)': a.cc:30:40: error: 'often' was not declare...
s758570660
p00029
C++
#include <map> #include <iostream> using namespace std; /** Problem0029 : English Sentence **/ int main() { map<string, int> sentences; pair<string, int> t; string tmp, maxLength; while (cin >> tmp) { if (tmp.length() > maxLength.length()) maxLength = tmp; if (sentences.count(tmp) == 0) { sentences...
a.cc: In function 'int main()': a.cc:24:14: error: 'max_element' was not declared in this scope 24 | t = *max_element(sentences.begin(), sentences.end()); | ^~~~~~~~~~~
s425410747
p00029
C++
#include <stdio> #include <string> char str[50]; char word[1000][50]; int count[1000]; int main(void) { int i, j, ind, ind2; int c, len = 0; i = 0; while (scanf("%s", str) != EOF){ c = 1; for (j = 0; j < i; j++){ if (strcmp(str, word[j]) == 0){ count[j]++; c = 0; } } if (c == 1){...
a.cc:1:10: fatal error: stdio: No such file or directory 1 | #include <stdio> | ^~~~~~~ compilation terminated.
s390396656
p00030
Java
import java.util.Scanner; //AOJ:0030 public class Main { int selval; int sumval; int res = 0; void run(){ Scanner sc = new Scanner(System.in); while(true){ selval = sc.nextInt(); sumval = sc.nextInt(); calc(0,0,selval); System.out.println(res++); res = 0; } } // i:???????????? // sum:????¨...
Main.java:35: error: reached end of file while parsing } ^ 1 error
s970684449
p00030
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; int count: while(!(line=br.readLine()).equals("0 0")){ String[] value=line.split(" "); int n=Integer.parseInt(value[0]); int s=Integer.parseInt(v...
Main.java:7: error: ';' expected int count: ^ 1 error
s975924590
p00030
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; int count=0; while(!(line=br.readLine()).equals("0 0")){ String[] value=line.split(" "); int n=Integer.parseInt(value[0]); int s=Integer.parseInt...
Main.java:18: error: cannot find symbol if(sum==s){ ^ symbol: variable s location: class Main Main.java:19: error: cannot find symbol count++; ^ symbol: variable count location: class Main 2 errors
s872368453
p00030
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; int count=0; while(!(line=br.readLine()).equals("0 0")){ String[] value=line.split(" "); int n=Integer.parseInt(value[0]); int s=Integer.parseInt...
Main.java:19: error: cannot find symbol count++; ^ symbol: variable count location: class Main 1 error
s570879010
p00030
Java
import java.io.*; class Main{ int count; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; while(!(line=br.readLine()).equals("0 0")){ String[] value=line.split(" "); int n=Integer.parseInt(value[0]); int s=Integer.parseInt(v...
Main.java:13: error: non-static variable count cannot be referenced from a static context System.out.println(count); ^ Main.java:19: error: non-static variable count cannot be referenced from a static context count++; ^ Main.java:27: error: non-static variable count cannot be referenced from a static...
s337962897
p00030
Java
import java.io.*; class Main{ static int count; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; while(!(line=br.readLine()).equals("0 0")){ String[] value=line.split(" "); int n=Integer.parseInt(value[0]); int s=Integer.par...
Main.java:27: error: method search in class Main cannot be applied to given types; search(i+1,n-1,sum+a,s,count); ^ required: int,int,int,int found: int,int,int,int,int reason: actual and formal argument lists differ in length 1 error
s717475751
p00030
Java
import java.util.*; public class A{ private static final Scanner scan = new Scanner(System.in); static int count = 0; public static void main(String[] args){ for(;;){ count = 0; int n = scan.nextInt(); int s = scan.nextInt(); if(n == 0 && s == 0)break; solve(0, n, s); System.out.printf("%d\n",...
Main.java:3: error: class A is public, should be declared in a file named A.java public class A{ ^ 1 error
s606147724
p00030
Java
import java.util.*; public class Main{ static ArrayList<Integer[]> fr = new ArrayList<Integer[]>(); static ArrayList<Integer[]> to = new ArrayList<Integer[]>(); private static final Scanner scan = new Scanner(System.in); static int count = 0; public static void main(String[] args){ for(;;){ int n = scan....
Main.java:28: error: cannot find symbol if(sa[1] == 1 && sd[0] == sd[2])count++; ^ symbol: variable sa location: class Main 1 error
s674854491
p00030
Java
import javafx.util.Pair; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int n = sc.nextInt(); int s = sc.nextInt(); if(n==0&&s==0)break; System.out.pri...
Main.java:1: error: package javafx.util does not exist import javafx.util.Pair; ^ 1 error
s042298146
p00030
Java
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String line = null; while (!(line = sc.next()).equals("0 0")) { String str[] = line.split(" ", 2); int n = Integer.parseInt(str[0]); int s = Integer.pa...
Main.java:13: error: cannot find symbol System.out.println(dfs(n, s, 0)); ^ symbol: variable n location: class Main Main.java:13: error: cannot find symbol System.out.println(dfs(n, s, 0)); ^ symbol: variable s location: class Main 2 errors
s454389542
p00030
Java
import java.util.Scanner; public class Main{ public static int n; public static int s; public static int count; public static int[] a = new int[10]; public static void main(String[] args){ Scanner scanner = new Scanner(System.in); while(true){ n = scanner.nextInt(); s = scanner.nextInt()...
Main.java:22: error: reached end of file while parsing } ^ 1 error
s468320593
p00030
Java
import java.util.Scanner; public class AOJ0030 { static int num,n,s; static void dfs(int depth,int begin,int sum) { if(depth==n) { if(sum==s)++num; return; } for(int i=begin;i<=9;++i) { if(sum+i<=s) { dfs(depth+1,i+1,sum+i); } } } public static void main(String[] args) { Scan...
Main.java:3: error: class AOJ0030 is public, should be declared in a file named AOJ0030.java public class AOJ0030 { ^ 1 error
s737708577
p00030
C
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<math.h> int main() { int a, b, ans[1024],num[1024]; for (int i = 0; i < 1024; i++) { ans[i] = 0; num[i] = 0; for (int j = 0; j < 10; j++) { int m = 1; for (int k = 0; k < j; k++)m *= 2; if (i / m % 2 == 1) { ans[i] += j; num[i]++; }...
main.c: In function 'main': main.c:19:16: error: 'true' undeclared (first use in this function) 19 | while (true) { | ^~~~ main.c:4:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 3 | #include<math.h> +++ |+#include <std...
s569748282
p00030
C
#include <stdio.h> void solve(int i,int sum,int n); int A[]={0,1,2,3,4,5,6,7,8,9}; const int N = sizeof(A[])/sizeof(A[0]); int Num,Sum,Ans; int main(void){ char str[buf]; for( ; ; ){ Ans=0; fgets(str,sizeof(str),stdin); sscanf(str,"%d %d",&Num,&Sum); if(Num==0 && Sum==0) break; solve(0,0,0); printf...
main.c:4:24: error: expected expression before ']' token 4 | const int N = sizeof(A[])/sizeof(A[0]); | ^ main.c: In function 'main': main.c:8:18: error: 'buf' undeclared (first use in this function) 8 | char str[buf]; | ^~~ main.c:8:18: note: each unde...
s857455719
p00030
C
#include <stdio.h> void solve(int i,int sum,int n); int A[100]={0,1,2,3,4,5,6,7,8,9}; const int N = sizeof(A[100])/sizeof(A[0]); int Num,Sum,Ans; int main(void){ char str[buf]; for( ; ; ){ Ans=0; fgets(str,sizeof(str),stdin); sscanf(str,"%d %d",&Num,&Sum); if(Num==0 && Sum==0) break; solve(0,0,0); ...
main.c: In function 'main': main.c:8:18: error: 'buf' undeclared (first use in this function) 8 | char str[buf]; | ^~~ main.c:8:18: note: each undeclared identifier is reported only once for each function it appears in
s705066454
p00030
C
#include <stdio.h> void solve(int i,int sum,int n); int A[]={0,1,2,3,4,5,6,7,8,9}; int N = sizeof(A[])/sizeof(A[0]); int Num,Sum,Ans; int main(void){ char str[buf]; for( ; ; ){ Ans=0; fgets(str,sizeof(str),stdin); sscanf(str,"%d %d",&Num,&Sum); if(Num==0 && Sum==0) break; solve(0,0,0); printf("%d\n...
main.c:4:18: error: expected expression before ']' token 4 | int N = sizeof(A[])/sizeof(A[0]); | ^ main.c: In function 'main': main.c:8:18: error: 'buf' undeclared (first use in this function) 8 | char str[buf]; | ^~~ main.c:8:18: note: each undeclared ident...
s840301759
p00030
C
#include<stdio.h> int main() int n,s,count=0; int digits[10]; void dfs(int cur){ if(cur==n){ int sum=0; for(int i=0;i<n;i++){ sum+=digits[i]; } if(sum==s){ count++; } return; } for(int i=0;i<10;i++){ digits[cur]=i; dfs(cur+1); } }
main.c: In function 'main': main.c:3:1: error: parameter 'count' is initialized 3 | int n,s,count=0; | ^~~ main.c:5:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 5 | void dfs(int cur){ | ^ main.c:4:5: error: declaration for parameter 'digits' but no su...
s177146942
p00030
C
#include<stdio.h> int n,s,count=0; int digits[10]; int dfs(int cur){ if(cur==n){ int sum=0; for(int i==0;i<n;i++){ sum += digits[i]; } if(sum == s){ count++; } return; } for(int i=start; i<10; i++){ digits[cur] = i; dfs(cur+1 , i+1); } } int main(void){ while(scanf("%d %d",&n,&s) != EOF) { if(n...
main.c: In function 'dfs': main.c:10:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '==' token 10 | for(int i==0;i<n;i++){ | ^~ main.c:10:22: error: 'i' undeclared (first use in this function) 10 | for(int i==0;i<n;i++){ | ^ mai...
s745447299
p00030
C
#include <stdio.h> int n, s, count = 0, digits[10]; // n 個の整数の和がsになる void dfs(int cur) { // cur = 0 {} if(cur == n) { // cur = 1 {a} int sum = 0; // cur = 2 {a, b} for(int i = 0; i < n; i++) { sum += digits[i]; } if(sum == s) { count++; } retur...
main.c: In function 'main': main.c:22:5: error: implicit declaration of function 'func' [-Wimplicit-function-declaration] 22 | func(0,0,0); | ^~~~
s229683086
p00030
C
#include <iostream>using namespace std; int dfs(int n, int s, int x){ int sum=0; if(n==0 && s==0) return 1; if(n>0){ for(int i=x; i<10; i++){ if(s-i>=0) sum+=dfs(n-1, s-i, i+1); } } return sum;} int main(void){ int n, s; while(cin >> n >> s){ if(n==0 && s==0) break; c...
main.c:1:20: warning: extra tokens at end of #include directive 1 | #include <iostream>using namespace std; int dfs(int n, int s, int x){ int sum=0; if(n==0 && s==0) return 1; if(n>0){ for(int i=x; i<10; i++){ if(s-i>=0) sum+=dfs(n-1, s-i, i+1); } } return sum;} int main(void){ i...
s794694049
p00030
C
#include <stdio.h> int n,s,count = 0, digits[10]; void dfs(int cur,int start){ if(cur == n){ int sum = 0; for(int i = 0; i < n; i++){sum += digits[i];} if(sum == s){count++;} return; } for(int i = start; i < 10; i++){ digits[cur] = i; dfs(cur+1,i+1); } in...
main.c: In function 'dfs': main.c:19:1: error: expected declaration or statement at end of input 19 | } | ^
s138764218
p00030
C
#include <stdio.h> int combOfSum(int cnt,int sum,int minNum){ int i; int result=0; if(cnt==0){ /* printf("C:%d‚±‚Å%d‚É‚·‚é:%d\n",cnt,sum,(sum==0)); */ return (sum==0); }else if(minNum==9 && cnt==1-){ /* printf("B:%d‚±‚Å%d‚É‚·‚é:%d\n",cnt,sum,(sum==minNum)); */ return (sum==minNum); }else if(sum<minNum){ /* ...
main.c: In function 'combOfSum': main.c:10:38: error: expected expression before ')' token 10 | }else if(minNum==9 && cnt==1-){ | ^
s860826399
p00030
C
m;f(r,n,i,t){if(n==1)return r>i&r<10;for(;i++<9&i<r;)t+=f(r-i,n-1,i,0);return t;}main(s){for(;scanf("%d%d",&m,&s),m;printf("%d\n",f(m,n,-1,0)));return 0;}
main.c:1:1: warning: data definition has no type or storage class 1 | m;f(r,n,i,t){if(n==1)return r>i&r<10;for(;i++<9&i<r;)t+=f(r-i,n-1,i,0);return t;}main(s){for(;scanf("%d%d",&m,&s),m;printf("%d\n",f(m,n,-1,0)));return 0;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] ...
s522672894
p00030
C
#include <stdio.h> int count(int odd, int num, int result){ if(result == 0 && odd == 0) return 1; if(x > 9) return 0; return (count(odd, num + 1, result) + count(odd - 1, num + 1, result - num)); } int main(){ int n, s; while(1){ scanf("%d%d", &n, &s); if(!n && !s) return 0; printf("%d\n", cou...
main.c: In function 'count': main.c:5:6: error: 'x' undeclared (first use in this function) 5 | if(x > 9) return 0; | ^ main.c:5:6: note: each undeclared identifier is reported only once for each function it appears in main.c: In function 'main': main.c:16:34: error: expected ')' before ';' token 16...
s562232872
p00030
C++
#include "stdio.h" #include <vector> #include <iostream> using namespace std; class Puzzle { public: vector<int> used; void input() { } void play() { int n; int s; int ans = 0; used = vector<int>(10, 0); while (1) { cin >> n >> s; if (n == 0) break; ans = try_sum(n, s, 0); printf("%d...
a.cc:56:1: error: extended character   is not valid in an identifier 56 |     Puzzle puz; | ^ a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc:56:1: error: extended character   is not valid in an identifier a.cc: In f...
s336736737
p00030
C++
#include <iostream> using namespace std; int n, s, cnt; void dfs(int i, int sum, int n){ if(sum==s&&!n){ cnt++; return; } if(i==10||!n) return; //使用する3つを探索 //使用しなければカウントされない dfs(i+1,sum,n); dfs(i+1,sum+i,n-1); } int main(){ while(cin >> n >> s, n!=0||s!=0){ cnt = 0; dfs(0, 0, n); cout << cnt << end...
a.cc: In function 'int main()': a.cc:25:9: error: 'return0' was not declared in this scope 25 | return0; | ^~~~~~~
s559588255
p00030
C++
include<iostream> #include<cstdio> using namespace std; int n,s,count,c; int solve(int i,int sum,int used){ if(i==10){ if(s==sum&&used==n){ count++;c++; } return count; } solve(i+1,sum+i,used+1); solve(i+1,sum,used); return count; } int main(){ while(cin>>n>>s,n&&s){ count=0;c=0; solve(0...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:25:15: error: 'cin' was not declared in this scope 25 | while(cin>>n>>s,n&&s){ | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probabl...
s222645879
p00030
C++
#include <stdio.h> int ans=0, n, m; void dfs(int i, int s, int sum){ if(sum == m && s == 0){ ans++; return; } if(i==10 || s == 0) return; dfs(i + 1, s, sum); dfs(i + 1, s - 1, sum + i); } int main() { while(1) { scanf("%d %d", &n, &m); if(n==m && m==0) break; ...
a.cc: In function 'int main()': a.cc:20:28: error: expected ';' before '}' token 20 | printf("%d\n", ans) | ^ | ; 21 | } | ~
s594506704
p00030
C++
#include <iostream> using namespace std; int rec(int n, int s, int over){ if (s < 0 || n < 0) return 0; if (!n && !s) return 1; int count = 0; for (int i = over + 1; i < 10; i++) count += rec(n-1, s - i, i); return count; }
/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
s251077317
p00030
C++
#include<iostream> #include<cstdlib> using namespace std; int n, s, cnt; int array[10]; void Sum(int i, int phase){ array[phase-1] = i; if(phase==n){ for(;i<s;i++){ int nsum=0; for(int j=0;j<phase;j++){ nsum+=array[j]; } if(nsum==s)cnt++; } }else{ for(i++;i<s;i++){ Sum(i, phase+1); } } r...
a.cc: In function 'void Sum(int, int)': a.cc:7:9: error: reference to 'array' is ambiguous 7 | array[phase-1] = i; | ^~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/local...
s066733233
p00030
C++
#include <iomanip> #include <vector> #include <string> #include <stack> #include <set> #include <cmath> #include <algorithm> using namespace std; int n; int cnt=0; void dfs(int depth , int k , int sum ){ if(depth==n){ if(k==0){ cnt++; return; } } if(k<0) return; for(int i=sum; i<10 ; i++){ dfs(depth+1...
a.cc: In function 'int main()': a.cc:28:15: error: 'cin' was not declared in this scope 28 | while(cin>> n >> s , (n || s)){ | ^~~ a.cc:8:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 7 | #include <algorithm> +++ |+#i...
s137390396
p00030
C++
#define _USE_MATH_DEFINES #include <iostream> #include <queue> #include <vector> #include <math.h> #include <algorithm> #include <iomanip> #include <string> #include <stack> #include <cctype> #include <cstdlib> #include <string.h> #include <utility> #include <cstdio> #include <set> #include <map> #include <boost/multip...
a.cc:17:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory 17 | #include <boost/multiprecision/cpp_int.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s178411748
p00030
C++
class Node attr_accessor :state, :depth, :path_cost attr_reader :parent def initialize(state, parent) @state = state @parent = parent @depth = parent.nil? ? 0 : parent.depth + 1 end def goal?(limit, max) nums.size == limit && sum == max end def bad_end?(limit, max) nums.length > lim...
a.cc:6:5: error: stray '@' in program 6 | @state = state | ^ a.cc:7:5: error: stray '@' in program 7 | @parent = parent | ^ a.cc:8:5: error: stray '@' in program 8 | @depth = parent.nil? ? 0 : parent.depth + 1 | ^ a.cc:2:17: error: found ':' in nested-name-specifier...
s522422973
p00030
C++
#include<bits/stdc++.h> using namespace std; int N,S; int dfs(int n,int t,int sum){ if(n==10)return 0; if(t==N){ if(sum==S)return 1; else return 0; } return dfs(n+1,t,r)+dfs(n+1,t+1,r+p); } int main(){ while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl; return 0; }
a.cc: In function 'int dfs(int, int, int)': a.cc:11:22: error: 'r' was not declared in this scope 11 | return dfs(n+1,t,r)+dfs(n+1,t+1,r+p); | ^ a.cc:11:39: error: 'p' was not declared in this scope 11 | return dfs(n+1,t,r)+dfs(n+1,t+1,r+p); | ...
s036443417
p00030
C++
#include<bits/stdc++.h> using namespace std; int N,S; int dfs(int n,int t,int sum){ if(n==10)return 0; if(t==N){ if(sum==S)return 1; else return 0; } return dfs(n+1,t,r)+dfs(n+1,t+1,r+n); } int main(){ while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl; return 0; }
a.cc: In function 'int dfs(int, int, int)': a.cc:11:22: error: 'r' was not declared in this scope 11 | return dfs(n+1,t,r)+dfs(n+1,t+1,r+n); | ^ a.cc: In function 'int main()': a.cc:14:21: error: 'n' was not declared in this scope 14 | while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl...
s866295447
p00030
C++
#include<bits/stdc++.h> using namespace std; int N,S; int dfs(int n,int t,int sum){ if(n==10)return 0; if(t==N){ if(sum==S)return 1; else return 0; } return dfs(n+1,t,sum)+dfs(n+1,t+1,sum+n); } int main(){ while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:14:21: error: 'n' was not declared in this scope 14 | while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl; | ^ a.cc:14:24: error: 's' was not declared in this scope 14 | while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl; | ^
s102017040
p00030
C++
#include<bits/stdc++.h> using namespace std; int N,S; int dfs(int n,int t,int sum){ if(n==10)return 0;if(t==N){if(sum==S)return 1;else return 0;} return dfs(n+1,t,sum)+dfs(n+1,t+1,sum+n); } int main(){ while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:21: error: 'n' was not declared in this scope 10 | while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl; | ^ a.cc:10:24: error: 's' was not declared in this scope 10 | while(cin>>N>>S,n||s)cout<<dfs(0,0,0)<<endl; | ^
s659423269
p00030
C++
#include<iostream> using namespace std; dfs(int a,int b,int c){//a????????£???b????????????????????¨c //c????????? if(b < 0) return 0; if(c < 0) return 0; if(a < 0) return 0; int n=0; if(b == 0 && a == 1){ n++; } n =n + dfs(a-1,b-c,c-1) + dfs(a,b,c-1); return n; } int main(){ int n,s; for(;;){ cin...
a.cc:5:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive] 5 | dfs(int a,int b,int c){//a????????£???b????????????????????¨c | ^~~
s181204391
p00030
C++
from collections import deque class Bt(object): def __init__(self): self.used = [False] * 10 # 0-9????????°???????????¨?????????????????????????????° self.answers = [] # ?????¶??????????????????????????? self.Q = deque() # ????????§???????????¢??????????????°???????¨???¶??¨ def sol...
a.cc:6:35: error: stray '#' in program 6 | self.used = [False] * 10 # 0-9????????°???????????¨?????????????????????????????° | ^ a.cc:6:48: error: extended character ° is not valid in an identifier 6 | self.used = [False] * 10 # 0-9????????°???????????¨?...
s802728488
p00030
C++
#include<iostream> #include<stdio.h> #include<string> #include<math.h> #include<iomanip> #include<algorithm> #include<string.h> #include<cctype> #include<map> #include<set> #include<vector> #include<sstream> #include<stack> #include<queue> using namespace std; int a[10]={0,1,2,3,4,5,6,7,8,9}; int...
a.cc: In function 'void dfs(int, int, int)': a.cc:31:21: error: expected ';' before 'dfs' 31 | dfs(step,i+1,sum) | ^ | ; 32 | dfs(step+1,i+1,sum+a[i]) | ~~~
s467440656
p00030
C++
#include<iostream> using namespace std; int ans = 0; void dfs(int n,int s,int depth){ //if (s < 0) return; // if (s == 0 and n == 0){ // ?§£??????????????£?????? ans++; return; } if (n == 0) return; d++; if (depth == 10)return; //???????????´??? dfs(n-1,s-depth,depth); //?????°????????£?????´??? dfs(...
a.cc: In function 'void dfs(int, int, int)': a.cc:14:9: error: 'd' was not declared in this scope 14 | d++; | ^
s046201261
p00030
C++
#include<iostream> using namespace std; int ans = 0; void dfs(int n,int s,int depth){ //if (s < 0) return; // if (s == 0 and n == 0){ // ?§£??????????????£?????? ans++; return; } if (n == 0) return; d++; if (depth == 10)return; //???????????´??? dfs(n-1,s-depth,depth); //?????°????????£?????´??? dfs(...
a.cc: In function 'void dfs(int, int, int)': a.cc:14:9: error: 'd' was not declared in this scope 14 | d++; | ^
s764748524
p00030
C++
#include <stdio.h> int i,n,s; int part(int cal, int index, int sum){ if(index == 9 && cal == n && sum == s){ i++; return; } if(index > 9|| cal > n||sum > s) return; part(cal, index + 1, sum); part(cal + 1, index + 1, sum + index); } main(){ scanf("%d %d" , &n , &s); if (n==0 && s==0) ...
a.cc: In function 'int part(int, int, int)': a.cc:8:25: error: return-statement with no value, in function returning 'int' [-fpermissive] 8 | return; | ^~~~~~ a.cc:11:58: error: return-statement with no value, in function returning 'int' [-fpermissive] 11 | ...
s693409134
p00030
C++
#include <iostream> using namespace std; int func(int n, int s, int i){ if(!n){ if(!s)return 1; else return 0; } if(i >= 10 || s-i < 0)return 0; return test(n, s, i+1) + test(n-1, s-i, i+1); } int main(){ int n, s; while(cin >> n >> s && (n || s)){ cout << func() << endl; } return 0; }
a.cc: In function 'int func(int, int, int)': a.cc:10:16: error: 'test' was not declared in this scope 10 | return test(n, s, i+1) + test(n-1, s-i, i+1); | ^~~~ a.cc: In function 'int main()': a.cc:16:29: error: too few arguments to function 'int func(int, int, int)' 16 | ...
s060976881
p00030
C++
#include <iostream> using namespace std; int func(int n, int s, int i){ if(!n){ if(!s)return 1; else return 0; } if(i >= 10 || s-i < 0)return 0; return test(n, s, i+1) + test(n-1, s-i, i+1); } int main(){ int n, s; while(cin >> n >> s && (n || s)){ cout << func(n, s, 0) << endl; } return 0; }
a.cc: In function 'int func(int, int, int)': a.cc:10:16: error: 'test' was not declared in this scope 10 | return test(n, s, i+1) + test(n-1, s-i, i+1); | ^~~~
s382453171
p00030
C++
#include<stdio.h> int main(void){ int n, a, b, c, d, sum, key; while(scanf("%d s", &n, &s) != EOF){ key = 0; fir(i = 0; ) for(a = 0; a <= 9; a++){ for(b = 1; b <= 9; b++){ for(c = 2; c <= 9; c++){ for(d = 3; d <= 9; d++){ for(e = 4; e <= 9; e...
a.cc: In function 'int main()': a.cc:4:29: error: 's' was not declared in this scope 4 | while(scanf("%d s", &n, &s) != EOF){ | ^ a.cc:6:11: error: 'i' was not declared in this scope 6 | fir(i = 0; ) | ^ a.cc:6:18: error: expected primary-expression bef...
s063285415
p00030
C++
#include <iostream> #include <stack> using namespace std; struct set { int i, sum, depth; }; int n, s, cnt; int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; void dfs(int i, int sum, int depth) { stack<set> S; S.push(set{next, sum, depth}); while (!S.empty()) { set u = S.top(); if (u.depth ==...
a.cc: In function 'void dfs(int, int, int)': a.cc:13:32: error: cannot resolve overloaded function 'next' based on conversion to type 'int' 13 | S.push(set{next, sum, depth}); | ^ a.cc:21:15: error: 'struct set' has no member named 'next' 21 | if (u.next < 10 && u....
s596096608
p00030
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int n, s, cnt, sum; int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; while (true) { cin >> n >> s; if (!n && !s) break; int arr[10] = {0}; for (int i = 0; i < n; i++) { arr[9-i] = 1 }; cnt = 0; ...
a.cc: In function 'int main()': a.cc:15:51: error: expected ';' before '}' token 15 | for (int i = 0; i < n; i++) { arr[9-i] = 1 }; | ^~ | ;
s140170831
p00030
C++
#include <iostream> #include <bitset> using namespace std; int main() { int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int n, s, sum, cnt; while (cin >> n >> s) { if (!n && !s) { break; } cnt = 0; for (int i = 0; i < (1 << 10); i++) { sum = 0; for (int j = 0; ...
a.cc: In function 'int main()': a.cc:17:31: error: lvalue required as unary '&' operand 17 | if (i >> j) & 1) { | ^
s455954937
p00030
C++
#include <iostream> #include <stack> using namespace std; struct sets { int i, sum, k; }; int n, s, cnt; int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; void dfs(int i, int sum, int k) { stack<sets> S; S.push(sets{i, sum, k}); while (!S.empty()) { set u = S.top(); if (u.k == n && u.sum == s...
a.cc: In function 'void dfs(int, int, int)': a.cc:16:9: error: 'set' was not declared in this scope 16 | set u = S.top(); | ^~~ a.cc:3:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>' 2 | #include <stack> +++ |+#include <set> 3 | a...
s409133187
p00030
C++
def inputcase(): global n,s n,s = map(int,input().split()) return n!=0 or s!=0 memo = [[[0 for j in range(123)] for i in range(11)] for k in range(11)] done = [[[False for j in range(123)] for i in range(11)] for k in range(11)] def dfs(k, l, t): if t < 0: return 0 elif k == 0 and t > 0: return 0 elif k == ...
a.cc:1:1: error: 'def' does not name a type 1 | def inputcase(): | ^~~
s196691539
p00030
C++
#include <stdio.h> int n, s, count = 0, digits[10]; // n 個の整数の和がsになる void dfs(int cur) { // cur = 0 {} if(cur == n) { // cur = 1 {a} int sum = 0; // cur = 2 {a, b} for(int i = 0; i < n; i++) { sum += digits[i]; } if(sum == s) { count++; } retur...
a.cc: In function 'int main()': a.cc:22:5: error: 'func' was not declared in this scope 22 | func(0,0,0); | ^~~~
s170923733
p00030
C++
#include <stdio.h> int n, s, count = 0, digits[10]; // n 個の整数の和がsになる void dfs(int cur) { // cur = 0 {} if(cur == n) { // cur = 1 {a} int sum = 0; // cur = 2 {a, b} for(int i = 0; i < n; i++) { sum += digits[i]; } if(sum == s) { count++; } retur...
a.cc: In function 'int main()': a.cc:21:5: error: 'func' was not declared in this scope 21 | func(0,0,0); | ^~~~
s496602041
p00030
C++
include <iostream> using namespace std; int dfs(int n, int s, int x){ int sum=0; if(n==0 && s==0) return 1; if(n>0){ for(int i =x; i<10; i++){ if(s-i>=0) sum+=dfs(n-1, s-i, i+1); } } return sum; } int main(){ int n, s; while(cin >> n >> s, n||s){ cout << dfs(n, s, ...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:16:10: error: 'cin' was not declared in this scope 16 | while(cin >> n >> s, n||s){ | ^~~ a.cc:17:8: error: 'cout' was not declared in this scope 17 | cout << df...
s924558958
p00030
C++
#include <iostream>using namespace std; int dfs(int n, int s, int x){ int sum=0; if(n==0 && s==0) return 1; if(n>0){ for(int i=x; i<10; i++){ if(s-i>=0) sum+=dfs(n-1, s-i, i+1); } } return sum; } int main(void){ int n, s; while(cin >> n >> s){ if(n...
a.cc:1:26: warning: extra tokens at end of #include directive 1 | #include <iostream>using namespace std; | ^~~~~~~~~ a.cc:1:10: fatal error: iostream>usin: No such file or directory 1 | #include <iostream>using namespace std; | ^~~~~~~~~~~~~~~ compilation terminate...
s126591726
p00030
C++
#include <iostream>using namespace std; int dfs(int n, int s, int x){ int sum=0; if(n==0 && s==0) return 1; if(n>0){ for(int i=x; i<10; i++){ if(s-i>=0) sum+=dfs(n-1, s-i, i+1); } } return sum;} int main(void){ int n, s; while(cin >> n >> s){ if(n==0 && s==0) break; c...
a.cc:1:26: warning: extra tokens at end of #include directive 1 | #include <iostream>using namespace std; int dfs(int n, int s, int x){ int sum=0; if(n==0 && s==0) return 1; if(n>0){ for(int i=x; i<10; i++){ if(s-i>=0) sum+=dfs(n-1, s-i, i+1); } } return sum;} int main(void){ int...
s001023146
p00030
C++
#include <iostream> using namespace std; int main(){ int n,s,j,k,a[11][46]; for(int s=0;s<46;s++)for(int n=0;n<11;n++)a[n][s]=0; for(int i=0;i<1024;i++){ for(j=i,n=0;j>0;j/=2) n += j%2; for(j=i,s=0,k=0;j>0;j/=2,k++) s += j%2*k; a[n][s]++; } for(cin>>n>>s;n||s;s<45?cout<<a[n][s]<<endl:0...
a.cc: In function 'int main()': a.cc:13:26: error: operands to '?:' have different types 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int' 13 | for(cin>>n>>s;n||s;s<45?cout<<a[n][s]<<endl:0,cin>>n>>s); | ~~~~^~~~~~~~~~~~~~~~~~~~~~
s427294248
p00030
C++
#include<cmath> using namespace std; int main(){ int n,s; while(cin>>n>>s,n&&s){ if(n>10||s<3||s>45){ cout<<0<<endl; continue; } int min = (int)pow(10.0,n-2); int lim = (int)pow(10.0,n); stack<int> st; vector<int> res; vector<bool> vis(lim,false); st.push(0); vis[0]=true; while(!st.empty()){...
a.cc: In function 'int main()': a.cc:5:15: error: 'cin' was not declared in this scope 5 | while(cin>>n>>s,n&&s){ | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<cmath> +++ |+#include <iostrea...
s421746352
p00030
C++
#include <iostream> using namespace std; int main() { int n, s; int i, ,j, tmp; int sum, count; int ans while(cin>>n>>s){ if(n+s==0) break; ans=0; for(i=0; i<1024; i++){ tmp=i; sum=0; count=0; for(j=0; j<10; j++){ if(tmp%2==1){ sum+=i; count++; } ...
a.cc: In function 'int main()': a.cc:7:10: error: expected unqualified-id before ',' token 7 | int i, ,j, tmp; | ^ a.cc:11:3: error: expected initializer before 'while' 11 | while(cin>>n>>s){ | ^~~~~ a.cc:29:3: error: 'reutrn' was not declared in this scope 29 | reutrn 0; | ...
s407333961
p00030
C++
#include <iostream> using namespace std; int main() { int n, s; int i, ,j, tmp; int sum, count; int ans; char c; while(cin>>n>>c>>s){ if(n+s==0) break; ans=0; for(i=0; i<1024; i++){ tmp=i; sum=0; count=0; for(j=0; j<10; j++){ if(tmp%2==1){ sum+=i; count...
a.cc: In function 'int main()': a.cc:7:10: error: expected unqualified-id before ',' token 7 | int i, ,j, tmp; | ^ a.cc:30:3: error: 'reutrn' was not declared in this scope 30 | reutrn 0; | ^~~~~~
s417162127
p00030
C++
#include <iostream> using namespace std; int main() { int n, s; int i, ,j, tmp; int sum, count; int ans; char c; while(cin>>n){ cin>>s; if(n+s==0) break; ans=0; for(i=0; i<1024; i++){ tmp=i; sum=0; count=0; for(j=0; j<10; j++){ if(tmp%2==1){ sum+=i; ...
a.cc: In function 'int main()': a.cc:7:10: error: expected unqualified-id before ',' token 7 | int i, ,j, tmp; | ^ a.cc:31:3: error: 'reutrn' was not declared in this scope 31 | reutrn 0; | ^~~~~~
s769185127
p00030
C++
#include <iostream> using namespace std; int main() { int n, s; int i, ,j, tmp; int sum, count; int ans; char c; while(cin>>n>>c>>s){ if(n+s==0) break; ans=0; for(i=0; i<1024; i++){ tmp=i; sum=0; count=0; for(j=0; j<10; j++){ if(tmp%2==1){ sum+=j; count...
a.cc: In function 'int main()': a.cc:7:10: error: expected unqualified-id before ',' token 7 | int i, ,j, tmp; | ^ a.cc:30:3: error: 'reutrn' was not declared in this scope 30 | reutrn 0; | ^~~~~~
s125613393
p00030
C++
#include <iostream> using namespace std; int main() { int n, s; int i, ,j, tmp; int sum, count; int ans; while(cin>>n){ cin>>s; if(n+s==0) break; ans=0; for(i=0; i<1024; i++){ tmp=i; sum=0; count=0; for(j=0; j<10; j++){ if(tmp%2==1){ sum+=j; count++; ...
a.cc: In function 'int main()': a.cc:7:10: error: expected unqualified-id before ',' token 7 | int i, ,j, tmp; | ^ a.cc:30:3: error: 'reutrn' was not declared in this scope 30 | reutrn 0; | ^~~~~~
s710233882
p00030
C++
#include <iostream> using namespace std; int main() { int n, s; int i, ,j, tmp; int sum, count; int ans; char c; while(cin>>n>>c>>s){ if(n+s==0) break; ans=0; for(i=0; i<1024; i++){ tmp=i; sum=0; count=0; for(j=0; j<10; j++){ if(tmp%2==1){ sum+=j; count...
a.cc: In function 'int main()': a.cc:7:10: error: expected unqualified-id before ',' token 7 | int i, ,j, tmp; | ^
s789161059
p00030
C++
#include <iostream> using namespace std; int main() { int n, s; int i, ,j, tmp; int sum, count; int ans; while(cin>>n){ cin>>s; if(n+s==0) break; ans=0; for(i=0; i<1024; i++){ tmp=i; sum=0; count=0; for(j=0; j<10; j++){ if(tmp%2==1){ sum+=j; count++; ...
a.cc: In function 'int main()': a.cc:7:10: error: expected unqualified-id before ',' token 7 | int i, ,j, tmp; | ^
s247848983
p00030
C++
import java.util.Scanner; public class Main { public static final int limit = 9; public static void main(String[] args) { Scanner s = new Scanner(System.in); while(true){ int n=s.nextInt(); int m=s.nextInt(); if(n==0&&m==0)break; System.out.println(s(n,m,0)); } } public static int s(int n,int m,i...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class Main { | ^~~~~~
s120840162
p00030
C++
#include <cstdio.h> using namespace std; int get_sum(int num,int sum,int *u,int n){ int i,j; if(num==0&&sum==0){ return 1; } if(n>9){ return 0; } return (get_sum(num-1,sum-u[n],u,n+1)+get_sum(num,sum,u,n+1)); } int main() { int sum,num; int u[10]; int i; while(1){ scanf("%d %d",&num,&sum); if(num==...
a.cc:1:10: fatal error: cstdio.h: No such file or directory 1 | #include <cstdio.h> | ^~~~~~~~~~ compilation terminated.
s528122958
p00030
C++
#include <stdio.h> int dp[11][55][11]; int cnt_sum(int n, int s, int x){ if(dp[n][s][x] != -1){ return dp[n][s][x]; } if(n == 0 && s == 0){ return (1); } if(x>9){ return (0); } return dp[n][s][x] = (cnt_sum(n-1, s-x, x+1) + cnt_sum(n, s, x+1)); } int main(){ int n, s; memset(dp,-1,si...
a.cc: In function 'int main()': a.cc:20:3: error: 'memset' was not declared in this scope 20 | memset(dp,-1,sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <stdio.h> +++ |+#include <cstring> 2 | ...
s599321787
p00030
C++
#include <iostream> #include <cstring> using namespace std; int n,s; int recursion(int sum,int ans,int num,int cnt){ if(sum > s || cnt > n) return 0; if(cnt == n && sum == s) return 1; if(sum + num > s) return 0; int hoge = 0; hoge += recursion(sum+num,ans,num+1,cnt+1); hoge += recursion(sum,ans,num+1,cnt...
a.cc: In function 'int main()': a.cc:20:4: error: expected '}' at end of input 20 | } | ^ a.cc:17:11: note: to match this '{' 17 | int main(){ | ^
s943423147
p00030
C++
#include <iostream> using namespace std; int res; const int d[10]={0,1,2,3,4,5,6,7,8,9} int main(){ int n,s; while(cin>>n>>s,n||s){ res=0; dfs(0,0,n,0,s); cout<<res<<endl; } return 0; } a void dfs(int now,int idx,int n,int sum,int s){ if(now==n&&sum==s) { res++; return true; } if(dfs(now,idx+1,...
a.cc:7:1: error: expected ',' or ';' before 'int' 7 | int main(){ | ^~~ a.cc:18:1: error: 'a' does not name a type 18 | a | ^
s850540864
p00030
C++
#include <iostream> using namespace std; int res; const int d[10]={0,1,2,3,4,5,6,7,8,9}; int main(){ int n,s; while(cin>>n>>s,n||s){ res=0; dfs(0,0,n,0,s); cout<<res<<endl; } return 0; } a void dfs(int now,int idx,int n,int sum,int s){ if(now==n&&sum==s) { res++; return true; } if(dfs(now,idx+1...
a.cc: In function 'int main()': a.cc:12:17: error: 'dfs' was not declared in this scope 12 | dfs(0,0,n,0,s); | ^~~ a.cc: At global scope: a.cc:18:1: error: 'a' does not name a type 18 | a | ^
s940594697
p00030
C++
#include <iostream> using namespace std; int res; const int d[10]={0,1,2,3,4,5,6,7,8,9}; void dfs(int now,int idx,int n,int sum,int s){ if(idx>9) return false; if(now==n&&sum==s) { res++; return true; } if(dfs(now,idx+1,n,sum,s)) return true; if(dfs(now+1,idx+1,n,sum+d[idx],s)) return true; return...
a.cc: In function 'void dfs(int, int, int, int, int)': a.cc:9:26: error: return-statement with a value, in function returning 'void' [-fpermissive] 9 | if(idx>9) return false; | ^~~~~ a.cc:13:24: error: return-statement with a value, in function returning 'void' [-fpermissive]...
s573609320
p00030
C++
#include <iostream> #include <string> #include <vector> using namespace std; typedef vector <int> vi; typedef vector <vi> vvi; vvi x(11, vi(101)); int reverse(string &s){ int n = s.size(), n2 = n/2; for (int i=0; i<n2; i++) swap(s[i], s[n-1-i]); return 0; } string dec2bin(int n, bool r=false){ st...
a.cc: In function 'int main()': a.cc:29:15: error: 'pow' was not declared in this scope 29 | int m=pow(2,10); | ^~~
s110657519
p00030
C++
#include<iostream> using namespace std; int syu(int *p,int n){ int s=0; for(int i=0;i<n;i++) s += p[i]; return s; } int main(){ int n,s; while(cin>>n>>s){ if(n==0&&s==0) break; int p[n],count=0; for(int a=0;a<=9;a++){ p[0] = a; if(n==1&&syu(p,n)==s){ count++; continue; } ...
a.cc:82:7: error: expected declaration before '}' token 82 | } | ^ a.cc:83:5: error: expected declaration before '}' token 83 | } | ^ a.cc:84:5: error: 'cout' does not name a type 84 | cout << count << endl; | ^~~~ a.cc:85:3: error: expected declaration before '}' ...
s682083934
p00030
C++
#include <iostream> #include <vector> using namespace std; int t; int n[10]; void sousa(int a, int b){ for(n[a-1] = n[a]; n[a-1] >= 0; n[a-1]--){ if(a-1 < 0 || b < 0){ cout << "out" << endl; break; } else if(a-1 == 0 && b-n[a-1] == 0){ cout << "ok" << endl; t++; break; } else{ cout << "la...
a.cc: In function 'int main()': a.cc:29:19: error: 'a' was not declared in this scope 29 | n[a] = 9; | ^
s672255865
p00030
C++
#include<stdio.h> int count=0; int s,n; void ans(int i,int n,int sum); void main() { while(scanf("%d %d",&n,&s),n){ count=0; ans(0,0,0); printf("%d\n",count); } } void ans(int i,int sum,int ele) { if(i==n){ if(sum==s) count++; } else{ if(ele<=9){ ans(i+1,sum+ele,ele+1); ans(i,sum,ele+1); ...
a.cc:8:1: error: '::main' must return 'int' 8 | void main() | ^~~~
s924429278
p00030
C++
import java.util.*; public class Main { static int ans,n; //nowN->現在の足した回数 Sum->足した合計値 before->前の数 static int dfs(int nowN, int Sum, int before) { int count = 0; if(Sum > ans) return(0); if(nowN == n) { if(Sum == ans) return(1); else return(0); } for(int r = before; r < 10; r++) { ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class Main { | ^~~~~~
s458158099
p00030
C++
//include //------------------------------------------ #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <...
a.cc: In function 'int gcd(int, int)': a.cc:81:1: warning: no return statement in function returning non-void [-Wreturn-type] 81 | } | ^ a.cc: In function 'int main()': a.cc:158:13: error: 'i' was not declared in this scope 158 | if(i>s) break; | ^ a.cc: In function 'bool prime_num...
s439872361
p00031
Java
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class AOJ_Volume0031 { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int[] value = new int[10]; int x = 512; List<Integer> v = new ArrayList<Integer>(); for(int i=0;i<10;i++){ value[i] = x...
Main.java:6: error: class AOJ_Volume0031 is public, should be declared in a file named AOJ_Volume0031.java public class AOJ_Volume0031 { ^ 1 error
s456821998
p00031
Java
import java.util.Scanner; public class Main{ public static void main(String[] args) { new Main().run(); } void run(){ Scanner sc = new Scanner(System.in); while(true){ if(!sc.hasNext()){ break; } int a = sc.nextInt(); int[] b = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512}; for(int i=0; i < b.le...
Main.java:23: error: reached end of file while parsing } ^ 1 error
s556639433
p00031
Java
import java.io.* class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str; boolean[] flag=new boolean[10]; while((str=br.readLine())!=null){ int n=Integer.parseInt(str); int t=9; while(t>=0){ int Math.pow(2,t); n=(n>=p)?n-...
Main.java:1: error: ';' expected import java.io.* ^ Main.java:12: error: ';' expected int Math.pow(2,t); ^ 2 errors
s414861154
p00031
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str; boolean[] flag=new boolean[10]; while((str=br.readLine())!=null){ int n=Integer.parseInt(str); int t=9; while(t>=0){ int p=Math.pow(2,t); n=(n>=p)...
Main.java:12: error: incompatible types: possible lossy conversion from double to int int p=Math.pow(2,t); ^ 1 error
s700288862
p00031
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ int[] dou = new int[10]; for(int i = 0 ; i < 10; i++){ dou[i] = Math.pow(2, i); } List<Integer> list = new ArrayList<Integer>(); while(scan.hasNext()){ int n ...
Main.java:10: error: incompatible types: possible lossy conversion from double to int dou[i] = Math.pow(2, i); ^ Main.java:29: error: cannot find symbol if(i == list.size -1){ ^ symbol: variable size location: variable list of type List<Integer> 2 errors
s318373905
p00031
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ List<Integer> list = new ArrayList<Integer>(); while(scan.hasNext()){ int w = scan.nextInt(); for(int i = 10-1; i >= 0; i--){ if(w > Math.pow(2, i)){ w = w -...
Main.java:15: error: ')' expected } else if(w == Math.pow(2, i){ ^ Main.java:23: error: ')' or ',' expected System.out.printf("%d\n", Math.pow(2, j); ^ Main.java:25: error: ')' or ',' expected System.out.printf("%d ", Math.pow(2...
s538597761
p00031
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ List<Integer> list = new ArrayList<Integer>(); while(scan.hasNext()){ int w = scan.nextInt(); for(int i = 10-1; i >= 0; i--){ if(w > Math.pow(2, i)){ w = w -...
Main.java:29: error: reached end of file while parsing } ^ 1 error
s413632555
p00031
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ List<Integer> list = new ArrayList<Integer>(); while(scan.hasNext()){ int w = scan.nextInt(); for(int i = 10-1; i >= 0; i--){ if(w > Math.pow(2, i)){ w = w -...
Main.java:13: error: incompatible types: possible lossy conversion from double to int w = w - Math.pow(2, i); ^ 1 error
s476251674
p00031
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ StringBuffer sb = new StringBuffer(); while(scan.hasNext()){ int w = scan.nextInt(); int i = 1; while(i <= 512){ if((w & i) == i){ sb.append(i).append(' ')...
Main.java:18: error: ')' or ',' expected System.out.printf("%s\n" s); ^ Main.java:18: error: not a statement System.out.printf("%s\n" s); ^ Main.java:18: error: ';' expected System.out.printf("%s\n" s); ^ 3 errors
s767730225
p00031
Java
import java.util.*; public class A{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ StringBuffer sb = new StringBuffer(); while(scan.hasNext()){ int w = scan.nextInt(); int i = 1; sb.setLength(0); while(i <= 512){ if((w & i) == i){ sb.appe...
Main.java:3: error: class A is public, should be declared in a file named A.java public class A{ ^ 1 error
s923058159
p00031
Java
#include <cstdio> #include <iostream> #include <sstream> #include <algorithm> #include <vector> #include <string> #include <map> #include <set> using namespace std; #define rep(i,a,n) for(int (i)=a;(i)<(int)(n);(i)++) #define rrep(i,a,n) for(int (i)=(n)-1;(i)>=a;(i)--) #define all(x) (x).begin(),(x).end() typedef lo...
Main.java:1: error: illegal character: '#' #include <cstdio> ^ Main.java:2: error: illegal character: '#' #include <iostream> ^ Main.java:3: error: illegal character: '#' #include <sstream> ^ Main.java:4: error: illegal character: '#' #include <algorithm> ^ Main.java:5: error: illegal character: '#' #include <vector> ^...
s413579984
p00031
Java
import java.util.*; public class Vol0_31{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ StringBuffer sb = new StringBuffer(); while(scan.hasNext()){ int w = scan.nextInt(); int i = 1; while(i <= 512){ // ????????????1???????????????????£??????´?...
Main.java:3: error: class Vol0_31 is public, should be declared in a file named Vol0_31.java public class Vol0_31{ ^ 1 error