submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s620911293
p02241
C
#include<stdio.h> #define MAX 100; #define INFTY 10000000; #define WHITE 0; #define GRAY 1; #define BLAK 2; int n,M[MAX][MAX]; int prim(){ int u,minv,i,v,sum=0; int d[MAX],p[MAX],color[MAX]; for(i=0;i<n;i++){ d[i]=INFTY; p[i]=-1; color[i]=WHITE; } d[0]=0; while(1){ minv=INFTY; u=-1; ...
main.c:2:16: error: expected ']' before ';' token 2 | #define MAX 100; | ^ main.c:7:9: note: in expansion of macro 'MAX' 7 | int n,M[MAX][MAX]; | ^~~ main.c:7:17: error: expected identifier or '(' before ']' token 7 | int n,M[MAX][MAX]; | ^ main.c: In...
s729985256
p02241
C
#include<stdio.h> #define MAX 100 #define INFTY (1<<21) #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[MAX][MAX]; int prim(){ int sum,i,u,min; int d[MAX],p[MAX],c[MAX]; for(i=0;i<n;i++){ d[i]=INFTY; p[i]=-1; c[i]=WHITE; } d[0]=0; while(1){ min=INFTY; u=-1; for(i=0;i<n;...
main.c: In function 'prim': main.c:40:17: error: 'v' undeclared (first use in this function) 40 | d[v]=M[u][i]; | ^ main.c:40:17: note: each undeclared identifier is reported only once for each function it appears in
s262248627
p02241
C
#include<stdio.h> #define N 100 #define INFTY 20000 #define WHITE 0 #define GRAY 1 #define BLACK 2 int M[N][N]; int n; int prim(){ int color[N],d[N],p[N]; int v,i,mincost,sum,u; for(i=0;i<n;i++){ d[i]=INFTY; p[i]=-1; color[i]=WHITE; } d[0]=0; while(1){ u=-1 mincost=INFTY; for(i=0;i<...
main.c: In function 'prim': main.c:20:9: error: expected ';' before 'mincost' 20 | u=-1 | ^ | ; 21 | mincost=INFTY; | ~~~~~~~
s984206893
p02241
C
#include<stdio.h> void prim(); int main(){ int g[100][100],a[100],f[100]; int n,i,j,k=1,m=0,num,sum=0; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&g[i][j]); } } prim(); return 0; } void prim(){ a[0]=0; f[0]=1; for(i=1;i<n;i++) f[i]=0; while(1){...
main.c: In function 'prim': main.c:20:3: error: 'a' undeclared (first use in this function) 20 | a[0]=0; | ^ main.c:20:3: note: each undeclared identifier is reported only once for each function it appears in main.c:21:3: error: 'f' undeclared (first use in this function) 21 | f[0]=1; | ^ main...
s856648467
p02241
C
#include <stdio.h> int i,n,M[100][100]; int prim(int M){ int u,v,mincost,sum,d[100][100],p[100][100],color[100][100]; for(i=0;i<n;i++){ color[i]=0; d[i]=(1<<21); p[i]=-1; } d[0]=0; while(1){ mincost=(1<<21); for(i=;i<n;i++){ if(color[i]!==0&&d[i]<mincost){ mincost=d[i]; ...
main.c: In function 'prim': main.c:8:13: error: assignment to expression with array type 8 | color[i]=0; | ^ main.c:9:9: error: assignment to expression with array type 9 | d[i]=(1<<21); | ^ main.c:10:10: error: assignment to expression with array type 10 | p[i]=-...
s158864902
p02241
C
#include <stdio.h> int i,n,M[100][100]; int prim(int u){ int u,v,mincost,sum,d[100][100],p[100][100],color[100][100]; for(i=0;i<n;i++){ color[i]=0; d[i]=(1<<21); p[i]=-1; } d[0]=0; while(1){ mincost=(1<<21); for(i=;i<n;i++){ if(color[i]!==0&&d[i]<mincost){ mincost=d[i]; ...
main.c: In function 'prim': main.c:6:7: error: 'u' redeclared as different kind of symbol 6 | int u,v,mincost,sum,d[100][100],p[100][100],color[100][100]; | ^ main.c:5:14: note: previous definition of 'u' with type 'int' 5 | int prim(int u){ | ~~~~^ main.c:8:13: error: assignment to...
s942739570
p02241
C
#include <stdio.h> int u,i,n,M[100][100]; int prim(int u){ int u,v,mincost,sum,d[100][100],p[100][100],color[100][100]; for(i=0;i<n;i++){ color[i]=0; d[i]=(1<<21); p[i]=-1; } d[0]=0; while(1){ mincost=(1<<21); for(i=;i<n;i++){ if(color[i]!==0&&d[i]<mincost){ mincost=d[i];...
main.c: In function 'prim': main.c:6:7: error: 'u' redeclared as different kind of symbol 6 | int u,v,mincost,sum,d[100][100],p[100][100],color[100][100]; | ^ main.c:5:14: note: previous definition of 'u' with type 'int' 5 | int prim(int u){ | ~~~~^ main.c:8:13: error: assignment to...
s581943054
p02241
C
#include <stdio.h> int i,j,n,e,M[100][100]; int prim(int n){ int u,,sum,mincost,d[100].p[100],color[100]; for(i=0;i<n;i++){ d[i]=(1<<21); p[i]=-1; color[i]=0; } d[0]=0; while(1){ mincost=(1<<21); u=-1; for(i=0;i<n;i++){ if(mincost>d[i]&&color[i]!=2){ u=i; ...
main.c: In function 'prim': main.c:6:9: error: expected identifier or '(' before ',' token 6 | int u,,sum,mincost,d[100].p[100],color[100]; | ^ main.c:9:5: error: 'd' undeclared (first use in this function) 9 | d[i]=(1<<21); | ^ main.c:9:5: note: each undeclared identifier is repor...
s604871042
p02241
C
#include <stdio.h> int i,j,n,e,M[100][100]; int prim(int n){ int u,sum,mincost,d[100].p[100],color[100]; for(i=0;i<n;i++){ d[i]=(1<<21); p[i]=-1; color[i]=0; } d[0]=0; while(1){ mincost=(1<<21); u=-1; for(i=0;i<n;i++){ if(mincost>d[i]&&color[i]!=2){ u=i; m...
main.c: In function 'prim': main.c:6:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 6 | int u,sum,mincost,d[100].p[100],color[100]; | ^ main.c:9:5: error: 'd' undeclared (first use in this function) 9 | d[i]=(1<<21); | ^ main.c:9:5: n...
s841002431
p02241
C
#include <stdio.h> int i,j,n,e,M[100][100]; int prim(int n){ int u,sum,mincost,d[100],p[100],color[100]; for(i=0;i<n;i++){ d[i]=(1<<21); p[i]=-1; color[i]=0; } d[0]=0; while(1){ mincost=(1<<21); u=-1; for(i=0;i<n;i++){ if(mincost>d[i]&&color[i]!=2){ u=i; mi...
main.c: In function 'prim': main.c:32:15: error: subscripted value is neither array nor pointer nor vector 32 | p[j][j]=u; | ^ main.c: In function 'main': main.c:54:31: error: expected ':' before ';' token 54 | M[i][j]=(e==-1)? (1<<21); | ^ ...
s317410979
p02241
C
#include <stdio.h> int i,j,n,e,M[100][100]; int prim(int n){ int u,sum,mincost,d[100],p[100],color[100]; for(i=0;i<n;i++){ d[i]=(1<<21); p[i]=-1; color[i]=0; } d[0]=0; while(1){ mincost=(1<<21); u=-1; for(i=0;i<n;i++){ if(mincost>d[i]&&color[i]!=2){ u=i; mi...
main.c: In function 'prim': main.c:32:15: error: subscripted value is neither array nor pointer nor vector 32 | p[j][j]=u; | ^ main.c: In function 'main': main.c:54:31: error: expected ':' before ';' token 54 | M[i][j]=(e==-1)? (1<<21); | ^ ...
s595853765
p02241
C
#include <stdio.h> int i,j,n,e,M[100][100]; int prim(int n){ int u,sum,mincost,d[100],p[100],color[100]; for(i=0;i<n;i++){ d[i]=(1<<21); p[i]=-1; color[i]=0; } d[0]=0; while(1){ mincost=(1<<21); u=-1; for(i=0;i<n;i++){ if(mincost>d[i]&&color[i]!=2){ u=i; mi...
main.c: In function 'main': main.c:54:31: error: expected ':' before ';' token 54 | M[i][j]=(e==-1)? (1<<21); | ^ | : main.c:57:3: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration] ...
s189436041
p02241
C
#include <stdio.h> int i,j,n,e,M[100][100]; int prim(int n){ int u,sum,mincost,d[100],p[100],color[100]; for(i=0;i<n;i++){ d[i]=(1<<21); p[i]=-1; color[i]=0; } d[0]=0; while(1){ mincost=(1<<21); u=-1; for(i=0;i<n;i++){ if(mincost>d[i]&&color[i]!=2){ u=i; mi...
main.c: In function 'main': main.c:54:32: error: expected ':' before ';' token 54 | M[i][j]=(e==-1) ? (1<<21); | ^ | : main.c:57:3: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]...
s042831579
p02241
C
#include <stdio.h> int i,j,n,e,M[100][100]; int prim(int n){ int u,sum,mincost,d[100],p[100],color[100]; for(i=0;i<n;i++){ d[i]=(1<<21); p[i]=-1; color[i]=0; } d[0]=0; while(1){ mincost=(1<<21); u=-1; for(i=0;i<n;i++){ if(mincost>d[i]&&color[i]!=2){ u=i; mi...
main.c: In function 'main': main.c:57:3: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration] 57 | pritf("%d\n",prin(n)); | ^~~~~ | printf main.c:57:16: error: implicit declaration of function 'prin'; did you mean 'prim'? [-Wimplicit-function-dec...
s920730627
p02241
C
#include <stdio.h> int i,j,n,e,M[100][100]; int prim(int n){ int u,sum,mincost,d[100],p[100],color[100]; for(i=0;i<n;i++){ d[i]=(1<<21); p[i]=-1; color[i]=0; } d[0]=0; while(1){ mincost=(1<<21); u=-1; for(i=0;i<n;i++){ if(mincost>d[i]&&color[i]!=2){ u=i; mi...
main.c: In function 'main': main.c:57:3: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration] 57 | pritf("%d\n",prin(e)); | ^~~~~ | printf main.c:57:16: error: implicit declaration of function 'prin'; did you mean 'prim'? [-Wimplicit-function-dec...
s136528514
p02241
C
#include <stdio.h> int i,j,n,e,M[100][100]; int prim(int n){ int u,sum,mincost,d[100],p[100],color[100]; for(i=0;i<n;i++){ d[i]=(1<<21); p[i]=-1; color[i]=0; } d[0]=0; while(1){ mincost=(1<<21); u=-1; for(i=0;i<n;i++){ if(mincost>d[i]&&color[i]!=2){ u=i; mi...
main.c: In function 'main': main.c:57:3: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration] 57 | pritf("%d\n",prim(e)); | ^~~~~ | printf
s404673603
p02241
C
#include <stdio.h> int main() { int n, i, j, min, d, e; int a[1000], b[1000], A[1000][1000]; scanf("%d", &n); for ( i = 0; i < n; i++ ) { a[ i ] = 0; b[ i ] = 1000; for ( j = 0; j < n; j++ ) { scanf("%d", &A[ i ][ j ]); } } b[0] = 0; for ( i = 1; i < n; i++ ) { ...
main.c: In function 'main': main.c:34:7: error: 'wa' undeclared (first use in this function); did you mean 'a'? 34 | wa = wa + b[ i ]; | ^~ | a main.c:34:7: note: each undeclared identifier is reported only once for each function it appears in
s427112699
p02241
C
#include<stdio.h> int main(void) { int n,i,j,k,l; int minv int d[1000],s[1000],P[1000][1000]; int c=0; s[0]=0; scanf("%d",&n); for(i=0;i<n;i++){ d[i]=0; s[i]=1000; for(j=0;j<n;j++){ scanf("%d",&P[i][j]); } } for(i=1;i<n;i++){ minv=1000; for(j=0;j<n;j++){ if(s[j]<minv&&d[j]==0) minv=s[j]; ...
main.c: In function 'main': main.c:5:17: error: expected ';' before 'int' 5 | int minv | ^ | ; 6 | int d[1000],s[1000],P[1000][1000]; | ~~~ main.c:23:1: error: 'minv' undeclared (first use in this function) 23 | minv=1000; ...
s901149765
p02241
C
#include<stdio.h> #define WHITE 0 #define BLACK 2 #define GRAY 1 #define INFTY 1000000000 int a[100][100]; int prim(int n) { int u,i,v,minconst,d[n],p[n],M[n][n],color[n]; d[0]=0; p[0]=-1; while (true){ minconst=INFTY; for(i=0;i<n;i++){ if(color[i] != BLACK && d[i] < minconst){ minconst = d[i]; ...
main.c: In function 'prim': main.c:13:16: error: 'true' undeclared (first use in this function) 13 | while (true){ | ^~~~ main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include<stdio.h> +++ |+#include <std...
s851789196
p02241
C
#include <stdio.h> #define N 10000 int main(){ int a, b; int ans = 0; int A[N][N], x[N], y[N], z[N]; int i, j, n; scanf("%d", &n); for(i=0; i<n-1; i++){ a = 2000; for(j=0; j<n; j++){ if(x[j] == 0 && y[j] < a){ a = y[j]; b = j; } } x[b] = 1; } for(j=0; j<n; j++){ if(A[b][j] != -1...
main.c: In function 'main': main.c:49:9: error: expected declaration or statement at end of input 49 | return 0; | ^~~~~~
s570940881
p02241
C
#include <stdio.h> #define MAX 200000000 #define white 0 #define black 1 int n, c[100][100]; int prim() { int i, d[100], p[100], cl[100], sum, minc, u; for (i = 0; i < n; ++i) { cl[i] = white; d[i] = MAX } d[0] = 0; while(1){ minc = MAX; for (i = 0; i < n; ++i){ if (cl[i]...
main.c: In function 'prim': main.c:13:3: error: expected ';' before '}' token 13 | } | ^
s439310727
p02241
C
#include<stdio.h> #define MAX 100; #define INFTY 10000000 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n, M[MAX][MAX]; int prim(){ int u, minv; int d[MAX], p[MAX], color[MAX]; int i, v, sum = 0; for (i=0; i<n; i++){ d[i] = INFTY; p[i] = -1; color[i] = WHITE; } d[0...
main.c:2:18: error: expected ']' before ';' token 2 | #define MAX 100; | ^ main.c:8:10: note: in expansion of macro 'MAX' 8 | int n, M[MAX][MAX]; | ^~~ main.c:8:18: error: expected identifier or '(' before ']' token 8 | int n, M[MAX][MAX]; | ^ m...
s147258300
p02241
C
#include<stdio.h> #define MAX 100 #define INFTY 10000000 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n, M[MAX][MAX]; int prim(){ int u, minv; int d[MAX], p[MAX], color[MAX]; int i, v, sum = 0; for (i=0; i<n; i++){ d[i] = INFTY; p[i] = -1; color[i] = WHITE; } d[0]...
main.c: In function 'prim': main.c:33:10: error: 'dreak' undeclared (first use in this function) 33 | dreak; | ^~~~~ main.c:33:10: note: each undeclared identifier is reported only once for each function it appears in
s351411426
p02241
C
#include<stdio.h> #define MAX 100 #define INFTY 10000000 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n, M[MAX][MAX]; int prim(){ int u, minv; int d[MAX], p[MAX], color[MAX]; int i, v, sum = 0; for (i=0; i<n; i++){ d[i] = INFTY; p[i] = -1; color[i] = WHITE; } d[0]...
main.c: In function 'prim': main.c:33:10: error: 'dreak' undeclared (first use in this function) 33 | dreak; | ^~~~~ main.c:33:10: note: each undeclared identifier is reported only once for each function it appears in
s725002815
p02241
C
#include<stdio.h> #define N 100 int main(){ int A[N][N]; int B[N]={},C[N]; int i,j,c,n; int m1,m2,min; int sum=0; for(i=0;i<100;i++) C[i]=10000; scanf("%d",&n); for(i=0;i<n;i++) for(j=0;j<n;j++) scanf("%d",&A[i][j]); B[0]=0; m2=1; while(1){ c=0; for(i=0;i<n;i++) if(B[i]==1)c++; if(c==n)break;...
main.c: In function 'main': main.c:30:9: error: expected ';' before 'for' 30 | m1=10000 | ^ | ; 31 | 32 | for(i=0;i<n;i++){ | ~~~ main.c:46:1: error: expected declaration or statement at end of input 46 | } | ^
s744211357
p02241
C
#include<stdio.h> #include<stdlib.h> #include<limits.h> struct node { int id; int weight; struct node *next; }; struct node **list; int *key, *prev, *visit, *heap, *heap_index, heapsize; void Insert(int, int, int); void downheap(int); void upheap(int); void PQ_init(int); void PrimPQ(int, int); int main(void) { ...
main.c: In function 'PrimPQ': main.c:125:5: error: expected declaration or statement at end of input 125 | } | ^ main.c:125:5: error: expected declaration or statement at end of input
s356465344
p02241
C
#include<stdio.h> #include<stdlib.h> #define N 100 #define LARGE 10000 typedef struct edge{ int cost; int u; int v; }edge; /*qsort用*/ int cmp(const void *p,const void *q){ return ((edge*)p)->cost - ((edge*)q)->cost; } int find(int u,int par[]){ if(par[u]==u){ return u; }else { return par[u]=find(par[u],pa...
main.c: In function 'main': main.c:48:17: error: 'MAX' undeclared (first use in this function) 48 | int par[MAX];/*親の配列*/ | ^~~ main.c:48:17: note: each undeclared identifier is reported only once for each function it appears in main.c:50:21: error: 'n' undeclared (first use in this fun...
s541267165
p02241
C
#include <stdio.h> static const int MAX = 100; static const int INFINITY = 1 << 21; static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; static int n; static int M[MAX][MAX]; static int prim() { int d[MAX], p[MAX], color[MAX]; for (int i = 0; i < n; i++) { d[i] = INFIN...
main.c:10:12: error: variably modified 'M' at file scope 10 | static int M[MAX][MAX]; | ^ main.c:10:12: error: variably modified 'M' at file scope
s491423513
p02241
C
include<stdio.h> int main(void){ int n,i,j,x=0,a=10000; int key[101][101]; scanf("%d",&n); for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ scanf("%d",&key[i][j]); } } for(i=2;i<=n;i++){ for(j=1;j<=n;j++){ if(key[i][j]!=-1&&key[i][j]<a)a=key[i][j]; } x=a+x; a=10000; } printf...
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s838249583
p02241
C
include<stdio.h> int main(void){ int n,i,j,x=0,a=5000; int key[101][101]; scanf("%d",&n); for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ scanf("%d",&key[i][j]); } } for(i=2;i<=n;i++){ for(j=1;j<=n;j++){ if(key[i][j]!=-1&&key[i][j]<a)a=key[i][j]; } x=a+x; a=5000; } printf("...
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s184915608
p02241
C
#include<stdio.h> int main(void){ int n,i,j,x=0,a=1001; int key[101][101]; scanf("%d",&n); for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ scanf("%d",&key[i][j]); } } for(i=2;i<=n;i++){ a=1001 for(j=1;j<=n;j++){ if(key[i][j]!=-1&&key[i][j]<a)a=key[i][j]; } x=x+a; } printf("%d\n",x...
main.c: In function 'main': main.c:13:7: error: expected ';' before 'for' 13 | a=1001 | ^ | ; 14 | for(j=1;j<=n;j++){ | ~~~
s485554658
p02241
C++
import heapq n = int(input()) #A = [[int(i) for i in input().split()] for i in range(n)] h = [] DP = {} heapq.heappush(h,(0,0)) c = 0 while(len(DP)<n): tmp = heapq.heappop(h) if tmp[1] in DP: continue c += tmp[0] DP[tmp[1]] = 1 for i,j in enumerate(A[tmp[1]]): if j > 0 and not i in ...
a.cc:4:2: error: invalid preprocessing directive #A 4 | #A = [[int(i) for i in input().split()] for i in range(n)] | ^ a.cc:1:1: error: 'import' does not name a type 1 | import heapq | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'heapq' does not name a ...
s218429122
p02241
C++
// Graph II - Mini#include<iostream> #include<algorithm> #include<vector> #include<functional> using namespace std; #if 0 所用時間: 1h 感想: 思ったより実装すべきコード量が多かった。DisjointSetは今後も使う機会が多そうなので、クラス化してみた。 Pの配列を動的に確保するよう工夫した、良い復習になった。 #endif int N, buff, M = 0, SUM = 0, A[101][101], cost[5000], dpt[5000], dst[5000];//A[Y][X] vec...
a.cc:10:7: error: extended character 。 is not valid in an identifier 10 | 感想: 思ったより実装すべきコード量が多かった。DisjointSetは今後も使う機会が多そうなので、クラス化してみた。 | ^ a.cc:10:7: error: extended character 、 is not valid in an identifier a.cc:10:7: error: extended character 。 is not valid in an identifier a.cc:11:1: error: extended c...
s691283545
p02241
C++
#include<stdio.h> static const int MAX = 500; static const int INFTY = (1<<21); main(){ int n, i, j, e, sum,M[MAX][MAX]={0}; int u,minV,INT_MAX,A[MAX]={INFTY},key[MAX]={INFTY}; /* your code */ scanf("%d", &n); for ( i = 0; i< n; i++ ){ for ( j = 0; j < n; j++ ){ scanf("%d", &e); ...
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:28:7: error: expected primary-expression before 'for' 28 | for(i=1;i<=n;i++){ | ^~~ a.cc:28:23: error: expected ';' before ')' token 28 | ...
s030157105
p02241
C++
#include<stdio.h> static const int MAX = 500; static const int INFTY = (1<<21); main(){ int n, i, j, e, sum,M[MAX][MAX]={0}; int u,minV,INT_MAX,A[MAX]={INFTY},key[MAX]={INFTY}; /* your code */ scanf("%d", &n); for ( i = 0; i< n; i++ ){ for ( j = 0; j < n; j++ ){ scanf("%d", &e); ...
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:26:9: error: expected primary-expression before ')' token 26 | while(){ | ^ a.cc:28:7: error: expected primary-expression before 'for' 28 | ...
s412534600
p02241
C++
#include<stdio.h> static const int MAX = 500; static const int INFTY = (1<<21); main(){ int n, i, j, e, sum,M[MAX][MAX]={0}; int u,minV,INT_MAX,A[MAX]={INFTY},key[MAX]={INFTY}; /* your code */ scanf("%d", &n); for ( i = 0; i< n; i++ ){ for ( j = 0; j < n; j++ ){ scanf("%d", &e); ...
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:28:7: error: expected primary-expression before 'for' 28 | for(i=1;i<=n;i++){ | ^~~ a.cc:28:23: error: expected ';' before ')' token 28 | ...
s493335777
p02241
C++
#include<stdio.h> static const int MAX = 500; static const int INFTY = (1<<21); main(){ int n, i, j, e, sum,M[MAX][MAX]={0}; int u,minV,INT_MAX,A[MAX]={INFTY},key[MAX]={INFTY}; /* your code */ scanf("%d", &n); for ( i = 0; i< n; i++ ){ for ( j = 0; j < n; j++ ){ scanf("%d", &e); ...
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:28:7: error: expected primary-expression before 'for' 28 | for(i=1;i<=n;i++){ | ^~~ a.cc:28:23: error: expected ';' before ')' token 28 | ...
s524880238
p02241
C++
#include<iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1<<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; struct Node{ int color, dist, parent; }; int n, M[MAX][MAX]; Node node[MAX]; void Printnodes(){ string col[3] = {"WHITE", "GRAY ...
a.cc: In function 'int main()': a.cc:68:37: error: 'totaldist' was not declared in this scope 68 | cout << "Total distance is " << totaldist << endl; | ^~~~~~~~~
s811500589
p02241
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; struct edge {int u, v, cost;}; int n; vector<edge> G; bool comp(const edge& e1, const edge& e2) { return e1.cost < e2.cost; } class UnionFind { public: int g_num; vector<int> rank, par; UnionFind() {} UnionFind(int...
a.cc: In function 'int main()': a.cc:82:15: error: 'prim' was not declared in this scope 82 | int ans = prim(); | ^~~~
s873111861
p02241
C++
#include <bits/stdc++.h> #define rep(i,a) for(i=0;i<a;i++) using namespace std; static const int W 0 static const int G 1 static const int B 2 void prim(int n, int *total, vector<vector<int> > &M) { int i,u,min; vector<int> d(n); vector<int> p(n); vector<int> color(n); rep(i,n){ d[i] = INT...
a.cc:4:20: error: expected initializer before numeric constant 4 | static const int W 0 | ^ a.cc: In function 'int main()': a.cc:61:5: error: 'prim' was not declared in this scope 61 | prim(n,&total,M); | ^~~~
s136553862
p02241
C++
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_12_A
a.cc:1:1: error: 'http' does not name a type 1 | http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_12_A | ^~~~
s841504243
p02241
C++
#include <iostream> #include <vector> #include <utility> using namespace std; int P[10001]; void init(int n) { for (int i = 0; i <= n; i++) P[i] = i; } int root(int a) { if (P[a] == a) return a; return (P[a] = root(P[a])); } bool is_same_set(int a, int b) { return root(a) == root(b); } void unite(int a, i...
a.cc: In function 'int main()': a.cc:55:9: error: 'sort' was not declared in this scope; did you mean 'short'? 55 | sort(edges.begin(), edges.end()); | ^~~~ | short
s690587378
p02241
C++
#include<iostream> #include<cstring> #include<algorithm> using namespace std; int x[10000][10000]; int MIN[10000]; int MINX = 0; int MINZ = 10000000; int main() { memset(MIN, 127, sizeof(MIN)); int n, a; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cin >> a; x[i][j] = a; } } f...
a.cc: In function 'int main()': a.cc:31:28: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 31 | MINX += min[j]; | ^
s869636762
p02241
C++
#include<iostream> #include<cstring> #include<algorithm> using namespace std; #define INF 2000000000 int x[10000][10000]; int MIN[10000]; int p[10000]; int prim(){ int v,MINX; int col[10000]; for(int i=0;i<n;i++){ MIN[i]=INF; p[i]=-1; col[i]=0; } MIN[0]=0; while(true){...
a.cc: In function 'int prim()': a.cc:15:19: error: 'n' was not declared in this scope 15 | for(int i=0;i<n;i++){ | ^ a.cc:24:23: error: 'n' was not declared in this scope 24 | for(int i=0;i<n;i++){ | ^ a.cc:25:37: error: ISO C++ forbids comparison be...
s191919656
p02241
C++
n = int(raw_input()) A = [0] i = 0 long = 0 NY = range(1, n) a = [[0 for i in xrange(n)] for j in xrange(n)] while i <=n: a[i] = map(int,raw_input().split()) i = i+1 while NY != []: amin = 2001 for i in A: for j in NY: if 0 <= a[i][j] < amin: amin = a[i][j] ...
a.cc:1:1: error: 'n' does not name a type 1 | n = int(raw_input()) | ^
s072378666
p02241
C++
n = int( raw_input() ) A = [0] p = range(1, n) a = [ [ 0 for i in xrange(n) ] for j in xrange(n) ] for i in xrange(n): a[i] = map( int,raw_input().split() ) l = 0 while p != []: a_min = 2001 for i in A: for j in p: if 0 <= a[i][j] < a_min: a_min = a[i][j] ...
a.cc:1:1: error: 'n' does not name a type 1 | n = int( raw_input() ) | ^
s137865988
p02241
C++
/** * @brief 最小全域木問題(minimum-spanning tree problem)における * Kruskalのアルゴリズム(Kruskal's algorithms)の実装を行う * @date 作成日 : 2016/02/16 * @date 最終更新日 : 2016/02/16 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <iostream> #include <utili...
a.cc:43:25: error: 'int32_t' in namespace 'std' does not name a type 43 | using weight_t = std::int32_t; /**< 辺(u, v)への重みwを表す型 */ | ^~~~~~~ a.cc:44:25: error: 'int32_t' in namespace 'std' does not name a type 44 | using index_t = std::int32_t; /**< 頂点vの添字を表す型 */ | ...
s287486856
p02241
C++
//**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <functional> #include <utility> #include <algorithm> #include <vector> #include <cassert> #include <tuple> #include <iostream> //**************************************** // オブジェクト形式マクロの定義 //****...
a.cc:42:25: error: 'int32_t' in namespace 'std' does not name a type 42 | using weight_t = std::int32_t; /**< 辺(u, v)への重みwを表す型 */ | ^~~~~~~ a.cc:43:25: error: 'int32_t' in namespace 'std' does not name a type 43 | using index_t = std::int32_t; /**< 頂点vの添字を表す型 */ | ...
s550976385
p02241
C++
//**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <functional> #include <utility> #include <algorithm> #include <vector> #include <cassert> #include <tuple> #include <queue> #include <iostream> //**************************************** // オブジェ...
a.cc:43:25: error: 'int32_t' in namespace 'std' does not name a type 43 | using weight_t = std::int32_t; /**< 辺(u, v)への重みwを表す型 */ | ^~~~~~~ a.cc:44:25: error: 'int32_t' in namespace 'std' does not name a type 44 | using index_t = std::int32_t; /**< 頂点vの添字を表す型 */ | ...
s337771307
p02241
C++
/** * @brief Primのアルゴリズムのテストを行います * @note * @date 2016/04/17 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <utility> #include <algorithm> #include <vector> #include <tuple> #include <iostream> //**************************************** ...
a.cc:41:25: error: 'int32_t' in namespace 'std' does not name a type 41 | using weight_t = std::int32_t; /**< 辺(u, v)への重みwを表す型 */ | ^~~~~~~ a.cc:42:25: error: 'int32_t' in namespace 'std' does not name a type 42 | using index_t = std::int32_t; /**< 頂点vの添字を表す型 */ | ...
s918186479
p02241
C++
#include <iostream> using namespace std; const int MAX = 100; const int INFTY = 2000000; const int WHITE = 0; const int GRAY = 1; const int BLACK = 2; int n,M[MAX][MAX]; int prim (){ int u,minv; int d[MAX],p[MAX],color[MAX]; for (int i = 0; i < n ; ++i) { d[i] = INFTY; p[i] = -1; ...
a.cc: In function 'int prim()': a.cc:47:13: error: 'P' was not declared in this scope 47 | if( P[i] != -1) sum += M[i][p[i]]; | ^
s223573013
p02241
C++
#include <iostream> #include <set> #include <vector> #define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i)) #define REP(i,n) FOR(i,0,n) #define pb push_back #define mp make_pair #define fst first #define snd second #define all(v) begin(v), end(v) using namespace std; typedef pair<int,int> PII; int P[100]; //union_find ...
a.cc: In function 'int main()': a.cc:40:5: error: 'sort' was not declared in this scope; did you mean 'short'? 40 | sort(all(V)); | ^~~~ | short
s576336397
p02241
C++
#include <iostream> #include <set> #include <vector> #define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i)) #define REP(i,n) FOR(i,0,n) #define pb push_back #define mp make_pair #define fst first #define snd second #define all(v) begin(v), end(v) using namespace std; typedef pair<int,int> PII; int P[100]; //union_find ...
a.cc: In function 'int main()': a.cc:40:5: error: 'sort' was not declared in this scope; did you mean 'short'? 40 | sort(all(V)); | ^~~~ | short
s309721520
p02241
C++
#include <cstdio> #include <map> #include <algorithm> #define rep(i, n) for(int i = 0; i < (n); ++i) using namespace std; int n; int g[100][100]; vector<pair<int, int> > computeSpanningTree(std::vector<pair<int, pair<int, int> > >& edges){ class UnionFind{ public: UnionFind(int n){ for(int i = 0; i < ...
a.cc:12:1: error: 'vector' does not name a type 12 | vector<pair<int, int> > computeSpanningTree(std::vector<pair<int, pair<int, int> > >& edges){ | ^~~~~~ a.cc: In function 'int main()': a.cc:96:14: error: 'vector' is not a member of 'std' 96 | std::vector<pair<int, pair<int, int> > > gr; | ...
s039174259
p02241
C++
import java.util.Scanner; class Main { static int[][]M = new int[100][100]; static int prim(int n) { int u, minv; int sum = 0; int[]d = new int[100]; int[]f = new int[100]; int[]cl = new int[100]; for(int i = 0; i < n; i++) { d[i] = 200000; f[i] = -1; cl[i] = 0; } d[0] = 0; whil...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:15: error: expected unqualified-id before '[' token 5 | static int[][]M = new int[100][100]; | ^ a.cc:62:11: error: expecte...
s672165502
p02241
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s808636581
p02241
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; int a[100][100],b[100]={},c[100]={}; cin>>n; for(int i=0;i<n;i++) for(int j=0;j<n;j++)cin>>a[i][j]; c[0]=1; while(1){ int k=0.min=10000,min1=0; if(k==n)break; for(int i=0;i<n;i++) for(int j=0;j<n;j++) if(a[b[i]][j]<min &&...
a.cc: In function 'int main()': a.cc:13:16: error: no match for 'operator=' (operand types are 'std::chrono::duration<long double, std::ratio<60> >' and 'int') 13 | int k=0.min=10000,min1=0; | ^~~~~ In file included from /usr/include/c++/14/chrono:41, from /usr/include/x86_64...
s975376214
p02241
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; int a[100][100],b[100]={},c[100]={}; cin>>n; for(int i=0;i<n;i++) for(int j=0;j<n;j++)cin>>a[i][j]; c[0]=1; int k=0.min=10000,min1=0,ans=0; while(1){ if(k==n)break; for(int i=0;i<n;i++) for(int j=0;j<n;j++) if(a[b[i]][j]<m...
a.cc: In function 'int main()': a.cc:12:15: error: no match for 'operator=' (operand types are 'std::chrono::duration<long double, std::ratio<60> >' and 'int') 12 | int k=0.min=10000,min1=0,ans=0; | ^~~~~ In file included from /usr/include/c++/14/chrono:41, from /usr/include/x8...
s464899601
p02241
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; int a[100][100],b[100]={},c[100]={}; c[0]=1; cin>>n; for(int i=0;i<n;i++) for(int j=0;j<n;j++)cin>>a[i][j]; int k=1,min=10000,min1=0,ans=0; while(1){ for(int i=0;i<k;i++) for(int j=0;j<n;j++) if(a[b[i]][j]<min && a[b[i]][j]!=...
a.cc: In function 'int main()': a.cc:22:13: error: expected ';' before 'ans' 22 | c[min1]=1 | ^ | ; 23 | ans+=min; | ~~~
s115870127
p02241
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,a[100][100],b[100]={},c[100]={}; c[0]=1; cin>>n; for(int i=0;i<n;i++) for(int j=0;j<n;j++)cin>>a[i][j]; int k=1,min1,ans=0; while(1){ int min=10000; for(int i=0;i<k;i++) for(int j=0;j<n;j++) if(a[b[i]][j]<min && a[b[i]][j]!=-...
a.cc: In function 'int main()': a.cc:22:13: error: expected ';' before 'ans' 22 | c[min1]=1 | ^ | ; 23 | ans+=min; | ~~~
s409540303
p02241
C++
#include<iostream> #include<vector> #include<string> #include<array> #include<algorithm> #include<list> #include<cmath> #include<iomanip> #include<queue> #include<functional> #include<climits> #include<iterator> using namespace std; #include"GraphAlgorithm.hpp" using namespace graph_algorithm; const double pi=4*atan(...
a.cc:15:9: fatal error: GraphAlgorithm.hpp: No such file or directory 15 | #include"GraphAlgorithm.hpp" | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.
s360498732
p02241
C++
#include<iostream> #include<vector> #include<string> #include<array> #include<algorithm> #include<list> #include<cmath> #include<iomanip> #include<queue> #include<functional> #include<climits> #include<iterator> using namespace std; #include"GraphAlgorithm.hpp" using namespace graph_algorithm; const double pi=4*atan(...
a.cc:15:9: fatal error: GraphAlgorithm.hpp: No such file or directory 15 | #include"GraphAlgorithm.hpp" | ^~~~~~~~~~~~~~~~~~~~ compilation terminated.
s908678177
p02241
C++
#include<iostream> #include<utility> #include<algorithm> using namespace std; int matrix[100][100]; pair<int,int> edges[100]; int cost[100]; int src[100]; int dst[100]; int p[10010]; void init(int n) { for(int i=0;i<=n;i++) p[i]=i; }; int root(int a) { if(p[a]==a) return a; return (p[a]=root...
a.cc: In function 'int main()': a.cc:68:43: error: expression cannot be used as a function 68 | if(is_same_set(src[edges[i].second()],dst[edges[i].second()])) | ~~~~~~~~~~~~~~~^~ a.cc:68:66: error: expression cannot be used as a function 68 | if(is_same_set(src[edg...
s364779616
p02241
C++
#include<iostream> #include<utility> #include<algorithm> using namespace std; int matrix[100][100]; pair<int,int> edges[100]; int cost[100]; int src[100]; int dst[100]; int p[10010]; void init(int n) { for(int i=0;i<=n;i++) p[i]=i; }; int root(int a) { if(p[a]==a) return a; return (p[a]=root...
a.cc: In function 'int main()': a.cc:68:43: error: expression cannot be used as a function 68 | if(is_same_set(src[edges[i].second()],dst[edges[i].second()])) | ~~~~~~~~~~~~~~~^~ a.cc:68:66: error: expression cannot be used as a function 68 | if(is_same_set(src[edg...
s256463989
p02241
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; struct edge{ int u; //????????? int v; //??°?????? int cost; //?????? //???????????????????????§?????§?°???¢???????????? bool operator<(const edge& another) const { return cost < another.cost; } }; const int MAX_N = 100; const int ...
a.cc: In function 'void initial(int)': a.cc:27:17: error: reference to 'rank' is ambiguous 27 | rank[i] = 0; | ^~~~ 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++...
s644966138
p02241
C++
#include <iostream> #include <string> #include <vector> #include <stdio.h> #include <math.h> #include <map> #include <algorithm> using namespace std; #define FAR INT_MAX #define N 100 static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, color[N], d[N], p[N]; int m[N][N]; int p...
a.cc: In function 'int prim()': a.cc:11:13: error: 'INT_MAX' was not declared in this scope 11 | #define FAR INT_MAX | ^~~~~~~ a.cc:25:24: note: in expansion of macro 'FAR' 25 | d[i] = FAR; | ^~~ a.cc:8:1: note: 'INT_MAX' is defined in header '<climit...
s732637998
p02241
C++
#include<cstdio> #include<iostream> #include<stack> #include<vector> #include<algorithm> #include<cstring> #include<cstdlib> #define _USE_MATH_DEFINES // M_PI???????????????????????? #include<math.h> #include<queue> #pragma warning(disable:4996) using namespace std; static const int MAX = 100; static const int INFTY =...
a.cc: In function 'int prim()': a.cc:47:49: error: expected ';' before 'GRAY' 47 | color[v] GRAY; | ^~~~~ | ;
s735842102
p02241
C++
#include "taichitary.h" #define V_MAX 100 #define INFTY 5000 #define WHITE 0 #define GRAY 1 #define BLACK 2 int M[V_MAX][V_MAX]; int d[V_MAX], p[V_MAX]; int n; int color[V_MAX]; int Prim(int u){ p[u] = -1; //p??????????????????????¨???? for(int i=0; i<n; i++){ d[i] = INFTY; p[i] = -1; ...
a.cc:1:10: fatal error: taichitary.h: No such file or directory 1 | #include "taichitary.h" | ^~~~~~~~~~~~~~ compilation terminated.
s459326691
p02241
C++
#include<iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1 << 21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; int prim() { int u, minv; int d[MAX], p[MAX], color[MAX]; for(int i = 0; i < n; i++) { d[i] = INFTY; p...
a.cc: In function 'int prim()': a.cc:48:1: warning: no return statement in function returning non-void [-Wreturn-type] 48 | } | ^ a.cc: In function 'int main()': a.cc:57:30: error: 'j' was not declared in this scope 57 | M[i][j] = (e == -1) ? INFTY :e; | ...
s294247324
p02241
C++
#include<iostream> #include<vector> #include<algorithm> #define PII pair<int,int> #define MPII(a,b) make_pair(a,b) using namespace std; class NODE { public: vector<PII> v; int index = 0; }; class Tree { public: vector<int> V; int cost = 0; }; int main() { NODE* nodes; nodes = new NODE[101]; Tree T; int n; cin...
a.cc: In function 'int main()': a.cc:45:29: error: 'INT_MAX' was not declared in this scope 45 | int mincost=INT_MAX; | ^~~~~~~ a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 3 | #include<algori...
s436821848
p02241
C++
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES //#include "MyMath.h" //#include "MyDisjointset.h" #include <iostream> #include <vector> #include <algorithm> #include <queue> #include <functional> #include <stdio.h> using namespace std; typedef pair<int, int> P; const int INF = 2000000000; int main() { int n...
a.cc: In function 'int main()': a.cc:45:18: error: expected '}' at end of input 45 | return 0; | ^ a.cc:14:12: note: to match this '{' 14 | int main() { | ^
s536050853
p02241
C++
#include<iostream> using namespace std; const int MAX = 100; int main() { int n; int graph[MAX][MAX]; bool table[MAX] = { false }; int sum = 0; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { int temp; cin >> temp; if (temp == -1)temp = INT_MAX; graph[i][j] = temp; } } ...
a.cc: In function 'int main()': a.cc:18:47: error: 'INT_MAX' was not declared in this scope 18 | if (temp == -1)temp = INT_MAX; | ^~~~~~~ a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#includ...
s689624275
p02241
C++
#include <bits/stdc++.h> using namespace std; struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; #define P(x) cout << (x) << '\n' #define p(x) cout << (x) #define all(c) (c).begin(), (c).end() #define rall(c) (c).rbegin(), (c).rend() #define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i)...
a.cc: In function 'int prim()': a.cc:6:20: error: request for member 'begin' in 'd', which is of non-class type 'int [n]' 6 | #define all(c) (c).begin(), (c).end() | ^~~~~ a.cc:49:23: note: in expansion of macro 'all' 49 | return accumulate(all(d), 0); | ^...
s873149597
p02241
C++
#include <stdio.h> #define INFTY 1000000 #define M -1 #define WHITE 0 #define GRAY 1 #define BLACK 2 #define N 100 int prim(void); int n,A[N][N]; int main() { int i,j,k; scanf("%d",&n); for(i=0;i<n;i++) { for(j=0;j<n;j++) { scanf("%d",&k); if(k==M) A[i][j]=INFTY; }...
a.cc: In function 'int prim()': a.cc:72:14: error: expected '}' at end of input 72 | return sum; | ^ a.cc:30:1: note: to match this '{' 30 | { | ^
s913016139
p02241
C++
#include <stdio.h> #define INFTY 1000000 #define M -1 #define WHITE 0 #define GRAY 1 #define BLACK 2 #define N 100 int prim(void); int n,A[N][N]; int main() { int i,j,k; scanf("%d",&n); for(i=0;i<n;i++) { for(j=0;j<n;j++) { scanf("%d",&k); if(k==M) A[i][j]=INFTY; }...
a.cc: In function 'int prim()': a.cc:72:14: error: expected '}' at end of input 72 | return sum; | ^ a.cc:30:1: note: to match this '{' 30 | { | ^
s906545578
p02241
C++
#include <iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1 << 21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; int prim() { int u, minv; int d[MAX], p[MAX], color[MAX]; for (int i = 0; i < n; i++) { d[i] = INFTY; ...
a.cc: In function 'int prim()': a.cc:24:21: error: 'i' was not declared in this scope 24 | u = i; | ^ a.cc:49:24: error: 'sum' was not declared in this scope 49 | return sum; | ^~~
s463908767
p02241
C++
#include <iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1 << 21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; int prim() { int u, minv; int d[MAX], p[MAX], color[MAX]; for (int i = 0; i < n; i++) { d[i] = INFTY; ...
a.cc: In function 'int prim()': a.cc:25:26: error: 'i' was not declared in this scope 25 | minv = d[i]; | ^ a.cc:49:24: error: 'sum' was not declared in this scope 49 | return sum; | ^~~
s575437924
p02241
C++
#include <iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1 << 21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; int prim() { int u, minv; int d[MAX], p[MAX], color[MAX]; for (int i = 0; i < n; i++) { d[i] = INFTY; ...
a.cc: In function 'int prim()': a.cc:48:24: error: 'sum' was not declared in this scope 48 | return sum; | ^~~
s986131772
p02241
C++
#include <stdio.h> #define MAX 101 #define INF 100000 int main(){ int i,j,n,min,k=1,minNode,sum=0; int a[MAX][MAX],x{[MAX],g[MAX]; scanf("%d",&n); for(i=0 ; i<n ; i++){ for(j=0 ; j<n ; j++){ scanf("%d",&a[i][j]); } } x[0] = 0; g[0] = 1; for(i=1 ; i<n ; i++){ g[i] = 0; } whi...
a.cc: In function 'int main()': a.cc:3:13: error: expected identifier before numeric constant 3 | #define MAX 101 | ^~~ a.cc:8:22: note: in expansion of macro 'MAX' 8 | int a[MAX][MAX],x{[MAX],g[MAX]; | ^~~ a.cc: In lambda function: a.cc:8:26: error: expected '{' b...
s185769749
p02241
C++
#include<iostream> using namespace std; static const int MAX=100; static const int INFTY=(1<<21); static const int WHITE=0; static const int GRAY=1; static const int BLACK=2; int n,M[MAX][MAX]; int prim(){ int u,min; int d[MAX],p[MAX],color[MAX]; for(int i=0;i<n;i++){ d[i]=INFTY; p[i]=-1; color[i]=WHITE; } d[0]=0; ...
a.cc: In function 'int prim()': a.cc:35:36: error: expected primary-expression before ')' token 35 | if(color[v]!=BLACK&&M[u][v]!=INFTY;){ | ^
s377935375
p02241
C++
import array import collections import heapq INF = 1e9 N = int(input()) AdjacentVertex = collections.namedtuple('AdjacentVertex', 'vertex cost') adjacency_list = collections.defaultdict(set) NO_VERTEX = -1 def compute_mst_prim(max_v, adj_list): pred = collections.defaultdict(lambda: NO_VERTEX) key = colle...
a.cc:9:41: warning: multi-character literal with 14 characters exceeds 'int' size of 4 bytes 9 | AdjacentVertex = collections.namedtuple('AdjacentVertex', 'vertex cost') | ^~~~~~~~~~~~~~~~ a.cc:9:59: warning: multi-character literal with 11 characters exceeds 'int' size...
s974112346
p02241
C++
#include <iostream> #include <algorithm> #include <queue> using namespace std; static const int MAX = 10000; static const int INFTY = (1<<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n; vector<pair<int,int> > adj[MAX][MAX]; void dijkstra(){ priority_queue<pair<int,i...
a.cc: In function 'void dijkstra()': a.cc:35:31: error: request for member 'size' in 'adj[u]', which is of non-class type 'std::vector<std::pair<int, int> > [10000]' 35 | for(int j=0; j<adj[u].size(); j++){ | ^~~~ a.cc:36:31: error: 'class std::vector<std::pair<int, int> >...
s420612533
p02241
C++
#include <iostream> #include <utility> #include <string> using namespace std; int P[10010]; // 0 ?????? 10000 ?????§????????????????????±????????? void init(int N) { // ????????? ??????????????¨??????????????????????????? for (int i=0; i<=N; ++i) P[i] = i; // ??¨: ????????? [0,N-1] ????????? [1,N] ??????????????...
a.cc: In function 'int main()': a.cc:70:3: error: 'sort' was not declared in this scope; did you mean 'short'? 70 | sort(c_n, c_n+k); | ^~~~ | short
s047295197
p02241
C++
#include<iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1<<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; int prim() { int a, min; int d[MAX], p[MAX], color[MAX]; for ( int i = 0; i < n; i++) { d[i] = ...
a.cc: In function 'int prim()': a.cc:26:7: error: 'u' was not declared in this scope 26 | u = -1; | ^
s233435126
p02241
C++
#include<iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1<<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; int prim() { int a, min; int d[MAX], p[MAX], color[MAX]; for ( int i = 0; i < n; i++) { ...
a.cc: In function 'int prim()': a.cc:41:23: error: 'u' was not declared in this scope 41 | p[v] = u; | ^
s082432484
p02241
C++
#include<iostream> using namespace std; int n, M[100][100], W = 0, G = 1, B = 2; int prim () { int u, minv, i, v, d[100], p[100], color[100], sum; for (i = 0; i < n; i++) { d[i] = (1 << 21); p[i] = -1; color[i] = W; } d[0] = 0; while (1) { minv = (1 << 21); ...
a.cc: In function 'int prim()': a.cc:55:10: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 55 | int main () { | ^~ a.cc:55:10: note: remove parentheses to default-initialize a variable 55 | int main () { | ^~ | -- a.cc:55:10: n...
s931038149
p02241
C++
#include "stdafx.h" #include <iostream> using namespace std; int main(void) { int n, now = 0, flag[101] = {}; long ans = 0, an[100][100], min[100]; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) cin >> an[i][j]; min[i] = 1000000000; } do { long key = LONG_MAX, key_i; flag[now] ...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s492045904
p02241
C++
#include <iostream> using namespace std; int main(void) { int n, now = 0, flag[101] = {}; long ans = 0, an[100][100], min[100]; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) cin >> an[i][j]; min[i] = 1000000000; } do { long key = LONG_MAX, key_i; flag[now] = 1; flag[100] = ...
a.cc: In function 'int main()': a.cc:19:28: error: 'LONG_MAX' was not declared in this scope 19 | long key = LONG_MAX, key_i; | ^~~~~~~~ a.cc:3:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #inclu...
s405406556
p02241
C++
#include "stdafx.h" #include <iostream> #define MAX 100000000; using namespace std; int main(void) { int n, now = 0, flag[101] = {}; long ans = 0, an[100][100], min[100]; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) cin >> an[i][j]; min[i] = MAX; } do { long key = , key_i; f...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s092209515
p02241
C++
#include <iostream> #define MAX 1000000000; using namespace std; int main(void) { int n, now = 0, flag[101] = {}; long ans = 0, an[100][100], min[100]; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) cin >> an[i][j]; min[i] = MAX; } do { long key = MAX, key_i; flag[now] = 1; f...
a.cc: In function 'int main()': a.cc:19:31: error: expected primary-expression before ',' token 19 | long key = MAX, key_i; | ^ a.cc:19:33: error: 'key_i' was not declared in this scope; did you mean 'key_t'? 19 | long key = MAX, key_i; | ...
s772245296
p02241
C++
#include<iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1<<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, G[MAX][MAX]; int prim() { int u, minv; int d[MAX], p[MAX], color[MAX]; for ( int i = 0; i < n; i++ ) { d[i] = INFTY...
a.cc: In function 'int prim()': a.cc:35:33: error: 'M' was not declared in this scope 35 | if ( color[v] != BLACK && M[u][v] != INFTY ) { | ^ a.cc:46:30: error: 'M' was not declared in this scope 46 | if ( p[i] != -1 ) sum += M[i][p[i]]; | ...
s568126042
p02241
C++
#include<iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1 <<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; int prim() { int prim() { int u,minv; int d[MAX], p[MAX],color[MAX]; for(int i = 0; i < n; i++){ ...
a.cc: In function 'int prim()': a.cc:12:11: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 12 | int prim() { | ^~ a.cc:12:11: note: remove parentheses to default-initialize a variable 12 | int prim() { | ^~ | -- a.cc:12:...
s209381081
p02241
C++
#include<iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1 <<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; int prim() { int u,minv; int d[MAX], p[MAX],color[MAX]; for(int i = 0; i < n; i++){ d[i] = INFTY; ...
a.cc: In function 'int prim()': a.cc:25:8: error: 'i' was not declared in this scope 25 | u = i; | ^ a.cc: At global scope: a.cc:29:2: error: expected unqualified-id before 'if' 29 | if( u == -1) break; | ^~ a.cc:30:2: error: 'color' does not name a type 30 | color[u] = BLACK; | ...
s355811270
p02241
C++
#include<iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1 <<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; int prim() { int u,minv; int d[MAX], p[MAX],color[MAX]; for(int i = 0; i < n; i++){ d[i] = INFTY; ...
a.cc: In function 'int main()': a.cc:58:33: error: expected ':' before ';' token 58 | M[i][j] = (e == -1) ? INFTY ; e; | ^~ | : a.cc:58:34: error: expected primary-expression before ';' token 58 | M[i][j] = (e == -1) ? INFTY ; e...
s343274320
p02241
C++
#include<iostream> using namespace std; static const int MAX = 100; static const int INFTY = (1 <<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; int prim() { int u,minv; int d[MAX], p[MAX],color[MAX]; for(int i = 0; i < n; i++){ d[i] = INFTY; ...
a.cc: In function 'int main()': a.cc:58:33: error: expected ':' before ';' token 58 | M[i][j] = (e == -1) ? INFTY ; e; | ^~ | : a.cc:58:34: error: expected primary-expression before ';' token 58 | M[i][j] = (e == -1) ? INFTY ; e...
s244499997
p02241
C++
#include <iostream> #include <vector> #include <numeric> using namespace std; const int N = 100; /* // ???????????? Vnew = {x}???????????§ x ??? V ????????§?????????????????????????????????????????? Enew = {} while (Vnew ??? V) Vnew ????????????????????? u ??¨ ????????????????????? v ????????¶?????????????°?????...
a.cc: In function 'int main()': a.cc:34:37: error: 'numeric_limits' was not declared in this scope 34 | A[i][j] = a == -1 ? a : numeric_limits<int>::max(); | ^~~~~~~~~~~~~~ a.cc:34:52: error: expected primary-expression before 'int' 34 | A[i][j] = ...
s530769805
p02241
C++
#include <iostream> #include <vector> #include <numeric> using namespace std; const int N = 100; /* // ???????????? Vnew = {x}???????????§ x ??? V ????????§?????????????????????????????????????????? Enew = {} while (Vnew ??? V) Vnew ????????????????????? u ??¨ ????????????????????? v ????????¶?????????????°?????...
a.cc: In function 'int main()': a.cc:34:37: error: 'numeric_limits' was not declared in this scope 34 | A[i][j] = a == -1 ? a : numeric_limits<int>::max(); | ^~~~~~~~~~~~~~ a.cc:34:52: error: expected primary-expression before 'int' 34 | A[i][j] = ...
s779459287
p02241
C++
#include <iostream> #include <vector> #include <numeric> using namespace std; const int N = 100; enum { WHITE, GRAY, BLACK, }; int main() { int A[N][N]; int n; cin >> n; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { int a; cin >> a; ...
a.cc: In function 'int main()': a.cc:26:37: error: 'numeric_limits' was not declared in this scope 26 | A[i][j] = a == -1 ? a : numeric_limits<int>::max(); | ^~~~~~~~~~~~~~ a.cc:26:52: error: expected primary-expression before 'int' 26 | A[i][j] = ...
s725548556
p02241
C++
#include<bits/stdc++.h> #include"UnionFind.hpp" using namespace std; class UnionFind{ int N; vector<int> par; vector<int> rank; public: UnionFind(int N):N(N),par(N),rank(N,0){iota(par.begin(),par.end(),0);} int find(int x); void unite(int x,int y); bool same(int x,int y){return find(x)=...
a.cc:2:9: fatal error: UnionFind.hpp: No such file or directory 2 | #include"UnionFind.hpp" | ^~~~~~~~~~~~~~~ compilation terminated.
s272982431
p02241
C++
#include<bits/stdc++.h> //#include"UnionFind.hpp" using namespace std; using Weight=long long; struct Edge{ int from,to; Weight weight; }; bool operator<(const Edge& lhs,const Edge& rhs){ return lhs.weight<rhs.weight; } using Edges=vector<Edge>; using Graph=vector<Edges>; Edges MinimumSpanningTree(int n...
a.cc: In function 'Edges MinimumSpanningTree(int, Edges)': a.cc:20:5: error: 'UnionFind' was not declared in this scope 20 | UnionFind u(n); | ^~~~~~~~~ a.cc:22:13: error: 'u' was not declared in this scope 22 | if(!u.same(edges[i].from,edges[i].to)){ | ^