submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s824147676
p00478
C++
#include <iostream> #include <string> using namespace std; char str[11]; int n; const int MAX_N = 100; char s[MAX_N][11]; char t[MAX_N][22]; int count = 0; void check(int i){ for(int j=0;t[i][j]!='\0';j++){ int k; for(k=0;str[k] != '\0';k++){ if(t[i][j+k] != str[k]){ break; } } if(str[k] == '\0'){ ...
a.cc: In function 'int main()': a.cc:33:17: error: 'strcpy' was not declared in this scope 33 | strcpy(t[i],s[i]); | ^~~~~~ a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#inc...
s583083081
p00478
C++
import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String args[]) { String tar = sc.next(); int N = sc.nextInt(); int ans = 0; for(int i = 0; i < N; i++) { String s = sc.next(); String con = s + s; if(con.contains(tar)) ans++; } System.out...
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:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s768472179
p00478
C++
#include <cstdio> #include <string.h> int i; int n,num=0; int main(){ char search[10]; while(search[i]!=NULL) scanf("%c\n",&search[i]); scanf("%d\n",&n); for(int j=0;j<n;j++){ char array[10]; char array2[20]; scanf("%c",&array[i]); strncat(array2,array,10); strncpy(array2,array,10); if (strpbrk(arr...
a.cc: In function 'int main()': a.cc:9:26: warning: NULL used in arithmetic [-Wpointer-arith] 9 | while(search[i]!=NULL) scanf("%c\n",&search[i]); | ^~~~ a.cc:22:26: error: expected '}' at end of input 22 | return 0; | ^ a.cc:7...
s757217877
p00478
C++
#include <iostream> #include <string> using namespace std; int main(void) { string fin,model; int n,ans=0; cin >> fin; cin >> n; for(int i = 0; i < n; i++){ cin >> model; model += model; if(strstr(model.c_str(), fin.c_str())) ans++; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:20: error: 'strstr' was not declared in this scope 17 | if(strstr(model.c_str(), fin.c_str())) | ^~~~~~ a.cc:2:1: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include ...
s072686550
p00478
C++
#include<stdio.h> #include<algorithm> #define rep(i,j) for(int i=0;i<(j);i++) #define reps(i,j,k) for(int i=j;i<=k;i++) using namespace std; int main(){ char k[11]; int n,cnt=0;; char s[21]; size_t l=sizeof(char)*10; scanf("%s%d",k,&n); rep(i,n){ scanf("%s",s); memcpy(s+10,s,l); if(strstr(s,k)!=NULL)cnt...
a.cc: In function 'int main()': a.cc:18:17: error: 'memcpy' was not declared in this scope 18 | memcpy(s+10,s,l); | ^~~~~~ a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorithm> +++ |+#incl...
s850188192
p00478
C++
include<iostream> #include<algorithm> #include<string> #include<cstdlib> using namespace std; int main(){ string s; cin >> s; int n,ret = 0; cin >> n; for(int i = 0 ; i < n ; i++ ){ string buff; cin >> buff; buff += buff + buff + buff + buff; if(buff.find(s)) ret++; } cout << ret << endl...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __g...
s562713086
p00478
C++
#include<stdio.h> #include<string.h> int main(void) { int s,m[10],mz; int k,i; int cnt; cnt=0; scanf("%s",&s); scanf("%d",&k); for(i=0;i<k;i++){ scanf("%s",&m[i]); } for(i=0;i<k;i++){ strcat(mz,m[i]); if(strstr(mz,s)){ cnt++; } } return 0; }
a.cc: In function 'int main()': a.cc:15:24: error: invalid conversion from 'int' to 'char*' [-fpermissive] 15 | strcat(mz,m[i]); | ^~ | | | int In file included from a.cc:2: /usr/include/string.h:149:39: note: in...
s063741260
p00478
C++
#include<stdio.h> #include<string.h> int main(void) { int s,m[10],mz; int k,i; int cnt; cnt=0; scanf("%s",s); scanf("%d",&k); for(i=0;i<k;i++){ scanf("%s",m[i]); } for(i=0;i<k;i++){ strcat(mz,m[i]); if(strstr(mz,s)){ cnt++; } } return 0; }
a.cc: In function 'int main()': a.cc:15:24: error: invalid conversion from 'int' to 'char*' [-fpermissive] 15 | strcat(mz,m[i]); | ^~ | | | int In file included from a.cc:2: /usr/include/string.h:149:39: note: in...
s033906711
p00478
C++
#include<stdio.h> #include<string.h> int main(void) { int s,m[10],mz; int k,i; int cnt; cnt=0; scanf("%s",&s); scanf("%d",&k); for(i=0;i<k;i++){ scanf("%s",&m[i]); } for(i=0;i<k;i++){ strcat(mz,m[i]); if(strstr(mz,s)){ cnt++; } } return 0; }
a.cc: In function 'int main()': a.cc:15:24: error: invalid conversion from 'int' to 'char*' [-fpermissive] 15 | strcat(mz,m[i]); | ^~ | | | int In file included from a.cc:2: /usr/include/string.h:149:39: note: in...
s528760655
p00478
C++
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main() { char* sr[10]; int slr; char* sa[100][10]; int sla; int kazoe=0; int syokazoe=0; printf("%s",sr); cin>>sla; for(int i=0;i<sla;i++){ printf("%s",sa[i]); } slr=(int)strlen(sr); //いっこずつ for(int i=0;i<sla;i++){ //開...
a.cc: In function 'int main()': a.cc:20:25: error: cannot convert 'char**' to 'const char*' 20 | slr=(int)strlen(sr); | ^~ | | | char** In file included from /usr/include/c++/14/cstring:43, from a.cc:3:...
s027549170
p00478
C++
#include <iostream> #include <string> using namespace std; int main() { int N; string str; cin >> str; cin >> N; int goodR=0; for(int i=0;i<N;i++){ string ring; cin >> ring; ring+=ring; int now=0; for(int j=0;j<20;j++){ if(str[now]==ring[j]) ...
a.cc: In function 'int main()': a.cc:21:19: error: expected '}' at end of input 21 | now=0; | ^ a.cc:15:30: note: to match this '{' 15 | for(int j=0;j<20;j++){ | ^ a.cc:21:19: error: expected '}' at end of input 21 | now...
s693138436
p00479
Java
import java.util.*;class Main{public static void main(String[]n){Scanner s=new Scanner(System.in);for(int n=s.nextInt()+1,m=n/2,a,b,i=s.nextInt();i-->0;)System.out.println((m-1-Math.max(Math.abs((a=s.nextInt()-m)>0&&n%2>0?a-1:a),Math.abs((b=s.nextInt()-m)>0&&n%2>0?b-1:b)))%3+1);}}
Main.java:1: error: variable n is already defined in method main(String[]) import java.util.*;class Main{public static void main(String[]n){Scanner s=new Scanner(System.in);for(int n=s.nextInt()+1,m=n/2,a,b,i=s.nextInt();i-->0;)System.out.println((m-1-Math.max(Math.abs((a=s.nextInt()-m)>0&&n%2>0?a-1:a),Math.abs((b=s.ne...
s225062038
p00479
C
#include<stdio.h> int main(){ int n,k,ai,bi,i,k,c; scanf("%d",&n); scanf("%d",&k); for(i=0;i<k;i++){ scanf("%d%d",&ai,&bi); if(n+1-ai<ai)ai=n+1-ai; if(n+1-bi<bi)bi=n+1-bi; if(ai>bi)c=(ai-1)%3+1; else c=(bi-1)%3+1; printf("%d\n",c); } return 0; }
main.c: In function 'main': main.c:3:25: error: redeclaration of 'k' with no linkage 3 | int n,k,ai,bi,i,k,c; | ^ main.c:3:15: note: previous declaration of 'k' with type 'int' 3 | int n,k,ai,bi,i,k,c; | ^
s336708073
p00479
C
#include<stdio.h> int main(){ int n,k,ai,bi,i,k,c; scanf("%d",&n); scanf("%d",&k); for(i=0;i<k;i++){ scanf("%d%d",&ai,&bi); if(n+1-ai<ai)ai=n+1-ai; if(n+1-bi<bi)bi=n+1-bi; if(ai>bi)c=(ai-1)%3+1; else c=(bi-1)%3+1; printf("%d\n",c); } return 0; }
main.c: In function 'main': main.c:3:25: error: redeclaration of 'k' with no linkage 3 | int n,k,ai,bi,i,k,c; | ^ main.c:3:15: note: previous declaration of 'k' with type 'int' 3 | int n,k,ai,bi,i,k,c; | ^
s545829144
p00479
C
#include<stdio.h> int main(){ int n,k,ai,bi,i,k,c; scanf("%d",&n); scanf("%d",&k); for(i=0;i<k;i++){ scanf("%d%d",&ai,&bi); if(n+1-ai<ai)ai=n+1-ai; if(n+1-bi<bi)bi=n+1-bi; if(ai>bi)c=(bi-1)%3+1; else c=(ai-1)%3+1; printf("%d\n",c); } return 0; }
main.c: In function 'main': main.c:3:25: error: redeclaration of 'k' with no linkage 3 | int n,k,ai,bi,i,k,c; | ^ main.c:3:15: note: previous declaration of 'k' with type 'int' 3 | int n,k,ai,bi,i,k,c; | ^
s658014779
p00479
C
#include<stdio.h> int main() { int n,k,i,j,c,e,d,f,t,a,b; scanf("%d %d",&n,&k); e=n/2; f=n%2; for(i=0;i<k;i++){ scanf("%d %d",&a,&b); if(f==0){ if(a==e){ c=n-a; c=c%3; } else if(b==e){ c=n-b; c=c%3; } } if(a<e && b<e){ c=min(a,b); c=c%3; } else if(a>e && b<e){ c=min(a,b); ...
main.c: In function 'main': main.c:21:27: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration] 21 | c=min(a,b); | ^~~ | main main.c:35:27: error: implicit declaration of function '...
s382721191
p00479
C
#include<stdio.h> volatile int N //int N=0; int KIMOCHI(int a,int b) { //int N; // A if(a<b){ if(a+b<=N){ if(a%3==0){ return 3; } else{ return a%3; } } else{ //int cy=N-b+1; if((N-b+1)%3==0){ return 3; } else{ return (N-b+1)%3; } } } // B else { //int cy; //c...
main.c:2:15: error: expected ';' before 'int' 2 | volatile int N | ^ | ; 3 | //int N=0; 4 | int KIMOCHI(int a,int b) | ~~~ main.c: In function 'KIMOCHI': main.c:9:25: error: 'N' undeclared (first use in this function) 9 | if(a+b<=...
s037899648
p00479
C
#include <stdio.h> #defaine N 1000000000 int main(){ int kabe[N][N],a[N],b[N]; int nagasa,naga,i,j,k,l,m=0,n; int t,f; scanf("%d",&nagasa); scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d",&a[i],&b[i]); } naga=nagasa-1; if(nagasa%2==1){ for(i=0;i<nagasa/2+1;i++){ if(m%3==0){ for(j=m;j<naga-i;j++){ for(k=m;k<naga-i;k++...
main.c:2:2: error: invalid preprocessing directive #defaine; did you mean #define? 2 | #defaine N 1000000000 | ^~~~~~~ | define main.c: In function 'main': main.c:5:10: error: 'N' undeclared (first use in this function) 5 | int kabe[N][N],a[N],b[N]; | ^ main.c:5:10: note: each undec...
s910604565
p00479
C++
#include <iostream> #include <algorithm> #include<vector> int main() { int n; int b; std::cin >> n >> b; std::vector<int> v(b); for (int i = 0; i < b; ++i) { int x, y; int a = 0; std::cin >> x >> y; a = std::min(n - x, std::min(n - y, std::min(x-1, y-1))); v[i] = a % 3; } for (int i = 0; i < b; ++i) { ...
a.cc: In function 'int main()': a.cc:26:10: error: expected '}' at end of input 26 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s982911406
p00479
C++
int main(){ int i,i2,n,m,a,b,core,aa,bb,ans; scanf("%d%d",&n,&m); for(i=1;i<=m;i++){ scanf("%d%d",&a,&b); aa=a; bb=b; core=n/2; if(n%2==1)core++; if(a>core)aa=n-aa+1; if(b>core)bb=n-bb+1; if(aa>bb){ ans=bb; } else{ ans=aa; } ans%=3; if(ans==0)ans=3; printf("%d\n",ans); } }
a.cc: In function 'int main()': a.cc:3:9: error: 'scanf' was not declared in this scope 3 | scanf("%d%d",&n,&m); | ^~~~~ a.cc:20:17: error: 'printf' was not declared in this scope 20 | printf("%d\n",ans); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in ...
s240391262
p00479
C++
#include <stdio.h> int main(){ long int N,K,a,b,i,j,A,B; scanf("%ld",&N); scanf(" %ld",&K); if(N%2==0){ for(a=0;a<K;a++){ scanf(" %ld %ld",&A,&B); for(b=1;b<=N/2;b++){ if(A==b||B==b||A==(N-b+1)||B==(N-b+1)){ for(i=0;i<3;i++){ if(b%3==i){ printf("%ld\n"...
a.cc: In function 'int main()': a.cc:56:17: error: lvalue required as left operand of assignment 56 | if(A%3=j){ | ~^~
s494256360
p00479
C++
#include<stdio.h> int main() { int n,k,i,j,c,e,d,f,t,a[10000],b[10000]; scanf("%d %d",&n,&k); for(i=0;i<k;i++){ scanf("%d %d",&a[i],&b[i]); } e=n/2; f=n%2; for(i=0;i<k;i++){ if(f==0){ if(a[i]==e){ c=n-a[i]; c=c%3; } else if(b[i]==e){ c=n-b[i]; c=c%3; } } if(a[i]<e && b[i]<e){ c=min...
a.cc: In function 'int main()': a.cc:23:27: error: 'min' was not declared in this scope; did you mean 'main'? 23 | c=min(a[i],b[i]); | ^~~ | main a.cc:27:27: error: 'min' was not declared in this scope; did you mean 'main'? 27...
s213957755
p00479
C++
#include<iostream> using namespace std; main(n,k,x,y,w){ cin>>n>>k; while(k--){ cin>>x>>y; cout<<(min(min(x,y),min(n-x+1,n-y+1))-1)%3+1<<endl; } }
a.cc:3:5: error: expected constructor, destructor, or type conversion before '(' token 3 | main(n,k,x,y,w){ | ^
s454645419
p00479
C++
#include<iostream> using namespace std; main(n,k,x,y,w){ cin>>n>>k; while(k--){ cin>>x>>y; cout<<(min(min(x,y),min(n-x+1,n-y+1))-1)%3+1<<endl; } return 0; }
a.cc:3:5: error: expected constructor, destructor, or type conversion before '(' token 3 | main(n,k,x,y,w){ | ^
s889863161
p00479
C++
#include <cstdio> #include <algorithm> using namespace std; int n,k;//n‚Í‚¢‚Á‚Ø‚ñ‚ɃAƒ‹ƒ^ƒCƒ‹‚̐”Bk‚͂͂ª‚ꂽ–‡” int a,b; int main(){ scanf("%d\n",&n); scanf("%d\n",&k); for (int j=0;j<k;j++){ scanf("%d",&a); scanf("%d",&b); int x = a-1; int y = b-1; int z = n-x-1; int w = n-y-1; ...
a.cc: In function 'int main()': a.cc:24:9: error: 'retur' was not declared in this scope 24 | retur | ^~~~~ a.cc:24:14: error: expected '}' at end of input 24 | retur | ^ a.cc:9:11: note: to match this '{' 9 | int main(){ | ^
s657288687
p00479
C++
#include <stdio.h> #define N 1000000000 int main(){ int n,i,j,f,t,a[N][N]; int k,h,w; f=0; t=3; scanf("%d",&n); while(1){ if(t<=2)break; t=0; if(f%3==0){ for(i=f;i<n-f;i++){ t++; for(j=f;j<n-f;j++){ a[i][j]=1; } } f++; continue; } else if(f%3==1){ for(i=f;i<n-f;i++){ t++; for(j=f;j<n-f;j++){ a[i][j]=2; } } f++; conti...
a.cc: In function 'int main()': a.cc:52:2: error: expected '}' at end of input 52 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s299958438
p00479
C++
#define N 1000000000 int main(){ int n,i,j,f,t,a[N][N]; int k,x,y,h[1001],w[1001]; f=0; t=3; scanf("%d",&n); while(1){ if(t<=2)break; t=0; if(f%3==0){ for(i=f;i<n-f;i++){ t++; for(j=f;j<n-f;j++){ a[i][j]=1; } } f++; continue; } else if(f%3==1){ for(i=f;i<n-f;i++){ t++; for(j=f;j<n-f;j++){ a[i][j]=2; } } f++; continue...
a.cc: In function 'int main()': a.cc:9:1: error: 'scanf' was not declared in this scope 9 | scanf("%d",&n); | ^~~~~ a.cc:53:1: error: 'printf' was not declared in this scope 53 | printf("%d\n",a[x-1][y-1]); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by...
s614341599
p00479
C++
#include <stdio.h> int min(int,int); int main(){ int n,k,i,x,y,f; scanf("%d%d",&n,&k); for(i=0;i<k;i++){ scanf("%d %d",&x,&y); x= x>=n/2 ? n-x+1:x; y= y>=n/2 ? n-y+1:y; f=(min(x,y)%3 ? min(x,y)%3:3; printf("%d\n",f); } return 0; } int min(int a,int b) { if(a>b){ return b; } return a; }
a.cc: In function 'int main()': a.cc:13:29: error: expected ')' before ';' token 13 | f=(min(x,y)%3 ? min(x,y)%3:3; | ~ ^ | )
s649136298
p00479
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; int main(){ int n,k; vector<int> ans; cin >> n >> k; while(k--){ cin >> x >> y; int h = min(x,n-x+1); int w = min(y,n-y+1); if(h > w){ ans.push_back(w-1)%3+1; } else{ ans.push_back(h-1)%3+1; } } int len = ans.si...
a.cc: In function 'int main()': a.cc:14:24: error: 'x' was not declared in this scope 14 | cin >> x >> y; | ^ a.cc:14:29: error: 'y' was not declared in this scope 14 | cin >> x >> y; | ^ a.cc:20:43: error: invalid oper...
s784751013
p00479
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; int main(){ int n,k; vector<int> ans; cin >> n >> k; while(k--){ int x,y; cin >> x >> y; int h = min(x,n-x+1); int w = min(y,n-y+1); if(h > w){ ans.push_back(w-1)%3+1; } else{ ans.push_back(h-1)%3+1; } } int l...
a.cc: In function 'int main()': a.cc:21:43: error: invalid operands of types 'void' and 'int' to binary 'operator%' 21 | ans.push_back(w-1)%3+1; | ~~~~~~~~~~~~~~~~~~^~ | | | | ...
s003470652
p00479
C++
#include <stdio.h> #include <algorithm> int ans[1005]; int main(void) { int n, k, a, b; int i, j, s; int lenl, lenr, lent, lenb; scanf("%d", &n); scanf("%d", &k); for (i = 0; i < k; i++){ scanf("%d %d", &a, &b); lenl = a - 1; lenr = n - a; lent = b - 1; lenb = n - b; s = min(min(lenl, lenr), ...
a.cc: In function 'int main()': a.cc:22:25: error: 'min' was not declared in this scope; did you mean 'std::min'? 22 | s = min(min(lenl, lenr), min(lent, lenb)); | ^~~ | std::min In file included from /usr/include/c++/14/algorithm:61, ...
s106154482
p00480
Java
import java.util.Scanner; // First Grader public class Main2 { public static void main(String[] args) { new Main2().run(); } void run() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] number = new int[n]; for (int i = 0; i < n; i++) number[i] = sc.nextInt(); long[][] dp = new long...
Main.java:31: error: class, interface, enum, or record expected import java.util.Scanner; ^ 1 error
s879192747
p00480
Java
import java.util.Scanner; // First Grader public class Main { public static void main(String[] args) { new Main2().run(); } void run() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] number = new int[n]; for (int i = 0; i < n; i++) number[i] = sc.nextInt(); long[][] dp = new long[...
Main.java:31: error: class, interface, enum, or record expected import java.util.Scanner; ^ 1 error
s570137143
p00480
Java
import java.util.Scanner; // First Grader public class Main { public static void main(String[] args) { new Main2().run(); } void run() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] number = new int[n]; for (int i = 0; i < n; i++) number[i] = sc.nextInt(); long[][] dp = new long[...
Main.java:6: error: cannot find symbol new Main2().run(); ^ symbol: class Main2 location: class Main 1 error
s384166415
p00480
C
#include<stdio.h> int main(void) { longlong kaz[101][21] = { 0 }; int n,su[101]; int i,j; scanf("%d", &n); for (i = 0;i < n;i++) { scanf("%d", &su[i]); } kaz[0][su[0]]++; for (i = 1;i < n - 1;i++) { for (j = 0;j < 21;j++) { if (kaz[i-1][j] >= 1) { if (j + su[i] < 21) { kaz[i][j + su[i]] += kaz[i...
main.c: In function 'main': main.c:3:9: error: unknown type name 'longlong' 3 | longlong kaz[101][21] = { 0 }; | ^~~~~~~~
s063677743
p00480
C
a;main(){scanf("%d",&a);puts(a-=20?a-=20?a-=10?a-=40?"671013170798012928":"31320243434344576":"1671496112":"3443144":"488");}
main.c:1:1: warning: data definition has no type or storage class 1 | a;main(){scanf("%d",&a);puts(a-=20?a-=20?a-=10?a-=40?"671013170798012928":"31320243434344576":"1671496112":"3443144":"488");} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:3: error: return typ...
s651409706
p00480
C
#include<cstdio> int i,j,k,n; long long int a[110][25],x; //long long int b; int main(){ scanf("%d%lld",&n,&x); for(i=0;i<n-1;i++)for(j=0;j<=20;j++)a[i][j]=0; a[0][x]=1; for(i=1;i<n-1;i++){ scanf("%lld",&x); for(j=0;j<=20;j++){ if(a[i-1][j]>0){ if(j+x<=20 && j+x>=0)a[i][j+x]+=a[i-1][j]; if(j-x<=20 ...
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s844592135
p00480
C
#include<iostream> long long a[2][40],i,n,j;main(){for(a[1][9]=1;std::cin>>n;++i)for(j=8;i&&++j-30;)a[~i&1][j]=a[i&1][j-n]+a[i&1][j+n];std::cout<<a[~i&1][n+9]<<'\n';}
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s660786360
p00480
C
#include<iostream> #include<algorithm> #include<string> #include<vector> using namespace std; vector<int> num; int total,limit; long long cont=0; void math(int pl,int res){ int add,sub; add = res + num[pl]; sub = res - num[pl]; if(add<=20 && add>=0){ if(pl==limit-2 && add==total){ cont++; ...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s710050143
p00480
C
#include<iostream> #include<algorithm> #include<string> #include<vector> using namespace std; vector<int> num; int total,limit; long long cont=0; void math(int pl,int res){ int add,sub; add = res + num[pl]; sub = res - num[pl]; if(add<=20 && add>=0){ if(pl==limit-2 && add==total){ cont++; ...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s074581495
p00480
C
#include<iostream> #include<algorithm> #include<string> #include<vector> using namespace std; typedef long long ll; ll num[101]; ll memo[101][101]; ll limit; ll math(ll p,ll sum){ if(sum<0 || sum>20) return 0; else if(p == limit-1 )return sum == num[p]; else if(memo[p][sum]>0)return memo[p][sum]; else return m...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s379206666
p00480
C
x[101],i,j,n,long long dp[80][80];main(){scanf("%lld",&n);for(i=1;i<=n;i++){scanf("%d",&x[i]);}dp[1][50+x[1]]=1;for(i=2;i<n;i++){for(j=0;j<=20;j++){dp[i][50+j]=dp[i-1][50+j+x[i]]+dp[i-1][50+j-x[i]];}}printf("%lld\n",dp[n-1][50+x[n]]);return 0;}
main.c:1:1: warning: data definition has no type or storage class 1 | x[101],i,j,n,long long dp[80][80];main(){scanf("%lld",&n);for(i=1;i<=n;i++){scanf("%d",&x[i]);}dp[1][50+x[1]]=1;for(i=2;i<n;i++){for(j=0;j<=20;j++){dp[i][50+j]=dp[i-1][50+j+x[i]]+dp[i-1][50+j-x[i]];}}printf("%lld\n",dp[n-1][50+x[n]]);return 0;} ...
s765960580
p00480
C
#include <stdio.h>long long x[101],i,j,dp[100][80],n;main(){scanf("%d",&n);for(i=1;i<=n;i++){scanf("%lld",&x[i]);}dp[1][50+x[1]]=1;for(i=2;i<n;i++){for(j=0;j<=20;j++){dp[i][50+j]=dp[i-1][50+j+x[i]]+dp[i-1][50+j-x[i]];}}printf("%lld\n",dp[n-1][50+x[n]]);return 0;}
main.c:1:19: warning: extra tokens at end of #include directive 1 | #include <stdio.h>long long x[101],i,j,dp[100][80],n;main(){scanf("%d",&n);for(i=1;i<=n;i++){scanf("%lld",&x[i]);}dp[1][50+x[1]]=1;for(i=2;i<n;i++){for(j=0;j<=20;j++){dp[i][50+j]=dp[i-1][50+j+x[i]]+dp[i-1][50+j-x[i]];}}printf("%lld\n",dp[n-1][50+x[...
s366709075
p00480
C
#include <stdio.h> #include <string.h> #define N 101 int n; int right; int val[N]; __int64 memo[N][21]; // 今まで合計値=num __int64 getWay(int i, int num) { __int64 ret = 0; if (memo[i][num] >= 0){ return (memo[i][num]); } if (i == n - 1){ if (num == right){ return (1); } else { return (0); } } ...
main.c:9:1: error: unknown type name '__int64'; did you mean '__int64_t'? 9 | __int64 memo[N][21]; | ^~~~~~~ | __int64_t main.c:12:1: error: unknown type name '__int64'; did you mean '__int64_t'? 12 | __int64 getWay(int i, int num) | ^~~~~~~ | __int64_t main.c: In function 'getWay': main....
s110554992
p00480
C
#include <stdio.h> #include <string.h> #define N 101 #define RIGHT 100 int shiki[N]; int n; __int64 memo[N][21]; // i番目の数字, 今までの合計値 __int64 getWay(int i, int num) { __int64 ret = 0; int dx[] = {1, -1}; int j; if (memo[i][num] != -1){ return (memo[i][num]); } if (i == n - 2){ if (num == shiki[RIGHT]){ ...
main.c:9:1: error: unknown type name '__int64'; did you mean '__int64_t'? 9 | __int64 memo[N][21]; | ^~~~~~~ | __int64_t main.c:12:1: error: unknown type name '__int64'; did you mean '__int64_t'? 12 | __int64 getWay(int i, int num) | ^~~~~~~ | __int64_t main.c: In function 'getWay': main....
s204795865
p00480
C
#include ,stdio.h>
main.c:1:10: error: #include expects "FILENAME" or <FILENAME> 1 | #include ,stdio.h> | ^
s736069587
p00480
C++
#include <cstdio> #include <vector> using namespace std; #define MAX_N 100 typedef __int64 Int; int N, A[MAX_N]; Int table[MAX_N][21]; Int dp(int p, int res){ if(res > 20 || res < 0) return 0; if(p == N - 1){ return (res == A[p])? 1 : 0; } if(table[p][res] > -1) return table[p][res]; return table[p][res] = dp(...
a.cc:6:9: error: '__int64' does not name a type; did you mean '__int64_t'? 6 | typedef __int64 Int; | ^~~~~~~ | __int64_t a.cc:8:1: error: 'Int' does not name a type; did you mean 'int'? 8 | Int table[MAX_N][21]; | ^~~ | int a.cc:10:1: error: 'Int' does not name a type; d...
s997991659
p00480
C++
#include <cstdio> #include <vector> using namespace std; #define MAX_N 100 typedef long long Int; int N, A[MAX_N]; Int table[MAX_N][21]; Int dp(int p, int res){ if(res > 20 || res < 0) return 0; if(p == N - 1){ return (res == A[p])? 1 : 0; } if(table[p][res] > -1) return table[p][res]; return table[p][res] = d...
a.cc: In function 'int main()': a.cc:25:9: error: 'memset' was not declared in this scope 25 | memset(table, -1, sizeof(table)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <vector> +++ |+#include...
s196334933
p00480
C++
#include <iostream> #include <vector> #include <math.h> #include <string> #include <string.h> #include <stack> #include <algorithm> using namespace std; int a[100]; __int64 dp[100][21]; int n; __int64 rec(int i, int j) { if (j < 0 || 20 < j) { return 0; } if (i == n - 2) { if (j == a[i]) { return 1; ...
a.cc:11:1: error: '__int64' does not name a type; did you mean '__int64_t'? 11 | __int64 dp[100][21]; | ^~~~~~~ | __int64_t a.cc:14:1: error: '__int64' does not name a type; did you mean '__int64_t'? 14 | __int64 rec(int i, int j) | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:...
s077810280
p00480
C++
#include <iostream> #include <vector> #include <math.h> #include <string> #include <string.h> #include <stack> #include <algorithm> #include <stdio.h> using namespace std; int a[100]; __int64 dp[100][21]; int n; __int64 rec(int i, int j) { if (j < 0 || 20 < j) { return 0; } if (i == n - 2) { if (j == a[i]) ...
a.cc:12:1: error: '__int64' does not name a type; did you mean '__int64_t'? 12 | __int64 dp[100][21]; | ^~~~~~~ | __int64_t a.cc:15:1: error: '__int64' does not name a type; did you mean '__int64_t'? 15 | __int64 rec(int i, int j) | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:...
s205288625
p00480
C++
#include<stdio.h> #include<stdlib.h> int* nums; int done[21][100]; int isOK[21][100];//0ならともにダメ 1なら+のみ -1なら-のみ 2なら両方 const int true = 1; const int false = 0; int ans = 0; int n; void solve(int,int); int main() { scanf("%d",&n); nums = (int*)malloc(sizeof(int)*n); int i,j; for(i=0;i<n;i++) { scanf("%d",&nums[...
a.cc:7:11: error: expected unqualified-id before 'true' 7 | const int true = 1; | ^~~~ a.cc:8:11: error: expected unqualified-id before 'false' 8 | const int false = 0; | ^~~~~
s456667759
p00480
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int ban[500],a; int ans; __int64 x; int dfs(int sum,int hukasa){ if(hukasa==a-1){ if(sum==ban[a-1]){ //cout<<sum; x++; return 1; } return 0; } int res=0; if(sum+ban[hukasa]<=20)res+=dfs(sum+ban[hukasa],hukasa+1); //return res; if...
a.cc:7:1: error: '__int64' does not name a type; did you mean '__int64_t'? 7 | __int64 x; | ^~~~~~~ | __int64_t a.cc: In function 'int dfs(int, int)': a.cc:12:9: error: 'x' was not declared in this scope 12 | x++; | ^
s470361523
p00480
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int ban[500],a; int dp[101][101]={{0},{0}}; int ans; __int64 x; int dfs(int sum,int hukasa){ if(dp[sum][hukasa]!=-1)return dp[sum][hukasa]; if(hukasa==a-1){ if(sum==ban[a-1]){ //cout<<sum; x++; return 1; } return 0; } int res=0; if...
a.cc:8:1: error: '__int64' does not name a type; did you mean '__int64_t'? 8 | __int64 x; | ^~~~~~~ | __int64_t a.cc: In function 'int dfs(int, int)': a.cc:14:9: error: 'x' was not declared in this scope 14 | x++; | ^
s158859616
p00480
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int ban[500],a; unsigned __int64 dp[101][1001]={{0},{0}}; int ans; unsigned __int64 dfs(int sum,int hukasa){ if(dp[sum][hukasa]!=-1)return dp[sum][hukasa]; if(hukasa==a-1){ if(sum==ban[a-1]){ //cout<<sum; return 1; } return 0; } unsi...
a.cc:6:19: error: expected initializer before 'dp' 6 | unsigned __int64 dp[101][1001]={{0},{0}}; | ^~ a.cc:8:18: error: expected initializer before 'dfs' 8 | unsigned __int64 dfs(int sum,int hukasa){ | ^~~ a.cc: In function 'int main()': a.cc:28:54: error: 'dp' wa...
s932594153
p00480
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,k,n) for(int i = (k); i < (n); i++) #define REP(i,n) FOR(i,0,n) #define INF 114514810 #define ELEM(array) (sizeof (array)/sizeof *(array)) #define MAX_N 100 #define SAFE_FREE(ptr) if( ptr != NULL ){ free(ptr); ptr = NULL; } typedef unsigned int UINT; typedef...
a.cc: In function 'll solve(int, int)': a.cc:19:13: error: 'dp' was not declared in this scope; did you mean 'dup'? 19 | if (dp[i][j] >= 0)return dp[i][j];//探索済み | ^~ | dup a.cc:20:16: error: 'n' was not declared in this scope 20 | if (i==n-1) | ...
s926347897
p00480
C++
#include <cstdio> using namespace std; typedef __int64 Int; int main(){ const int MAX_N = 100; int N; int a[MAX_N]; Int dp[MAX_N + 1][21]; for(int i = 0; i <= MAX_N; i++){ for(int j = 0; j <= 20; j++){ dp[i][j] = 0; } } scanf("%d", &N); for(int i = 0; i < N; i++){ scanf("%d", a + i); } dp[0][...
a.cc:4:9: error: '__int64' does not name a type; did you mean '__int64_t'? 4 | typedef __int64 Int; | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:10:9: error: 'Int' was not declared in this scope; did you mean 'int'? 10 | Int dp[MAX_N + 1][21]; | ^~~...
s094839226
p00480
C++
#include <iostream> #include <vector> std::vector<int> seq_number; int count; // count of the number int answer; //depth-first search void dfs(int i, int computation){ if(i==count-2){ if(computation == seq_number.back()) ++answer; }else{ if(computation >= 0){ dfs(i+1, computation+seq_number[i]); dfs(i+1, ...
a.cc: In function 'int main()': a.cc:22:26: error: expected ';' before 'seq_number' 22 | std::cin >> count | ^ | ; 23 | seq_number.resize(count); | ~~~~~~~~~~
s822973208
p00480
C++
#include <iostream> #include <vector> std::vector<int> seq_number; int count; // count of the number int answer; //depth-first search void dfs(int i, int computation){ if(i==count-2){ if(computation == seq_number.back()) ++answer; }else{ if(computation >= 0){ dfs(i+1, computation+seq_number[i]); dfs(i+1, ...
a.cc: In function 'int main()': a.cc:22:26: error: expected ';' before 'seq_number' 22 | std::cin >> count | ^ | ; 23 | seq_number.resize(count); | ~~~~~~~~~~
s668723690
p00480
C++
#include <iostream> #include <vector> #include <array> #include <iterator> #include <algorithm> int main(){ int num; while(std::cin >> num){ //input std::vector<int> factor; for(int i = 0; i < num; ++i){ int buf; std::cin >> buf; factor.push_back(buf); } std::array<int, 21> count = {0}; //0~20 ...
a.cc: In function 'int main()': a.cc:33:69: error: 'begin' was not declared in this scope; did you mean 'std::begin'? 33 | std::copy(tmp_count.begin(), tmp_count.end(), count,begin()); | ^~~~~ | ...
s203235375
p00480
C++
#include <iostream> #include <vector> #include <array> #include <iterator> #include <algorithm> int main(){ int num; while(std::cin >> num){ //input std::vector<int> factor; for(int i = 0; i < num; ++i){ int buf; std::cin >> buf; factor.push_back(buf); } std::array<int, 21> count = {0}; //0~20 ...
a.cc: In function 'int main()': a.cc:39:47: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 39 | std::cout << count.front() << endl; | ^~~~ | std::endl In file included from...
s907716847
p00480
C++
#include <iostream> #include <vector> #include <array> #include <iterator> #include <algorithm> int main(){ int num; while(std::cin >> num){ //input std::vector<int> factor; for(int i = 0; i < num; ++i){ int buf; std::cin >> buf; factor.push_back(buf); } std::array<int, 21> count = {0}; //0~20 ...
a.cc: In function 'int main()': a.cc:37:47: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 37 | std::cout << count.front() << endl; | ^~~~ | std::endl In file included from...
s098999604
p00480
C++
#include <iostream> #include <vector> #include <array> #include <iterator> #include <algorithm> int main(){ int num; while(std::cin >> num){ //input std::vector<int> factor; for(int i = 0; i < num; ++i){ int buf; std::cin >> buf; factor.push_back(buf); } std::array<int, 21> count = {0}; //0~20 ...
a.cc: In function 'int main()': a.cc:38:24: error: no match for call to '(std::vector<int>) ()' 38 | ~factor(); | ~~~~~~^~
s977845370
p00480
C++
#include <iostream> using namespace std; typedef long long ll; int main() { int n; cin >> n; ll dp[101][21]; int t[101]; memset(dp,0,sizeof(dp)); for ( int i = 1; i <= n; i++ ) cin >> t[i]; dp[1][t[1]] = 1; for ( int i = 2; i < n; i++ ) { for ( int j = 0; j <= 20; j++ ) { if ( j + t[i] <= 20...
a.cc: In function 'int main()': a.cc:10:3: error: 'memset' was not declared in this scope 10 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | ...
s458486404
p00480
C++
#include <iostream> using namespace std; typedef long long ll; int main() { int n; cin >> n; ll dp[101][21]; int t[101]; memset(dp,0,sizeof(dp)); for ( int i = 1; i <= n; i++ ) cin >> t[i]; dp[1][t[1]] = 1; for ( int i = 2; i < n; i++ ) { for ( int j = 0; j <= 20; j++ ) { if ( j + t[i] <= 20...
a.cc: In function 'int main()': a.cc:10:3: error: 'memset' was not declared in this scope 10 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | ...
s618940758
p00480
C++
#include <iostream> #include <string> using namespace std; typedef long long ll; int main() { int n; cin >> n; ll dp[101][21]; int t[101]; memset(dp,0,sizeof(dp)); for ( int i = 1; i <= n; i++ ) cin >> t[i]; dp[1][t[1]] = 1; for ( int i = 2; i < n; i++ ) { for ( int j = 0; j <= 20; j++ ) { i...
a.cc: In function 'int main()': a.cc:11:3: error: 'memset' was not declared in this scope 11 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | ...
s166279005
p00480
C++
#include <stdio.h> long long memo[101][21]; int data[101]; int N; long long fanc(int flo,int num) { long long ret; if(memo[flo][num]!=-1) { return memo[flo][num]; } if(flo==0) { return fanc(flo+1,num+data[flo]); } if(flo==N-1) { return memo[flo][num]; } if(num+data[flo]<=20) { ret+=fanc(flo+1,...
a.cc: In function 'int main()': a.cc:49:29: error: expected primary-expression before ']' token 49 | if(data[0]==0){memo[]} | ^ a.cc:50:33: error: expected ';' before '}' token 50 | printf("%d\n",fanc(0,0)) | ^ | ...
s591910324
p00480
C++
#include<iostream> using namespace std; long long int k[21][101],n,num,sum; main(){ cin>>n; for(int i=0;i<n;i++){cin>>num[i];} k[num[0]][0]=1; for(int i=1;i<n-1;i++){for(int j=0;j<21;j++){ if(j+num[i]<21){k[j+num[i]][i]+=k[j][i-1];} if(j-num[i]>=0){k[j-num[i]][i] += k[j][i-1];} }} sum=k[num[n-1]][n-2]; cout<<sum<<endl;...
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:6:30: error: invalid types 'long long int[int]' for array subscript 6 | for(int i=0;i<n;i++){cin>>num[i];} | ^ a.cc:7:6: error: i...
s468849627
p00480
C++
#include<iostream> using namespace std; long long int k[21][101],n,q[100],sum; main(){cin>>n; for(int i=0;i<n;i++){cin>>q[i];} k[num[0]][0]=1; for(int i=1;i<n-1;i++){for(int j=0;j<21;j++){ if(j+num[i]<21){k[j+q[i]][i]+=k[j][i-1];} if(j-num[i]>=0){k[j-q[i]][i]+=k[j][i-1];} }} cout<<k[q[n-1]][n-2]<<endl;}
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main(){cin>>n; | ^~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'num' was not declared in this scope; did you mean 'sum'? 6 | k[num[0]][0]=1; | ^~~ | sum
s502515512
p00480
C++
#include <iostream> #define int long long using namespace std; int a[101]; int n; int memo[101][21]; int fanc(int lo,int sum) { if (sum < 0 || 20 < sum){ return 0; } if (lo == n - 1){ return (a[lo] == sum); } if (memo[lo][sum] != -1) { return memo[lo][sum]; } else { return memo[lo][sum] = fanc(lo + 1, ...
a.cc: In function 'int main()': a.cc:33:9: error: 'memset' was not declared in this scope 33 | memset(memo,-1,sizeof(memo)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <...
s477745854
p00480
C++
#include <iostream> using namespace std; int n; int x[100]; long long int dp[101][21]; int main() { cin >> n; for(int i = 0; i < n; i++){ cin >> x[i]; } for(int i = 0; i <= n; i++){ for(int j = 0; j <= 20; j++){ dp[i][j] = 0; } } dp[0][0] = 1; for(int i = 1; i < n; i++){ for(int ...
a.cc:38:1: error: expected declaration before '}' token 38 | } | ^
s887605770
p00480
C++
#include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> int compare_int(const void* a, const void* b) { return *(int*) a - *(int*) b; } int n, s[100], ans; __int64 dp[100][1000]; __int64 func(int a, int sum) { if (a == n-1) return sum == ans ? 1 : 0; __int64 cnt = 0; if (sum - s[a + 1] >= 0) { if...
a.cc:9:1: error: '__int64' does not name a type; did you mean '__int64_t'? 9 | __int64 dp[100][1000]; | ^~~~~~~ | __int64_t a.cc:11:1: error: '__int64' does not name a type; did you mean '__int64_t'? 11 | __int64 func(int a, int sum) { | ^~~~~~~ | __int64_t a.cc: In function 'int main()':...
s501593367
p00480
C++
#include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> int compare_int(const void* a, const void* b) { return *(int*) a - *(int*) b; } int n, s[100], ans; __int64 dp[100][1000]; __int64 func(int a, int sum) { if (a == n-1) return sum == ans ? 1 : 0; __int64 cnt = 0; if (sum - s[a + 1] >= 0) { if...
a.cc:9:1: error: '__int64' does not name a type; did you mean '__int64_t'? 9 | __int64 dp[100][1000]; | ^~~~~~~ | __int64_t a.cc:11:1: error: '__int64' does not name a type; did you mean '__int64_t'? 11 | __int64 func(int a, int sum) { | ^~~~~~~ | __int64_t a.cc: In function 'int main()':...
s403749192
p00480
C++
#include <iostream> #include <cstdio> using namespace std; typedef long long LL; int main(void) { int n, a[100] = {0}; LL dp[100][21] = {0}; cin >> n; REP(i, n) scanf("%d", &a[i]); dp[n-1][a[n-1]] = 1; for (int i = n - 2; i >= 0; --i) { for (int j = 0; j <= 20; ++j) { if (j + a[i] <= 20) dp[i][j] += dp[...
a.cc: In function 'int main()': a.cc:12:13: error: 'i' was not declared in this scope 12 | REP(i, n) scanf("%d", &a[i]); | ^ a.cc:12:9: error: 'REP' was not declared in this scope 12 | REP(i, n) scanf("%d", &a[i]); | ^~~
s443051573
p00480
C++
#include <iostream> #include <vector> #include <algorithm> #include <math.h> int main(){ int n,number,start,plus,minus; while(std::cin >> n){ std::vector<int> numbers; for(int i=0; i<n; ++i){ std::cin >> number; numbers.push_back(number); } int whole = (int)pow(2.0,(double)(n-2)); std::vector<int...
a.cc: In function 'int main()': a.cc:74:10: error: expected '}' at end of input 74 | } | ^ a.cc:6:11: note: to match this '{' 6 | int main(){ | ^
s934760239
p00480
C++
#include <iostream> #include <vector> #include <algorithm> #include <math.h> int main(){ int n,number,start,plus,minus; while(std::cin >> n){ std::vector<int> numbers; for(int i=0; i<n; ++i){ std::cin >> number; numbers.push_back(number); } int whole = (int)pow(2.0,(double)(n-2)); std::vector<int...
a.cc: In function 'int main()': a.cc:63:17: error: 'unsigned_int64' was not declared in this scope 63 | unsigned_int64 sum = 0; | ^~~~~~~~~~~~~~ a.cc:68:35: error: 'sum' was not declared in this scope 68 | ++sum; | ...
s329746068
p00480
C++
#include <iostream> #include <vector> #include <algorithm> #include <math.h> int main(){ int n,number,start,plus,minus; while(std::cin >> n){ std::vector<int> numbers; for(int i=0; i<n; ++i){ std::cin >> number; numbers.push_back(number); } int whole = (int)pow(2.0,(double)(n-2)); std::vector<int...
a.cc: In function 'int main()': a.cc:63:17: error: 'unsigned_int64' was not declared in this scope 63 | unsigned_int64 sum = 0; | ^~~~~~~~~~~~~~ a.cc:68:35: error: 'sum' was not declared in this scope 68 | ++sum; | ...
s099432681
p00480
C++
#include <iostream> #include <vector> #include <algorithm> #include <math.h> int main(){ int n,number,start,plus,minus; while(std::cin >> n){ std::vector<int> numbers; for(int i=0; i<n; ++i){ std::cin >> number; numbers.push_back(number); } int whole = (int)pow(2.0,(double)(n-2)); std::vector<int...
a.cc: In function 'int main()': a.cc:63:17: error: 'unsigned_int64' was not declared in this scope 63 | unsigned_int64 sum = 0; | ^~~~~~~~~~~~~~ a.cc:68:35: error: 'sum' was not declared in this scope 68 | ++sum; | ...
s968524775
p00480
C++
#include <iostream> using namespace std; #define N 101 int main() { int n, ans; int arr[N]; __int64 table[N][21]; cin >> n; for(int i = 0; i < n - 1; i++) cin >> arr[i]; for(int i = 0; i < n - 1; i++) { for(int j = 0; j < 21; j++) table[i][j] = 0; } cin >> ans; table[0][arr[0]] = 1; for(int i = 1; i...
a.cc: In function 'int main()': a.cc:11:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 11 | __int64 table[N][21]; | ^~~~~~~ | __int64_t a.cc:17:45: error: 'table' was not declared in this scope; did you mean 'mutable'? 17 | for(int...
s478688593
p00480
C++
while True: N = int(input()) if N == 0: break a = list(map(int, input().split())) ## dp[i][j]: i???????????°????????§??§j????????????????????° dp = [[0 for j in range(21)] for i in range(N-1)] dp[0][a[0]] = 1 for i in range(1, N-1): for j in range(21): if (j - a...
a.cc:7:5: error: stray '##' in program 7 | ## dp[i][j]: i???????????°????????§??§j????????????????????° | ^~ a.cc:7:30: error: extended character ° is not valid in an identifier 7 | ## dp[i][j]: i???????????°????????§??§j????????????????????° | ^ a.cc:7:39: e...
s782358189
p00480
C++
n = int(input()) a = list(map(int, input().split())) dp = [[0] * 21 for i in range(n)] dp[0][0] = 1 for i in range(n - 1): for j in range(21): if dp[i][j] == 0: continue if 0 <= j + a[i] <= 20: dp[i + 1][j + a[i]] += dp[i][j] if 0 <= j - a[i] <= 20: dp[i + 1][j - a[i]] +...
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s928321151
p00480
C++
#include <vector> #include <sstream> #include <deque> std::vector<std::vector<long int> > table; void outtable(std::vector<std::vector<int> > t){ for(int i = 0; i < t.size(); ++i){ for(int j = 0; j < t[i].size(); ++j){ std::cout << t[i][j] << " "; } std::cout << std::endl; ...
a.cc: In function 'void outtable(std::vector<std::vector<int> >)': a.cc:10:18: error: 'cout' is not a member of 'std' 10 | std::cout << t[i][j] << " "; | ^~~~ a.cc:4:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' ...
s344012065
p00480
C++
#include <iostream> #include <vector> #include <sstream> #include <deque> std::vector<std::vector<long int> > table; void outtable(std::vector<std::vector<long int> > t){ for(int i = 0; i < t.size(); ++i){ for(int j = 0; j < t[i].size(); ++j){ std::cout << t[i][j] << " "; } std...
a.cc: In function 'int calc(std::deque<int>, int)': a.cc:34:1: warning: no return statement in function returning non-void [-Wreturn-type] 34 | } | ^ a.cc: In function 'int main()': a.cc:53:88: error: no matching function for call to 'std::vector<std::vector<long int> >::vector(int&, std::vector<int>)' 53 |...
s482710276
p00480
C++
#include <iostream> using namespace std; void Recurrent(__int64 *count, int *num, int current, int total, int max, int ans) { int plas = total + num[current + 1]; if ((current + 1) == max && plas == ans) { (*count)++; } if (current != max) { if (plas < 20 && plas >= 0) { Recurrent(count, num, current + ...
a.cc:5:6: error: variable or field 'Recurrent' declared void 5 | void Recurrent(__int64 *count, int *num, int current, int total, int max, int ans) | ^~~~~~~~~ a.cc:5:16: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 5 | void Recurrent(__int64 *count, int *num, int curren...
s038236408
p00480
C++
#include <iostream> using namespace std; void Recurrent(__int64 *count, int *num, int current, int total, int max, int ans) { int plas = total + num[current + 1]; if ((current + 1) == max && plas == ans) { (*count)++; } if (current != max) { if (plas < 20 && plas >= 0) { Recurrent(count, num, current + ...
a.cc:5:6: error: variable or field 'Recurrent' declared void 5 | void Recurrent(__int64 *count, int *num, int current, int total, int max, int ans) | ^~~~~~~~~ a.cc:5:16: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 5 | void Recurrent(__int64 *count, int *num, int curren...
s509523731
p00480
C++
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<cstdlib> #include <cmath> #include<stdio.h> #include<queue> #include<stack> #include<set> #define MAX 1000000000000000000LL long long inf=1000000007; using namespace std; using ll=long long; int main(){ int n; cin>>n; int num[101...
a.cc: In function 'int main()': a.cc:33:14: error: expected '}' at end of input 33 | return 0; | ^ a.cc:16:11: note: to match this '{' 16 | int main(){ | ^
s199342003
p00480
C++
#include <iostream> using namespace std; int n; int a[105]; long long memo[105][22]; long long solve(int i, int j) { long long result = 0; if (memo[i][j] != -1) { return memo[i][j]; } if (i == 0) { result = j == a[0] ? 1 : 0; } else { if (j + a[i] <= 20) { resu...
a.cc: In function 'int main()': a.cc:29:5: error: 'memset' was not declared in this scope 29 | memset(memo, -1, sizeof(memo)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstrin...
s358031132
p00480
C++
#include <bits/stdc++.h> using namespace std; int N; int num[102]; __int64 a[102][21]; __int64 dp(int d,int sum){ if(sum > 20 || sum < 0) return 0; if(a[d][sum] >= 0) return a[d][sum]; if(d == N-1){ if(sum == num[N]){ return a[d][sum] = 1; }else{ return a[d][sum]...
a.cc:7:1: error: '__int64' does not name a type; did you mean '__int64_t'? 7 | __int64 a[102][21]; | ^~~~~~~ | __int64_t a.cc:9:1: error: '__int64' does not name a type; did you mean '__int64_t'? 9 | __int64 dp(int d,int sum){ | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:30...
s892721218
p00480
C++
#include <bits/stdc++.h> using namespace std; int N; int num[102]; long long int a[102][22]; long long int dp(int d,int sum){ if(sum > 20 || sum < 0) return 0; if(a[d][sum] >= 0) return a[d][sum]; if(d == N-1){ if(sum == num[N]){ return a[d][sum] = 1; }else{ retu...
a.cc: In function 'long long int dp(int, int)': a.cc:25:31: error: expected ';' before '}' token 25 | b += dp(d+1 , sum + n) | ^ | ; 26 | }else{ | ~ a.cc:30:1: warning: control reaches end of no...
s454215768
p00480
C++
??????????????????????????????????????????????????? ?????????????????????????????????????????????????????? ????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????? ?????????????????????????????????????????????][????????????????????????????????????????????? ?...
a.cc:1:1: error: expected unqualified-id before '?' token 1 | ??????????????????????????????????????????????????? | ^
s130049832
p00480
C++
#include<stdio.h> int main(void) { longlong kaz[101][21] = { 0 }; int n,su[101]; int i,j; scanf("%d", &n); for (i = 0;i < n;i++) { scanf("%d", &su[i]); } kaz[0][su[0]]++; for (i = 1;i < n - 1;i++) { for (j = 0;j < 21;j++) { if (kaz[i-1][j] >= 1) { if (j + su[i] < 21) { kaz[i][j + su[i]] += kaz[i...
a.cc: In function 'int main()': a.cc:3:9: error: 'longlong' was not declared in this scope 3 | longlong kaz[101][21] = { 0 }; | ^~~~~~~~ a.cc:10:9: error: 'kaz' was not declared in this scope 10 | kaz[0][su[0]]++; | ^~~
s701213272
p00480
C++
#include<stdio.h> int main(void) { longlong kaz[101][21] = { 0 }; int n,su[101]; int i,j; scanf("%d", &n); for (i = 0;i < n;i++) { scanf("%d", &su[i]); } kaz[0][su[0]]++; for (i = 1;i < n - 1;i++) { for (j = 0;j < 21;j++) { if (kaz[i-1][j] >= 1) { if (j + su[i] < 21) { kaz[i][j + su[i]] += kaz[i...
a.cc: In function 'int main()': a.cc:3:9: error: 'longlong' was not declared in this scope 3 | longlong kaz[101][21] = { 0 }; | ^~~~~~~~ a.cc:10:9: error: 'kaz' was not declared in this scope 10 | kaz[0][su[0]]++; | ^~~
s684522165
p00480
C++
#include <iostream> using namespace std; int main(void) { int a,b,c,d[100]={0},e,f; long long D[100][21]={0}; cin>>a; int Z=0; for (b=0;b<a;b++) { cin>>c; d[b]=c; if (b==0) { D[b][c]=1; } else { for (e=0;e<21;e++) { if (D[b-1][e]>0) { f=e-c; if (f>=0) { D[b][f]+...
a.cc:42:9: error: 'cout' does not name a type 42 | cout<<D[a-2][d[a-1]]<<endl; | ^~~~ a.cc:43:9: error: expected unqualified-id before 'return' 43 | return 0; | ^~~~~~ a.cc:44:1: error: expected declaration before '}' token 44 | } | ^
s326343851
p00480
C++
#include<bits/stdc++.h> using namespace std; long long int dp[200][200],a,su[200]; int main(){ cin>>a; for(int i=0;i<a;i++){cin>>su[i];}??? dp[su[0]][0]=1; for(int i=0;i<a-1;i++){ for(int j=0;j<21;j++){ if(dp[j][i]!=0){ if(j+su[i+1]>20){}else{ dp[j+su[i+1]][i+1]+=dp[j...
a.cc: In function 'int main()': a.cc:6:38: error: expected primary-expression before '?' token 6 | for(int i=0;i<a;i++){cin>>su[i];}??? | ^ a.cc:6:39: error: expected primary-expression before '?' token 6 | for(int i=0;i<a;i++){cin>>su[i];}??? | ...
s344276219
p00480
C++
#include <iostream> using namespace std; int main(){ long long dp[105][21]; int n,begin,ans,k; cin>>n; cin>>begin; memset(dp, 0, sizeof(dp)); dp[0][begin]=1; for(int i=1; i<n-1; i++){ cin>>k; for(int j=0; j<21; j++){ if(j+k<=20) dp[i][j+k]+=dp[i-1][j]; ...
a.cc: In function 'int main()': a.cc:9:5: error: 'memset' was not declared in this scope 9 | memset(dp, 0, sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> ...
s795641860
p00480
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ long long dp[105][21]; int n,begin,ans,k; cin>>n; cin>>begin; memset(dp, 0, sizeof(dp)); dp[0][begin]=1; for(int i=1; i<n-1; i++){ cin>>k; for(int j=0; j<21; j++){ if(j+k<=20) dp[i][j+k]+=d...
a.cc: In function 'int main()': a.cc:10:5: error: 'memset' was not declared in this scope 10 | memset(dp, 0, sizeof(dp)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#include <cstring> ...
s769292552
p00480
C++
#include<iostream> #include<algorithm> long long int dp[100000][30] = {0}; using namespace std; int main(){ int n; scanf("%d",&n); int a[10000]={0}; for(int i = 0;i < n; i++)scanf("%d",&a[i]); memset(dp,0,sizeof(dp)); dp[0][a[0]] = 1; int v = 0; for(int i = 1;i < n-1; i++)...
a.cc: In function 'int main()': a.cc:12:5: error: 'memset' was not declared in this scope 12 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorithm> +++ |+#include <cstring> ...
s447828842
p00480
C++
#include <iostream> #include <vector> unsigned long int count=0; int answer=0; std::vector<int> number; void roop(int ans, int num, int fin){ if((int a=ans+number(num)) <= 20){ if(num+2!=fin) roop(a, num+1, fin); else if(a==answer) ++count; } else if((int b=ans-number(num) >=0)){ if(num+2!=fin) roop(b, num+1,...
a.cc: In function 'void roop(int, int, int)': a.cc:9:13: error: expected primary-expression before 'int' 9 | if((int a=ans+number(num)) <= 20){ | ^~~ a.cc:9:13: error: expected ')' before 'int' 9 | if((int a=ans+number(num)) <= 20){ | ~^~~ | )...
s228200505
p00480
C++
#include <iostream> #include <vector> unsigned long int count=0; int answer=0; std::vector<int> number; void roop(int ans, int num, int fin){ if((int a=ans+number(num)) <= 20){ if(num+2!=fin) roop(a, num+1, fin); else if(a==answer) ++count; } else if((int b=ans-number(num)) >=0){ if(num+2!=fin) roop(b, num+1,...
a.cc: In function 'void roop(int, int, int)': a.cc:9:13: error: expected primary-expression before 'int' 9 | if((int a=ans+number(num)) <= 20){ | ^~~ a.cc:9:13: error: expected ')' before 'int' 9 | if((int a=ans+number(num)) <= 20){ | ~^~~ | )...
s038750590
p00480
C++
#include <iostream> #include <vector> unsigned long int count=0; int answer=0; void roop(int ans, vecter<int> number,int num, int fin){ if((int a=ans+number(num)) <= 20){ if(num+2!=fin) roop(a, number , num+1, fin); else if(a==answer) ++count; } else if((int b=ans-number(num)) >=0){ if(num+2!=fin) roop(b, num...
a.cc:7:20: error: 'vecter' has not been declared 7 | void roop(int ans, vecter<int> number,int num, int fin){ | ^~~~~~ a.cc:7:26: error: expected ',' or '...' before '<' token 7 | void roop(int ans, vecter<int> number,int num, int fin){ | ^ a.cc: In functi...
s291893031
p00480
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include...
a.cc:34:1: error: 'num' does not name a type; did you mean 'enum'? 34 | num[100]; | ^~~ | enum a.cc:36:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 36 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:38:16: error: 'num' was not declared in this scope; did y...