submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s700768391
p00069
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> #include <cassert> #include <iostream> #include <cctype> #include <sstream> #include <string> #include <list> #include <vector> #include <queue> #include <set> #include <stack> #include <map> #include <utility> #include <numeric> ...
a.cc: In function 'int main()': a.cc:59:34: error: no matching function for call to 'std::vector<std::vector<int> >::vector(int&, int)' 59 | vector<vint> stair(d, n-1); | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:12: /usr/include/...
s547167537
p00069
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> #include <cassert> #include <iostream> #include <cctype> #include <sstream> #include <string> #include <list> #include <vector> #include <queue> #include <set> #include <stack> #include <map> #include <utility> #include <numeric> ...
a.cc: In function 'int main()': a.cc:59:34: error: no matching function for call to 'std::vector<std::vector<int> >::vector(int&, int)' 59 | vector<vint> stair(d, n-1); | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:12: /usr/include/...
s521744520
p00069
C++
#include <iostream> #include <cmath> #include <cstring> using namespace std; void charAnd(char *a, char *b, char *r, int n){ for(int i=0; i<n; ++i){ if(a[i]=='1' && b[i]=='1'){ r[i]='1'; }else{ r[i]='0'; } } } void charOr(char *a, char *b, char *r, int n){ for(int i=0; i<n; ++i){ if(a[i]=='1' || b[i]=...
a.cc: In function 'int main()': a.cc:123:22: error: expected unqualified-id before 'or' token 123 | char or[11] = "0000000000"; | ^~ a.cc:124:50: error: expected primary-expression before 'or' token 124 | charOr(own[stage], prize[stage], or, n); | ...
s517960569
p00069
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int n,d; int a[10]={0,1,2,3,4,5,6,7,8,9}; char str[50][20]; void check(); int main(){ int m,s; for(;;){ cin>>n; if(n==0)exit(0); cin>>m>>s>>d; for(int i=1;i<=d;i++)cin>>str[i]; check(); i...
a.cc:31:1: error: extended character   is not valid in an identifier 31 |              for(int k=0;k<10;k++)a[k]=k; | ^ a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid in an identifier a.cc:31:1: error: extended character   is not valid i...
s830271383
p00069
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int n,d; int a[10]={0,1,2,3,4,5,6,7,8,9}; char str[50][20]; void check(); int main(){ int m,s; for(;;){ cin>>n; if(n==0)exit(0); cin>>m>>s>>d; for(int i=1;i<=d;i++)cin>>str[i]; check(); i...
a.cc:64:1: error: extended character   is not valid in an identifier 64 |              for(int k=0;k<10;k++)a[k]=k; | ^ a.cc:64:1: error: extended character   is not valid in an identifier a.cc:64:1: error: extended character   is not valid in an identifier a.cc:64:1: error: extended character   is not valid i...
s624436946
p00069
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int n,d; int a[10]={0,1,2,3,4,5,6,7,8,9}; char str[50][20]; void check(); int main(){ int m,s; for(;;){ cin>>n; if(n==0)exit(0); cin>>m>>s>>d; for(int i=1;i<=d;i++)cin>>str[i]; check(); i...
a.cc:64:1: error: extended character   is not valid in an identifier 64 |              for(int k=0;k<10;k++)a[k]=k; | ^ a.cc:64:1: error: extended character   is not valid in an identifier a.cc:64:1: error: extended character   is not valid in an identifier a.cc:64:1: error: extended character   is not valid i...
s133775101
p00069
C++
import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.util.Collections.*; import static java.lang.Math.*; public class Main { int INF = 1 << 28; //long INF = 1L << 62; double EPS = 1e-10; void run() { Scanner sc = new Scanner(System.in); for(;;) { int n = sc.nextInt()...
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.io.*; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: ...
s826603641
p00070
Java
import sun.jvm.hotspot.jdi.IntegerTypeImpl; import java.io.*; import java.util.*; public class Main { int[][][] memo; int solve(int n, int bits, int sum) { if (n == 0) { if (sum == 0) return 1; return 0; } if (sum > 330) return 0; if (sum < 0) return 0;...
Main.java:1: error: package sun.jvm.hotspot.jdi does not exist import sun.jvm.hotspot.jdi.IntegerTypeImpl; ^ 1 error
s714358166
p00070
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[][] dp; boolean[] use; while((line=br.readLine())!=null){ String[] values=line.split(" "); int n=Integer.parseInt(values[0]); int s=Inte...
Main.java:1: error: <identifier> expected import???java.io.*; ^ 1 error
s772837457
p00070
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[][] dp; boolean[] use; while((line=br.readLine())!=null){ String[] values=line.split(" "); int n=Integer.parseInt(values[0]); int s=Intege...
Main.java:27: error: method dfs in class Main cannot be applied to given types; dfs(depth+1,sum+depth*i); ^ required: int,int,int[][],boolean[] found: int,int reason: actual and formal argument lists differ in length 1 error
s244709741
p00070
Java
import java.util.ArrayList; import java.util.List; import java.util.Scanner; class Main { private static int terminal = 0; private static int numConsist = 0; public void nextFor(int iteration, List<Integer> array, int constant, int sum){ int tmpSum; List<Integer> tmpArray = null; for( int i = 0; i <array.siz...
Main.java:15: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal tmpSum = new Integer(sum); ^ Main.java:30: error: cannot find symbol CombinationOfNumberSequences cNS = new CombinationOfNumberSequences(); ^ symbol: class CombinationOfNumberSequences location: ...
s904863926
p00070
Java
import java.util.ArrayList; import java.util.List; import java.util.Scanner; class Main { private static int terminal = 0; private static int numConsist = 0; public void nextFor(int iteration, List<Byte> integerList, int constant, int sum){ for( int i = 0; i <integerList.size(); i++){ ...
Main.java:33: error: incompatible types: short cannot be converted to Byte integerList.add(i); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
s242805918
p00070
Java
import java.util.Arrays; import java.util.Scanner; public class Main2 { static int n, s, count; static boolean[] already; public static void main(String[] args) { Scanner cin = new Scanner(System.in); while(cin.hasNext()){ n = cin.nextInt(); s = cin.nextInt(); if(n>10){ System.out.println(0); ...
Main.java:4: error: class Main2 is public, should be declared in a file named Main2.java public class Main2 { ^ 1 error
s493525158
p00070
Java
import java.util.*; public class Main { int n, s, count; @SuppressWarnings("unchecked") ArrayDeque<Integer> q = new ArrayDeque(); void loop(int a, int b){ if(a==n){ if(b==s) count++; }else if(b<=s){ for(int i=0;i<10;i++){ if(q.contains(i)==false){ q.push(i); loop(a+1,b+(a+1)*i); ...
Main.java:38: error: cannot find symbol new Main.solve(); ^ symbol: class solve location: class Main Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
s120197436
p00070
Java
package jp.ac.saburou.volume0.p70; import java.util.NoSuchElementException; import java.util.Scanner; public class P70 { static boolean[] used = new boolean[10]; public static void main(String[] args) { Scanner scan = new Scanner(System.in); while(true){ try{ int n = scan.nextInt(); int s = scan....
Main.java:6: error: class P70 is public, should be declared in a file named P70.java public class P70 { ^ 1 error
s026232863
p00070
C
#include<stdio.h> int n,c; void k(int s,int num[10]){ int i; for(i=0;i<10;i++){ if(num[i]==0&&s>=n*i){//1 s-=n*i; num[i]=1; n--;//2 if(n==0&&s==0){ c++; } else if(s>=0&&n>0){ k(s,num);//3 } num[i]=0; n++; s+=n*i;//4 } } } int main(){ int s; ...
main.c: In function 'main': main.c:27:5: error: 'lc' undeclared (first use in this function); did you mean 'c'? 27 | lc=1; | ^~ | c main.c:27:5: note: each undeclared identifier is reported only once for each function it appears in
s972342585
p00070
C
#include <cstdio> bool used[10]; int sum, ans, n, s, Min, Max; inline void A(int x){ if(x == 0){ if(sum == s) ans++; return; } int tmp = -x; for(int i = 9; i >= 0; i--){ tmp += x; if(used[i]) continue; used[i] = true; sum += tmp; A(x-1); sum -= tmp; used[i] = false; } } int main(){ while(scan...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s829562129
p00070
C
#include <cstdio> #include <algorithm> #define N 10 using namespace std; /** Application main entry point. */ int main ( int argc, char * argv[ ] ) { int n, s; int i; while ( scanf ( "%d%d", &n, &s ) == 2 ) { int d[ N ] = { 0 }; int c = 0; for ( i = 1; i <= n; ++i ) { d[ N ...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s495228575
p00070
C
/* AizuOnline A0070 Combination of Number Sequences */ #include <stdio.h> #define min(x,y) (((x)>(y))?(y):(x)) int used_list[10]; long int c_n_s(int n,int s,int used_list_ptr) { int i,j; long int sum,ret; /* printf("%d %d %d\n",n,s,used_list_ptr);*/ if(n==1) { for(i=0;i<used_list_ptr;i++) ...
main.c: In function 'c_n_s': main.c:45:21: error: expected ';' before ':' token 45 | goto BBB: | ^ | ; main.c: At top level: main.c:58:1: error: return type defaults to 'int' [-Wimplicit-int] 58 | main() | ^~~~
s044991929
p00070
C
u[9];D(s,v){int i,r;if(!s)return!v;if(v<0||v>s*-~s*5)return 0;for(r=i=0;i<=9;++i)!u[i]?u[i]=1,r+=D(s-1,v-i*s),u[i]=0;return r;}main(n,v){while(~scanf("%d%d",&n,&v))printf("%d\n",D(n,v));exit(0);}
main.c:1:1: warning: data definition has no type or storage class 1 | u[9];D(s,v){int i,r;if(!s)return!v;if(v<0||v>s*-~s*5)return 0;for(r=i=0;i<=9;++i)!u[i]?u[i]=1,r+=D(s-1,v-i*s),u[i]=0;return r;}main(n,v){while(~scanf("%d%d",&n,&v))printf("%d\n",D(n,v));exit(0);} | ^ main.c:1:1: error: type defaults to 'int...
s793926056
p00070
C
#include <stdio.h> int search(int, int, int, int[]); int main(void) { int i; int count; int isUsed[10]={0,0,0,0,0,0,0,0,0,0}; while(scanf("%d %d",&n, &s)!=EOF){ count=0; for(i=0; i<10; i++){ isUsed[i]=1; count+=search(s, n, i, isUsed); isUsed[i]=0; } printf("%d\n", count); ...
main.c: In function 'main': main.c:11:24: error: 'n' undeclared (first use in this function) 11 | while(scanf("%d %d",&n, &s)!=EOF){ | ^ main.c:11:24: note: each undeclared identifier is reported only once for each function it appears in main.c:11:28: error: 's' undeclared (first use i...
s063742155
p00070
C
#include <stdio.h> int search(int, int, int, int*); int main(void) { int i; int count; int isUsed[10]={0,0,0,0,0,0,0,0,0,0}; while(scanf("%d %d",&n, &s)!=EOF){ count=0; for(i=0; i<10; i++){ isUsed[i]=1; count+=search(s, n, i, isUsed); isUsed[i]=0; } printf("%d\n", count); ...
main.c: In function 'main': main.c:11:24: error: 'n' undeclared (first use in this function) 11 | while(scanf("%d %d",&n, &s)!=EOF){ | ^ main.c:11:24: note: each undeclared identifier is reported only once for each function it appears in main.c:11:28: error: 's' undeclared (first use i...
s942718898
p00070
C
#include <stdio.h> int main(void) { int ball[10]; int N; int B, C, tmp; int i, j; scanf("%d", &N); for(i=0; i<N; i++){ scanf("%d %d %d %d %d %d %d %d %d %d", &ball[0], &ball[1], &ball[2], &ball[3], &ball[4], &ball[5], &ball[6], &ball[7], &ball[8], &ball[9]); B=11; C=11; for(j=9; j>=0; ...
main.c:36:5: error: redefinition of 'main' 36 | int main(void) | ^~~~ main.c:3:5: note: previous definition of 'main' with type 'int(void)' 3 | int main(void) | ^~~~
s277345792
p00070
C
using System; using System.Collections; //using System.Collections.Generic; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ String s=""; while(true){ if((s=rs())==null)return; var d=s.Split(' '); N=int.Parse(d[0]); S=int.Parse(d[1]); ...
main.c:1:1: error: unknown type name 'using' 1 | using System; | ^~~~~ main.c:2:1: error: unknown type name 'using' 2 | using System.Collections; | ^~~~~ main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 2 | using System.Collections; | ^ main...
s361320634
p00070
C++
#include<iostream> using namespace std; int a[10],n,s; int f(int i,int sum) { if(i==n)return sum==s; int ans=0; for(int j=0;j<10;j++) { if(a[j])continue; a[j]=1; ans+=f(i+1,sum+j*(i+1)); a[j]=0; } return ans; } main() { while(cin>>n>>s) { cout<<f()...
a.cc:17:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 17 | main() | ^~~~ a.cc: In function 'int main()': a.cc:21:16: error: too few arguments to function 'int f(int, int)' 21 | cout<<f()<<endl; | ~^~ a.cc:4:5: note: declared here 4 | int f(int...
s286408995
p00070
C++
#include<iostream> using namespace std; int a[10],n,s; int memo[11][330]; void f(int i,int sum) { dp[i][sum]++; if(i==10)return; for(int j=0;j<10;j++) { if(sum+j*(i+1)>s)return ans; if(a[j])continue; a[j]=1; f(i+1,sum+j*(i+1)); a[j]=0; } } main() { f(0,0);...
a.cc: In function 'void f(int, int)': a.cc:7:5: error: 'dp' was not declared in this scope 7 | dp[i][sum]++; | ^~ a.cc:11:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | if(sum+j*(i+1)>s)return ans; | ^~~ | ...
s262866273
p00070
C++
#include<iostream> using namespace std; int a[10],n,s; int dp[11][330]; void f(int i,int sum) { dp[i][sum]++; if(i==10)return; for(int j=0;j<10;j++) { if(sum+j*(i+1)>s)return ans; if(a[j])continue; a[j]=1; f(i+1,sum+j*(i+1)); a[j]=0; } } main() { f(0,0); ...
a.cc: In function 'void f(int, int)': a.cc:11:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | if(sum+j*(i+1)>s)return ans; | ^~~ | abs a.cc: At global scope: a.cc:18:1: warning: ISO C++ forbids declaration o...
s233353290
p00070
C++
include <iostream> #include <string.h> #define REP(i,k,n) for(int i=k;i<n;i++) #define rep(i,n) for(int i=0;i<n;i++) using namespace std; int flag[10]; int count; void dfs(int i,int max,int a,int sum) { if(a > sum || i > max+1 || sum > 330) { return; } else if(a == sum && i == max+1) { count++; } else {...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:41:15: error: 'cin' was not declared in this scope 41 | while(cin >> n >> s) | ^~~ a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably...
s514956916
p00070
C++
#include <iostream> #include <vector> #include <algorithm> #include <cstdio> #include <bitset> using namespace std; int n, s; int dp[1 << 10][10000]; int c (int i, int sum, int t) { if (t == 0) return (sum == s ? 1 : 0); if (sum > s) return 0; if (dp[i][s-sum] >= 0) return dp[i][s-sum]; int res = 0; ...
a.cc: In function 'int main()': a.cc:41:14: error: expected '}' at end of input 41 | return 0; | ^ a.cc:23:1: note: to match this '{' 23 | { | ^
s234649457
p00070
C++
#include <bits/stdc++.h> #define range(i,a,b) for(int (i)=(a);(i)<(b);(i)++) #define rep(i,n) range(i,0,n) using namespace std; int n,s; int rec(int index,int sum,int mask){ if(sum>s) continue; if(index==n){ if(sum==s) return 1; else return 0; } int res=0; rep(i,10){ if(mask&(1<<i)) continue; int n...
a.cc: In function 'int rec(int, int, int)': a.cc:9:19: error: continue statement not within a loop 9 | if(sum>s) continue; | ^~~~~~~~
s496298350
p00070
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);++i) #define loop for(;;) #define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl; #define all(v) begin(v),end(v) #define pb push_back #define inf (1e9) #define eps (1e-9) #typedef long long int Integer; #typedef vector<int> vi; vi lsi(...
a.cc:12:2: error: invalid preprocessing directive #typedef 12 | #typedef long long int Integer; | ^~~~~~~ a.cc:13:2: error: invalid preprocessing directive #typedef 13 | #typedef vector<int> vi; | ^~~~~~~ a.cc:15:1: error: 'vi' does not name a type; did you mean 'void'? 15 | vi lsi(vi xs) { ...
s811902919
p00070
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);++i) #define loop for(;;) #define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl; #define all(v) begin(v),end(v) #define pb push_back #define inf (1e9) #define eps (1e-9) #typedef long long Integer; #typedef vector<int> vi; vi lsi(vi x...
a.cc:11:2: error: invalid preprocessing directive #typedef 11 | #typedef long long Integer; | ^~~~~~~ a.cc:13:2: error: invalid preprocessing directive #typedef 13 | #typedef vector<int> vi; | ^~~~~~~ a.cc:15:1: error: 'vi' does not name a type; did you mean 'void'? 15 | vi lsi(vi xs) { | ^...
s779730741
p00070
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);++i) #define loop for(;;) #define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl; #define all(v) begin(v),end(v) #define pb push_back #define inf (1e9) #define eps (1e-9) typedef long long Integer; typedef vector<int> vi; vi lsi(vi xs)...
a.cc: In function 'vi lsi(vi)': a.cc:16:3: error: 'vvi' was not declared in this scope; did you mean 'vi'? 16 | vvi bins; | ^~~ | vi a.cc:21:7: error: 'bins' was not declared in this scope 21 | bins.push_back({x}); | ^~~~ a.cc:24:7: error: 'bins' was not declared in this scope ...
s356571664
p00070
C++
include<iostream> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) using namespace std; int sum; int n,s; void func(int i,int j,bool check[10]){ if(j<0)return; if(i==n && j==0)sum++; for(int k=0;k<10;k++){ if(check[k]){ check[k]=false; func(i+1,j-k*(i+1),check); check[...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:22:9: error: 'cin' was not declared in this scope 22 | while(cin>>n>>s){ | ^~~ a.cc:27:5: error: 'cout' was not declared in this scope 27 | cout<<sum<<endl; | ...
s651493538
p00070
C++
#include <iostream> #include <string> #include <sstream> #include <algorithm> #include <vector> #include <utility> #include <stack> #include <queue> #include <map> #include <set> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> using namespace std; #define rep(i,n) for(int i...
a.cc: In function 'int main()': a.cc:50:31: error: 'class std::set<std::vector<int> >' has no member named 'conunt'; did you mean 'count'? 50 | if(st.conunt(u)) continue; | ^~~~~~ | count a.cc:57:48: error: expected ')' b...
s542912218
p00070
C++
#include <iostream> #include <string> #include <sstream> #include <algorithm> #include <vector> #include <utility> #include <stack> #include <queue> #include <map> #include <set> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> using namespace std; #define rep(i,n) for(int i...
a.cc: In function 'int main()': a.cc:57:48: error: expected ')' before ';' token 57 | }while(next_permutation(all(v)); | ~ ^ | )
s307144525
p00070
C++
#include<iostream> #include<string> #include<algorithm> #include<map> #include<set> #include<utility> #include<vector> #include<cmath> #include<cstring> #include<cstdio> #include<time.h> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define pb push_back #define mp make_pair #define all(in) in.b...
a.cc: In function 'int main()': a.cc:38:66: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+' 38 | }while(next_permutation(d.begin(),d.begin+n)); | ~~~~~~~^~ | ...
s816350836
p00070
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <algorithm> #include <vector> #define _USE_MATH_DEFINES #include <math.h> #include <stack> #include <queue> #include <random> #define INF (1<<21) #define swap(a,b) {a=a+b; b=a-b; a=a-b;} #define abs(a) (a > 0 ? a:-a) using namespace ...
a.cc: In function 'int rec()': a.cc:19:13: error: 'choose_size' was not declared in this scope 19 | if (choose_size == N) { | ^~~~~~~~~~~ a.cc:19:28: error: 'N' was not declared in this scope 19 | if (choose_size == N) { | ^ a.cc:22:42: error: 'ch...
s955369451
p00070
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int rec() { if (choose_size == N) { int sum = 0; for (int i = 0; i < N; i++) { sum += (i + 1) * choose[i]; } return ans == sum; } int cnt = 0; for (int i = 0; i < rest_size; i++) { choose[choose_size++] = rest[i]; for ...
a.cc: In function 'int rec()': a.cc:8:13: error: 'choose_size' was not declared in this scope 8 | if (choose_size == N) { | ^~~~~~~~~~~ a.cc:8:28: error: 'N' was not declared in this scope 8 | if (choose_size == N) { | ^ a.cc:11:42: error: 'choo...
s663495708
p00070
C++
#include <iostream> #include<cstdlib> using namespace std; int table[10+1][331]; bool memo[10]; int n; void rec(int depth, int sum) { table[depth][sum]++; for (int i = 0; i <= 9; i++) { if (memo[i]) continue; memo[i] = true; rec(depth + 1, sum + i * (depth+1)); memo[i] = false; } } void q70() { memset(tab...
a.cc: In function 'void q70()': a.cc:19:9: error: 'memset' was not declared in this scope 19 | memset(table, 0, sizeof(table)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<cstdlib> +++ |+#include ...
s734734154
p00070
C++
#include <iostream> #include <vector> #include <string> using namespace std; int num[10]; long fact[10],dp[10][331];//??????331??\?????????????????¨????????????dp[10][1000]??¨?????§??????????????? int main(){ for(int i = 0; i < 10; i++){ num[i] = i; } do{ int t = 0; for(int i = 0; i < 10; i++){ t += num...
a.cc: In function 'int main()': a.cc:20:16: error: 'next_permutation' was not declared in this scope 20 | }while(next_permutation(num,num+10)); | ^~~~~~~~~~~~~~~~
s098439732
p00070
C++
#include <iostream> using namespace std; typedef struct { int val[10]; } numType; int func(int n, int s, numType set) { int sum = 0; int new_n; if (n <= 0) return 0; if (n == 1) { if (s >= 9) return 0; return (set.val[s] != 1) ? 0 : 1; } for (int k = 9; k >= 0; k--) { if (set.val[k] == 0) continue; ne...
a.cc: In function 'int main(int, char**)': a.cc:32:9: error: 'memset' was not declared in this scope 32 | memset(&set, 0, sizeof(set)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <iostream> +++ |...
s874618401
p00070
C++
#include <memory> #include <iostream> using namespace std; typedef struct { int val[10]; } numType; int func(int n, int s, numType set) { int sum = 0; int new_n; if (n <= 0) return 0; if (n == 1) { if (s >= 9) return 0; return (set.val[s] != 1) ? 0 : 1; } for (int k = 9; k >= 0; k--) { if (set.val[k] == ...
a.cc: In function 'int main(int, char**)': a.cc:32:9: error: 'memset' was not declared in this scope 32 | memset(&set, 0, sizeof(set)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <iostream> +++ |...
s995028682
p00070
C++
class Memo { int flag; Memo(int n) :flag{ n } {} public: Memo() :flag{ 0 } {} class Iterator { const int flag; int n; public: Iterator(int aflag, int an) :flag{ aflag }, n{ an } {} int operator*() const { return n; } Iterator operator++() { while (((1 << ++n) | flag) == flag && n < 10); retur...
a.cc: In function 'int main()': a.cc:45:21: error: 'cin' is not a member of 'std' 45 | while (std::cin >> n >> s) { | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:...
s492553930
p00070
C++
#include <iostream> #include <algorithm> using namespace std; int main() { int N, S; while(cin >> N >> S) { int pats[10]; for(int i = 0; i < 10; ++i) pats[i] = i<N ? 1 : 0; reverse(pats, pats+10); int ans = 0; do { int list[N], *pt = list; for(i...
a.cc:35:5: error: redefinition of 'int main()' 35 | int main() { | ^~~~ a.cc:6:5: note: 'int main()' previously defined here 6 | int main() { | ^~~~
s002505196
p00070
C++
#include <iostream> #include <sstream> #include <iomanip> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <climits> #include <cfloat> using namespace std; int main() {...
a.cc:43:2: error: stray '#' in program 43 | }#include <iostream> | ^ a.cc:43:3: error: 'include' does not name a type 43 | }#include <iostream> | ^~~~~~~ a.cc:80:5: error: redefinition of 'int main()' 80 | int main() | ^~~~ a.cc:19:5: note: 'int main()' previously defined here 19 | ...
s109657369
p00070
C++
#include <iostream> #include <vector> #include <algorithm> #include <map> using namespace std; int n,s; int cnt=0; int vvv[10]; int size; map<int,int> dp[11][1<<10]; map<int,int> dfs(int d,int si){ if(dp[d][si].size()!=0){ return dp[d][si]; } map<int,int> ret; if(d==n) return ret; for(int i = 0; i < 10; ...
a.cc: In function 'std::map<int, int> dfs(int, int)': a.cc:26:47: error: cannot bind non-const lvalue reference of type 'std::map<int, int>&' to an rvalue of type 'std::map<int, int>' 26 | map<int,int> &ss = dfs(d+1,(si&~(1<<i))); | ~~~^~~~~~~~...
s836622218
p00070
C++
#include<iostream> #include<string> using namespace std; int main(){ int n,s; int a[10],ans; while(cin >> n >> s){ ans = 0; int comb = (1 << n) - 1; while(comb < (1<<10)){ int cnt = 0; for(int i=0;i<10;i++){ if(comb >> i & 1){ a[cnt++] = i; } } do{ int sum = 0; for(int...
a.cc: In function 'int main()': a.cc:25:14: error: 'next_permutation' was not declared in this scope 25 | }while(next_permutation(a,a+n)); | ^~~~~~~~~~~~~~~~
s385955777
p00070
C++
include <cstdio> include <cmath> int DP[12][1030][331]; int slove(int k,int u,int s){ if(n>=11) return 0; if(s>=331) return 0; int res=0; if(s<0)return 0; if(DP[k][u][s]>=0) return DP[k][u][s]; if(k==n) { if((s%k)==0&&((int)pow(2,(s/k))&u)==0&&s/k<10){ res=1; //printf("%d %d %d hit\n",k,u,s); } } else...
a.cc:1:1: error: 'include' does not name a type 1 | include <cstdio> | ^~~~~~~ a.cc: In function 'int slove(int, int, int)': a.cc:6:12: error: 'n' was not declared in this scope 6 | if(n>=11) return 0; | ^ a.cc:10:12: error: 'DP' was not declared in this scope 10 | if(D...
s925001895
p00070
C++
#include <stdio.h> #include <string.h> #define SIZE (500); int dp[11][1 << 10][SIZE]; int main(void) { int n; int s; memset(dp, 0, sizeof(dp)); dp[0][0][0] = 1; for (int i = 0; i < 10; i++){ for (int j = 0; j < (1 << 10); j++){ for (int k = 0; k < SIZE; k++){ for (int l = 0; l < 10; l++){ ...
a.cc:4:19: error: expected ']' before ';' token 4 | #define SIZE (500); | ^ a.cc:6:21: note: in expansion of macro 'SIZE' 6 | int dp[11][1 << 10][SIZE]; | ^~~~ a.cc:6:25: error: expected unqualified-id before ']' token 6 | int dp[11][1 << 10][SIZE]; | ...
s374025334
p00070
C++
#include<iostream> int a[11][999]; void r(int n,int u,int s,int d){ a[n][s]++; for(int i=10;i-->0;) if(!(u>>i&1))r(n+1,u^1<<i,s+d*i,d+1); } main(){ r(0,0,0,1); for(int n,s;cin>>n>>s;)cout<<a[n][s]<<endl; }
a.cc:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 8 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:10:13: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 10 | for(int n,s;cin>>n>>s;)cout<<a[n][s]<<endl; | ^~~ | ...
s993012933
p00070
C++
#include <iostream> #include <cstring> #include <algorithm> using namespace std; int m[10][1024][350]; int search(int n, int s, int p){ if(n == 1){ if(s > 9) return 0; if((p & (1 << s)) == 0) return 1; else return 0; } // if(m[n-1][p][s] != -1) return m[n-1][p][s]; int r = 0; for(int j = min(s/n,...
a.cc: In function 'int search(int, int, int)': a.cc:16:40: error: 'i' was not declared in this scope 16 | r += search(n-1, s - n * j, (p | i << j)); | ^
s548048658
p00070
C++
#include <iostream> #define MAX_N 10 #define MAX_S 1000 using namespace std; int ans[MAX_N+1][MAX_S]; int used[10]; void calc(int n, int depth, int sum){ if (n+1 == depth) { ans[n][sum]++; return; } for (int i = 0; i < 10; i++) { if (used[i] == 0) { used[i] = 1; calc(n,depth+1,i*depth+sum); used[i] ...
a.cc: In function 'int main()': a.cc:26:9: error: 'memset' was not declared in this scope 26 | memset(ans, 0, sizeof(ans)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <c...
s996915458
p00070
C++
#include<iostream> #include<cstdlib> using namespace std; int dp[11][1<<10][331]; int dpset(int n, int data, int sum); int main(){ int n,m; memset(dp,-1,sizeof(dp)); while(cin>>n>>m){ if(m>330){cout<<"0"<<endl;} else{cout<<dpset(n,0,m)<<endl;} } return 0; } int dpset(int n, int data, int sum){ int ans = 0; i...
a.cc: In function 'int main()': a.cc:8:9: error: 'memset' was not declared in this scope 8 | memset(dp,-1,sizeof(dp)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<cstdlib> +++ |+#include <cstring...
s072316882
p00070
C++
#include<iostream> #include<algorithm> using namespace std; int dp[20][1000]; void Init(){ //int maxx=0; for(int i=0;i<=10;i++)for(int j=0;j<1000;j++)dp[i][j]=0; for(int i=0;i<=9;i++){ dp[0][i]++; for(int j=0;j<=9;j++){ if(i == j)continue; dp[1][i+j*2]++; for(int k=0;k<=9;k++){ if(k=...
a.cc: In function 'void Init()': a.cc:36:21: error: 'maxx' was not declared in this scope 36 | maxx = max(maxx,i+j*2+k*3+l*4+m*5+n*6+o*7+p*8+q*9); | ^~~~
s573331988
p00070
C++
#include <iostream> #include <bitset> int main() { const int N = 10; const int B = 1 << N; const int SMAX = 330; // 10*9 + 9*8 + ... + 2*1 + 1*0 = 90+72+56+42+30+20+12+6+2+0 = 330 int table[N + 1][SMAX + 1] = {0}; int (*bitTable)[SMAX + 1] = new int[B][SMAX + 1]; int emax[N + 1] = {0}; for (int i = 1; i <...
a.cc: In function 'int main()': a.cc:52:53: error: 'ac' was not declared in this scope 52 | std::cout << 0 << std::endl;ac | ^~
s450851922
p00070
C++
#include <stdio.h> #include <math.h> int a[10],i,n,s; int summing(int n,int s){ int ans=0,i,max=0,min=0,m; if(n==1){if(s<10 && a[s]==1)return 1; else return 0;} else{ for(i=0,m=n;m>0 && i<10;i++){if(a[i]==1){min+=m*i;m--;}} for(i=9,m=n;m>0 && i>=0;i--){if(a[i]==1){max+=m*i;m--;}} if(...
a.cc: In function 'int summing(int, int)': a.cc:18:17: error: expected '}' before 'else' 18 | else{ | ^~~~ a.cc:13:34: note: to match this '{' 13 | if(a[i]==1 && n*i<=s){ | ^ a.cc: At global scope: a.cc:28:1: error: expected ...
s114557351
p00070
C++
import sys d0=[0]*1024 d1=[[0 for i in range(286)]for j in range(1024)] B=[1,2,4,8,16,32,64,128,256,512] def init(): global d for i in range(1024): binary=format(i,'b') n0=binary.count('1') d0[i]=n0 if n0==1: d1[i][B.index(i)]=1 else: for j in range(len(binary)): dp=n0*j ...
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'
s146889273
p00070
C++
#include <iostream> #include <vector> using namespace std; typedef vector <int> vi; typedef vector <vi> vvi; #define REP(i,n) for(i=0;i<n;i++) int K=1024,N=331,B[]={1,2,4,8,16,32,64,128,256,512},C[1024]={0}; vvi D(K,vi(N)); int init(){ int i,tmp,tmp2,n,dp,i2,j,k; REP(i,K){ REP(j,N)D[i][j]=0; tmp=i,tmp2=0,n=0; w...
a.cc: In function 'int init()': a.cc:20:34: error: no matching function for call to 'find(int [10], int*, int&)' 20 | if(n==1)D[i][find(B,B+10,i)-B]=1; | ~~~~^~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, from /usr/inc...
s354085910
p00070
C++
#include <iostream> #define REP(i,n) for(i=0;i<n;i++) const int K=1024,N=331; int B[]={1,2,4,8,16,32,64,128,256,512},C[K]={0},D[K][N]={0}; int init(){ int i,tmp,tmp2,n,dp,i2,j,k; REP(i,K){ REP(j,N)D[i][j]=0; tmp=i,tmp2=0,n=0; while(tmp){ n+=tmp&1; tmp2++; tmp/=2; } C[i]=n; if(n==1)D[i][std::find(...
a.cc: In function 'int init()': a.cc:16:39: error: no matching function for call to 'find(int [10], int*, int&)' 16 | if(n==1)D[i][std::find(B,B+10,i)-B]=1; | ~~~~~~~~~^~~~~~~~~~ In file included from /usr/include/c++/14/bits/locale_facets.h:48, fro...
s778680945
p00070
C++
#include <iostream> #include <string> #include <map> #include <set> #include <cstring> #include <vector> #include <algorithm> using namespace std; int memo[10][10]; int N, S; int dfs(int cnt, int sum) { int ret = 0; if(sum > S) return 0; if(cnt == N+1) { return sum == S; } for(int i=0; i<10; i++)...
a.cc: In function 'int dfs(int, int)': a.cc:23:8: error: 'used' was not declared in this scope 23 | if(used[i]) continue; | ^~~~ a.cc:24:5: error: 'used' was not declared in this scope 24 | used[i] = 1; | ^~~~ a.cc: In function 'int main()': a.cc:35:10: error: 'used' was not declare...
s848971028
p00071
Java
s=gets.to_i for i in 1..s gets.chomp num=[] 8.times do num<<gets.chomp.split(//).map(&:to_i) end x=gets.to_i-1 y=gets.to_i-1 check=[x,y] until check.empty? y=check.pop x=check.pop (-3).upto(3) do |t| if (x+t)<8 && 0<=(x+t) && num[...
Main.java:1: error: class, interface, enum, or record expected s=gets.to_i ^ 1 error
s998096065
p00071
Java
import java.util.*; public class AOJ0071 { public static char[][] map = new char[8][8]; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int max_roop = sc.nextInt(); int playcount =1; while(max_roop>=playcount){ for(int i = 0;i < 8;i++){ String tmp = sc.next(); for(int...
Main.java:2: error: class AOJ0071 is public, should be declared in a file named AOJ0071.java public class AOJ0071 { ^ 1 error
s604197455
p00071
C
#include <stdio.h> #include <stdlib.h> void Input(BOMB *); void Output(BOMB *); void explode(BOMB *); typedef struct Bomb{ int map[8][8]; } BOMB; int main() { int input_times, input_cnt; BOMB bomb[50]; int x, y; /*Read input and process*/ scanf("%d", &input_times); for(input_cnt = 0; input_cnt < input_times...
main.c:4:12: error: unknown type name 'BOMB' 4 | void Input(BOMB *); | ^~~~ main.c:5:13: error: unknown type name 'BOMB' 5 | void Output(BOMB *); | ^~~~ main.c:6:14: error: unknown type name 'BOMB' 6 | void explode(BOMB *); | ^~~~ main.c: In function 'ma...
s961970475
p00071
C
#include <stdio.h> #include <stdlib.h> typedef struct Bomb { int map[8][8]; } BOMB; void Input(BOMB *); void Output(BOMB *); void explode(BOMB); int main() { int input_times, input_cnt; BOMB bomb[50]; int x, y; /*Read input and process*/ scanf("%d", &input_times); for(input_cnt = 0; input_cnt < input_times;...
main.c: In function 'main': main.c:26:25: error: incompatible type for argument 1 of 'explode' 26 | explode(&bomb[input_cnt]); | ^~~~~~~~~~~~~~~~ | | | BOMB * {aka struct Bomb *} main.c:11:14: note: expected 'BO...
s670298350
p00071
C
#include <stdio.h> #include <stdlib.h> typedef struct Bomb{ int map[8][8]; } BOMB; Input(BOMB *); void explode(BOMB *); int x_cnt, y_cnt; int main() { int input_times, input_cnt; BOMB Bomb[50]; int x, y; scanf("%d", &input_times); for(input_cnt = 0; input_cnt < input_times; input_cnt++){ Input(&Bomb[input...
main.c:8:1: warning: data definition has no type or storage class 8 | Input(BOMB *); | ^~~~~ main.c:8:1: error: type defaults to 'int' in declaration of 'Input' [-Wimplicit-int] main.c:39:1: error: return type defaults to 'int' [-Wimplicit-int] 39 | Input(BOMB *bomb) | ^~~~~ main.c: In function 'expl...
s775247743
p00071
C
#include <stdio.h> #include <stdlib.h> typedef struct Bomb{ int map[8][8]; } BOMB; void Input(BOMB *); void Output(BOMB); void explode(BOMB *); int x_cnt, y_cnt; int main() { int input_times, input_cnt; BOMB Bomb[50]; int x, y; scanf("%d", &input_times); for(input_cnt = 0; input_cnt < input_times; input_cnt...
main.c: In function 'Output': main.c:53:38: error: 'Bomb' undeclared (first use in this function) 53 | printf("%d", Bomb[input_cnt].map[x_cnt][y_cnt]); | ^~~~ main.c:53:38: note: each undeclared identifier is reported only once for each function it a...
s674581430
p00071
C
int a[8][8]; void f(int x, int y) { a[x][y]=0; for(int i=1;i<=3;i++) { if(x+i>7) break; if(a[x+i][y]) f(x+i,y); } for(int i=1;i<=3;i++) { if(x-i<0) break; if(a[x-i][y]) f(x-i,y); } for(int i=1;i<=3;i++) { if(y+i>7) break; if(a[x][y+i]) f(x,y+i); } for(int i=1;i<=3;i++) {...
main.c: In function 'solve': main.c:31:3: error: implicit declaration of function 'REP' [-Wimplicit-function-declaration] 31 | REP(i,8)REP(j,8) printf("%d%s",a[i][j],(j==7?"\n":"")); | ^~~ main.c:31:7: error: 'i' undeclared (first use in this function) 31 | REP(i,8)REP(j,8) printf("%d%s",a[i][j],(j==7...
s691414460
p00071
C
#include<stdio.h> #include<string.h> char m[10][10]; int n,j,k,x,y,g=0; int main(){ scanf("%d\n\n",&n); while(n--){g++; for(int i=0;i<8;i++)scanf("%8s\n",m[i]); scanf("%d\n%d\n\n",&x,&y); m[y-1][x-1]='0'; ex(y-1,x-1); printf("Data %d:\n",g); for(int i=0;i<8;i++)printf("%s\n",m[i]); } return 0; }
main.c: In function 'main': main.c:13:17: error: implicit declaration of function 'ex' [-Wimplicit-function-declaration] 13 | ex(y-1,x-1); | ^~
s212685336
p00071
C++
gets.to_i.times{|n| gets m=(1..8).map{gets} q=[[gets.to_i-1,gets.to_i-1]] while q!=[] x,y=q.pop x<8&&x>=0&&y<8&&y>=0&&m[y][x]>?0&&( m[y][x]=?0 q.push *(-3..3).flat_map{|i|[[x,y+i],[x+i,y]]} ) end puts "Data #{n+1}:",m }
a.cc:3:4: error: too many decimal points in number 3 | m=(1..8).map{gets} | ^~~~ a.cc:9:11: error: too many decimal points in number 9 | q.push *(-3..3).flat_map{|i|[[x,y+i],[x+i,y]]} | ^~~~ a.cc:1:1: error: 'gets' does not name a type 1 | gets.to_i.times{|n| | ^~~~
s510443342
p00071
C++
import std.stdio, std.string, std.conv; import std.array, std.algorithm, std.range; void main() { immutable N = 8; immutable n = readln().chomp().to!int(); foreach(i;0..n) { readln(); auto m = iota(N).map!(_=>readln.chomp().to!(char[])()).array(); immutable x = readln().chomp()....
a.cc:8:15: error: too many decimal points in number 8 | foreach(i;0..n) | ^~~~ a.cc:19:27: error: too many decimal points in number 19 | foreach(k;1..4) | ^~~~ a.cc:1:1: error: 'import' does not name a type 1 | import std.stdio, std.stri...
s986938869
p00071
C++
#include<bits/stdc++.h> using namespace std; #define rep(i, n) for(int i = 0; i < n; i++) #define FOR(i, s, n) for(int i = s; i <= (int)n; ++i) #define per(i, n) for(int i = n; i > 0; i--) #define ROF(i, s, n) for(int i = s; i >= (int)n; i--) #define FORIT(i, A) for (auto i : A) #define PRINT(x) cout << (x) << "\n" #de...
a.cc:24:22: error: conflicting declaration 'typedef long long unsigned int uint' 24 | typedef unsigned int uint; | ^~~~ In file included from /usr/include/stdlib.h:514, from /usr/include/c++/14/cstdlib:79, from /usr/include/x86_64-linux-gnu/c++/14/bits/std...
s509671144
p00071
C++
#include <bits/stdc++.h> using namespace std; char bomb[8][8]; void printData(int i) { cout << "Data " << i+1 << ':' << endl; } void dfs(int x, int y) { bomb[y][x] = '0'; for (int i = x-3; i <= x+3; i++) { if ((0 <= i && i <= 7) && bomb[y][i] == '1') dfs(i, y); } for (int j = y-3; j <= y+3...
a.cc: In function 'int main()': a.cc:55:2: error: expected '}' at end of input 55 | } | ^ a.cc:30:33: note: to match this '{' 30 | for (int i = 0; i < n; i++) { | ^ a.cc:55:2: error: expected '}' at end of input 55 | } | ^ a.cc:25:1: note: to match this '...
s812139668
p00071
C++
#include<iostream> #include<cstdio> using namespace std; int dfs(int x,int y); char maps[8][8]; int dx[12]={-1,-2,-3,1,2,3,0,0,0,0,0,0}; int dy[12]={0,0,0,0,0,0,-1,-2,-3,1,2,3}; int strx[65]={0}; int stry[65]={0}; int k=0; int main(){ int n,sx,sy,cas; cin >> n; for(cas=1;cas<=n;cas++){ for(int i=0;i<8;i++)...
a.cc: In function 'int dfs(int, int)': a.cc:48:3: warning: no return statement in function returning non-void [-Wreturn-type] 48 | } | ^ a.cc: At global scope: a.cc:49:3: error: expected unqualified-id before 'for' 49 | for(int i=0;i<12;i++){ | ^~~ a.cc:49:15: error: 'i' does not name a type ...
s342516038
p00071
C++
#include<iostream> #include<cstdio> using namespace std; int dfs(int x,int y); char maps[8][8]; int dx[12]={-1,-2,-3,1,2,3,0,0,0,0,0,0}; int dy[12]={0,0,0,0,0,0,-1,-2,-3,1,2,3}; int strx[65]={0}; int stry[65]={0}; int k=0; int main(){ int n,sx,sy,cas; cin >> n; for(cas=1;cas<=n;cas++){ for(int i=0;i<8;i++)...
a.cc: In function 'int dfs(int, int)': a.cc:48:3: warning: no return statement in function returning non-void [-Wreturn-type] 48 | } | ^ a.cc: At global scope: a.cc:49:3: error: expected unqualified-id before 'for' 49 | for(int i=0;i<12;i++){ | ^~~ a.cc:49:15: error: 'i' does not name a type ...
s278678495
p00071
C++
#define REP(i,n) for (int i=0;i<(n);i++)??? #include <iostream> using namespace std; const int MAX = 8; int set,n; int sx,sy; char field[MAX][MAX]; int dx[12] = {1, 0, -1, 0, 2, 0, -2, 0, 3, 0, -3, 0};??? int dy[12] = {0, 1, 0, -1, 0, 2, 0, -2, 0, 3, 0, -3}; void dfs (int x,int y){ field[x][y] = '0'; REP(i,12){...
a.cc:12:54: error: expected unqualified-id before '?' token 12 | int dx[12] = {1, 0, -1, 0, 2, 0, -2, 0, 3, 0, -3, 0};??? | ^ a.cc: In function 'void dfs(int, int)': a.cc:1:41: error: expected primary-expression before '?' token 1 | #define REP(i,n) for ...
s455040605
p00071
C++
int a[8][8]; void f(int x, int y) { a[x][y]=0; for(int i=1;i<=3;i++) { if(x+i>7) break; if(a[x+i][y]) f(x+i,y); } for(int i=1;i<=3;i++) { if(x-i<0) break; if(a[x-i][y]) f(x-i,y); } for(int i=1;i<=3;i++) { if(y+i>7) break; if(a[x][y+i]) f(x,y+i); } for(int i=1;i<=3;i++) {...
a.cc: In function 'void solve(int, int)': a.cc:31:7: error: 'i' was not declared in this scope 31 | REP(i,8)REP(j,8) printf("%d%s",a[i][j],(j==7?"\n":"")); | ^ a.cc:31:3: error: 'REP' was not declared in this scope 31 | REP(i,8)REP(j,8) printf("%d%s",a[i][j],(j==7?"\n":"")); | ^~~ a.cc: In...
s581734849
p00071
C++
#include <iostream> #include <math.h> #include <algorithm> #include <vector> #include <string> #include <map> using namespace std; #define ll long long #define rep(i,n) for(int i=0;i<n;i++) #define ld long double #define forever while(true) int vx[13]={-3,-2,-1,0,0,0,0,0,0,0,1,2,3}; int vy[13]={0,0,0,0,-3,-2,-1,1,2,3...
a.cc: In function 'int blow(int, int)': a.cc:29:8: error: invalid types 'int [8][8][<unresolved overloaded function type>]' for array subscript 29 | a[next][nexty]=0; | ^
s676032695
p00071
C++
#include <iostream> #include <math.h> #include <algorithm> #include <vector> #include <string> #include <map> using namespace std; #define ll long long #define rep(i,n) for(int i=0;i<n;i++) #define ld long double #define forever while(true) int vx[13]={-3,-2,-1,0,0,0,0,0,0,0,1,2,3}; int vy[13]={0,0,0,0,-3,-2,-1,1,2,3...
a.cc:37:9: error: extended character — is not valid in an identifier 37 | while(n—){ | ^ a.cc: In function 'int main()': a.cc:37:9: error: 'n\U00002014' was not declared in this scope 37 | while(n—){ | ^~
s829663761
p00071
C++
Last login: Sat May 26 19:20:24 on ttys002 Risa-no-MacBook:~ Risa$ cd Desktop/ Risa-no-MacBook:Desktop Risa$ cd programming/ Risa-no-MacBook:programming Risa$ mkdir 0226 Risa-no-MacBook:programming Risa$ cd 0 0226/ 0416/ 0417/ 0423/ 0424/ 0501/ 0507/ 0508/ 0514/ 0515/ 0521/ 0522/ Risa-no-MacBook:programming Risa$ rmdi...
a.cc:6:43: error: invalid digit "8" in octal constant 6 | 0226/ 0416/ 0417/ 0423/ 0424/ 0501/ 0507/ 0508/ 0514/ 0515/ 0521/ 0522/ | ^~~~ a.cc:8:41: error: invalid digit "8" in octal constant 8 | Risa-no-MacBook:programming Risa$ mkdir 0528 | ...
s916083911
p00071
C++
//0071 #include<stdio.h> #include<algorithm> using namespace std; const int N = 8; char board[N][N+2]; void Fire(int i, int j) { if(board[i][j] != '1') return; board[i][j] = '0'; int d; for(d = max(j-3, 0); d < min(j+4, N); ++d) { Fire(i, d); } for(d = max(i-3, 0); d < min(i+4, N); ++d) { Fire(d, j); ...
a.cc: In function 'int main()': a.cc:35:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 35 | gets(board[i]); | ^~~~ | getw
s123745392
p00071
C++
#include <iostream> using namespace std; char field[14][14]; int dx[12] = {-3, -2, -1, 0, 0, 0, 0, 0, 0, 1, 2, 3}; int dy[12] = { 0, 0, 0, 1, 2, 3, -1, -2, -3, 0, 0, 0}; void DFS(int y, int x) { field[y][x] = '0'; for(int i = 0; i < 12; ++i) { int X = x + dx[i]; int Y = y + dy[i]; if((3 <= X && X <= 10 ...
a.cc: In function 'void solve()': a.cc:30:17: error: 'memset' was not declared in this scope 30 | memset(field, 0, sizeof(field)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostre...
s689115093
p00071
C++
#include<stdio.h> #include<iostream> char map[8][9]; int start[2]; void explosion(int x,int y){ int ai; map[x][y]='0'; int j,k; for(i=-3;i<4;i++){ if((x+i>=0)&&(x+i<9)&&(map[x+i][y]=='1')){ explosion(x+i,y); } if((y+i>=0)&&(y+i<9)&&(map[x][y+i]=='1')){ explosion(x,y+i); } } return; } int main(){ in...
a.cc: In function 'void explosion(int, int)': a.cc:9:13: error: 'i' was not declared in this scope 9 | for(i=-3;i<4;i++){ | ^ a.cc: In function 'int main()': a.cc:37:2: error: expected '}' at end of input 37 | } | ^ a.cc:19:11: note: to match this '{' 19 | int main(){ | ...
s601431194
p00071
C++
#include <iostream> using namespace std; bool field[9][9]; void vis(int x, int y){ if(x<0 || 8<x || y<0 || 8<y || field[y][x]==0){ return; } if(field[y][x]==1){ field[y][x]=0; for(int t=1; t<=3; ++t){ vis(x+t, y); vis(x-t, y); vis(x, y+t); vis(x, y-t); } } return; } int main(){ ...
a.cc: In function 'int main()': a.cc:61:2: error: expected '}' at end of input 61 | } | ^ a.cc:31:11: note: to match this '{' 31 | int main(){ | ^
s275068121
p00071
C++
//まともに使い方を理解していないくせにincludeしまくる人間のクズ #include <cstdio> #include <cmath> #include <cstdlib> #include <cstring> #include <cctype> #include <vector> #include <algorithm> #include <stack> #include <queue> #include <list> #include <set> #include <map> #include <bitset> //using namespace stdしないと表記がめんどくさいからね、仕方ないね using nam...
a.cc:59:1: error: expected declaration before '}' token 59 | } | ^
s000442767
p00071
C++
//まともに使い方を理解していないくせにincludeしまくる人間のクズ #include <cstdio> #include <cmath> #include <cstdlib> #include <cstring> #include <cctype> #include <vector> #include <algorithm> #include <stack> #include <queue> #include <list> #include <set> #include <map> #include <bitset> //using namespace stdしないと表記がめんどくさいからね、仕方ないね using nam...
a.cc:59:1: error: expected declaration before '}' token 59 | } | ^
s026950585
p00071
C++
#include<iostream> #include<string> #include<vector> using namespace std; #define loop(i,a,b) for(int i=a;i<b;i++) void bom(int x,int y,char& in[8][8]){ in[x][y]='0'; loop(i,-3,4){ loop(j,-3,4){ if(i&&j)continue; if(x+i>=0&&x+i<8&&y+j>=0&&y+j<8&&in[x+i][y+j]=='1')bom(x+i,y+j,in); } } } int ma...
a.cc:6:28: error: declaration of 'in' as array of references 6 | void bom(int x,int y,char& in[8][8]){ | ^~ a.cc: In function 'void bom(...)': a.cc:7:3: error: 'in' was not declared in this scope; did you mean 'int'? 7 | in[x][y]='0'; | ^~ | int a.cc:7:6: error...
s736301901
p00072
C
#include<stdio.h> int main(void){ int n,m,o; int a[101][101],b[101][101],c[2],r[3]={0}; int d=0,e=0,f=0,ans=0; int x,y,z; int h,i,j; scanf("%d%d",&n,&m); for(h=0;h<m;h++){ scanf("%d,%d,%d",&x,&y,&z); a[x][y]=1; a[y][x]=1; b[x][y]=z; b[y][x]=z; } ...
main.c: In function 'main': main.c:42:36: error: expected expression before '>' token 42 | if(b[h][i]=>r[2]){ | ^
s893159162
p00072
C
#include<stdio.h> int main(void){ int n,m,o; int a[101][101],b[101][101],c[2],r[3]={0}; int d=0,e=0,f=0,ans=0; int x,y,z; int h,i,j; scanf("%d%d",&n,&m); for(h=0;h<m;h++){ scanf("%d,%d,%d",&x,&y,&z); a[x][y]=1; a[y][x]=1; b[x][y]=z; b[y][x]=z; } ...
main.c: In function 'main': main.c:42:36: error: expected expression before '>' token 42 | if(b[h][i]=>r[2]){ | ^
s220584760
p00072
C
#include<stdio.h> #define INF 1000000000 void MST(int); int edge[101][101],v[101],d[101],sum=0,n; int main(void){ int m,a,b,i,j, cost; while(1){ count=0; scanf("%d",&n); if(n==0)break; scanf("%d",&m); for(i=0;i<101;i++){ for(j=0;j<101;j++){ edge[i][j]=INF; } } ...
main.c: In function 'main': main.c:12:7: error: 'count' undeclared (first use in this function) 12 | count=0; | ^~~~~ main.c:12:7: note: each undeclared identifier is reported only once for each function it appears in main.c: In function 'MST': main.c:66:12: error: implicit declaration of function ...
s243215038
p00072
C++
#include <iostream> #include <vector> #include <tuple> // Union Find template<class T=int> class UnionFind { std::vector<T> p; std::vector<T> r; T find(const T x) { if(x==p[x]) return x; return p[x]=find(p[x]); } void unite_(T x, T y) { if(x==y) return; if(r[...
a.cc: In function 'T& kruskal(T&, U)': a.cc:48:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 48 | std::sort(edges.begin(),edges.end()); | ^~~~ | qsort a.cc:51:14: error: 'remove_if' is not a member of 'std'; did you mean 'remove_cv'? 51 | std::remove_i...
s654508209
p00072
C++
#include <iostream> #include <vector> #include <tuple> // Union Find template<class T=int> class UnionFind { std::vector<T> p; std::vector<T> r; T find(const T x) { if(x==p[x]) return x; return p[x]=find(p[x]); } void unite_(T x, T y) { if(x==y) return; if(r[...
a.cc: In function 'T& kruskal(T&, U)': a.cc:48:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 48 | std::sort(edges.begin(),edges.end()); | ^~~~ | qsort a.cc:51:14: error: 'remove_if' is not a member of 'std'; did you mean 'remove_cv'? 51 | std::remove_i...
s628960094
p00072
C++
#include<bits/stdc++.h> using namespace std; typedef vector<int> vi; class UF{ vi p,r; public: UF(int n):p(n,-1),r(n,0){ } int find(int x){ return (p[x]<0)?x:(p[x] = find(p[x])); } void unite(int x,int y){ x = find(x); y = find(y); if(x==y)return; if(r[x] < r[y])p[x] = y; else p[y] = x; ...
a.cc: In member function 'int Kruskal::MinSpanningTree()': a.cc:48:17: error: expected ';' before '.' token 48 | for(edge e.: g[v])edges.push_back(e); | ^ a.cc:48:17: error: expected primary-expression before '.' token a.cc:48:18: error: expected unqualified-id before ':' token 48 | ...
s269497161
p00072
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define pb push_back struct EDGE { int to, cost; bool operator < (const EDGE& t) const { return cost > t.cost; } }; vector<EDGE> v[100]; bool f[100]; int search() { int res = 0; prioritiy_queue<EDGE> que; ...
a.cc: In function 'int search()': a.cc:17:5: error: 'prioritiy_queue' was not declared in this scope 17 | prioritiy_queue<EDGE> que; | ^~~~~~~~~~~~~~~ a.cc:17:25: error: expected primary-expression before '>' token 17 | prioritiy_queue<EDGE> que; | ^ a.cc:17:27: err...
s489104168
p00072
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; struct Edge{ int from, to, cost; }; bool comp(const Edge& e1, const Edge& e2){ return e1.cost < e2.cost; } const int N = 1 << 30; vector<Edge> e; int par[N]; int rank_[N]; int find(int x) { if(x == par[x]) return x...
/tmp/cciZKGCn.o: in function `unite(int, int)': a.cc:(.text+0xe0): relocation truncated to fit: R_X86_64_PC32 against symbol `rank_' defined in .bss section in /tmp/cciZKGCn.o a.cc:(.text+0xf7): relocation truncated to fit: R_X86_64_PC32 against symbol `rank_' defined in .bss section in /tmp/cciZKGCn.o a.cc:(.text+0x14...
s125262512
p00072
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; struct Edge{ int from, to, cost; }; bool comp(const Edge& e1, const Edge& e2){ return e1.cost < e2.cost; } const int N = 10000; vector<Edge> e; int par[N]; int rank[N]; int find(int x) { if(x == par[x]) return x; ...
a.cc: In function 'void unite(int, int)': a.cc:33:12: error: reference to 'rank' is ambiguous 33 | if(rank[x] < rank[y]) | ^~~~ In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, from /usr/include/c++/...
s464306870
p00072
C++
#include<iostream> #include<cstdio> #include<queue> #include<vector> using namespace std; typedef pair<int, int> P; int N, M; vector<P> g[100]; bool done[100]; int main() { while(true) { fill(done, done + 100, 0); for(int i = 0; i < 100; i++) g[i].reset(); cin >> N; if(!N) break; ...
a.cc: In function 'int main()': a.cc:18:12: error: 'class std::vector<std::pair<int, int> >' has no member named 'reset' 18 | g[i].reset(); | ^~~~~
s529362938
p00072
C++
int mincost[MAX_V]; //集合Xからの最小コスト bool used[MAX_V]; //頂点iがxに含まれているか int m; //頂点数 using namespace std; int main(){ int n,i,c,j,a,b; while(1){ scanf("%d",&n); if(n==0) break; scanf("%d",&m); for(j=0;j<m;j++){ for(i=0;i<m;++i){ cost[j][i]=INF; } } for(i=0;i<m;i++){ scanf("%d,%d...
a.cc:1:13: error: 'MAX_V' was not declared in this scope 1 | int mincost[MAX_V]; //集合Xからの最小コスト | ^~~~~ a.cc:2:11: error: 'MAX_V' was not declared in this scope 2 | bool used[MAX_V]; //頂点iがxに含まれているか | ^~~~~ a.cc: In function 'int main()': a.cc:11:5: error: 'scanf' was not declar...
s183637633
p00072
C++
#include <queue> #include <vector> #include <iostream> #include <algorithm> using namespace std; long long prim(int V, vector<pair<long long, long long>> X[]) { for (int i = 0; i < V; i++) { dist[i] = INF; color[i] = WHITE; } dist[0] = 0; color[0] = GRAY; Q.push(make_pair(0, 0)); while (!Q.empty()) { pair<long lon...
a.cc: In function 'long long int prim(int, std::vector<std::pair<long long int, long long int> >*)': a.cc:7:39: error: 'dist' was not declared in this scope 7 | for (int i = 0; i < V; i++) { dist[i] = INF; color[i] = WHITE; } | ^~~~ a.cc:7:49: error: 'INF' was not...
s735781018
p00072
C++
#include <queue> #include <vector> #include <iostream> #include <algorithm> #define WHITE 0 #define GRAY 1 #define BLACK 2 #define INF 1000000000000000000LL using namespace std; long long prim(int V, vector<pair<long long, long long>> X[]) { for (int i = 0; i < V; i++) { dist[i] = INF; color[i] = WHITE; } dist[0] = 0...
a.cc: In function 'long long int prim(int, std::vector<std::pair<long long int, long long int> >*)': a.cc:11:39: error: 'dist' was not declared in this scope 11 | for (int i = 0; i < V; i++) { dist[i] = INF; color[i] = WHITE; } | ^~~~ a.cc:11:54: error: 'color' was...