submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s956820022
p02239
C
#include <iostream> #include <queue> using namespace std; static const int N=100; static const int INFTY=(1<<21); int n,M[N][N]; int d[N];//通?距?管理??状?(color) void bfs(int s){ queue<int> q;//使用?准?中的queue q.push(s); for(int i=0;i<n;i++)d[i]=INFTY; d[s]=0; int u; while(!q.empty()){ u=q.fron...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s435018212
p02239
C
#include <stdio.h> int i,n,v,M[101][101]; void bfs(int s) { queue<int> q; q.push(s); int u,d[101]; for(i=0;i<n;i++){ color[i]=0; d[i]=(1<<21); } color[s]=1; d[s]=0; while(!q.empty()){ u=q.front(); q.pop(); for(v=;v<n;v++){ if(M[u][v]>0&&color[v]==0){ color[v]=1; ...
main.c: In function 'bfs': main.c:7:3: error: 'queue' undeclared (first use in this function) 7 | queue<int> q; | ^~~~~ main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in main.c:7:9: error: expected expression before 'int' 7 | queue<int> q; | ...
s156211138
p02239
C
#include <stdio.h> int i,n,v,M[101][101]; void bfs(int s) { queue<int> q; q.push(s); int u,d[101]; for(i=0;i<n;i++){ color[i]=0; d[i]=(1<<21); } color[s]=1; d[s]=0; while(!q.empty()){ u=q.front(); q.pop(); for(v=0;v<n;v++){ if(M[u][v]>0&&color[v]==0){ color[v]=1; ...
main.c: In function 'bfs': main.c:7:3: error: 'queue' undeclared (first use in this function) 7 | queue<int> q; | ^~~~~ main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in main.c:7:9: error: expected expression before 'int' 7 | queue<int> q; | ...
s125395434
p02239
C
#include <stdio.h> int i,n,v,M[101][101]; void bfs(int s) { queue<int> q; q.push(s); int u,d[101,color[101]; for(i=0;i<n;i++){ color[i]=0; d[i]=(1<<21); } color[s]=1; d[s]=0; while(!q.empty()){ u=q.front(); q.pop(); for(v=0;v<n;v++){ if(M[u][v]>0&&color[v]==0){ col...
main.c: In function 'bfs': main.c:7:3: error: 'queue' undeclared (first use in this function) 7 | queue<int> q; | ^~~~~ main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in main.c:7:9: error: expected expression before 'int' 7 | queue<int> q; | ...
s087933361
p02239
C
#include<stdio.h> #define MAX 102 #define WHITE 0 #define BLACK 1 #define GRAY 2 #define NIL -1 void init(); int n, head = 0, tail = 0, color[MAX]; int d[MAX], edge[MAX], G[MAX][MAX]; void init(){ int i; for(i = 0; i <= n; i++){ color[i] = WHITE; d[i] = 10000000; } } /*void Enqueue(int x...
main.c:127:3: error: expected identifier or '(' before 'return' 127 | return 0; | ^~~~~~ main.c:130:1: error: expected identifier or '(' before '}' token 130 | } | ^
s512749537
p02239
C
include <stdio.h> #define N 100 int queue[N] = {0}; int b = 0, e = 0; void enq( int v ) { queue[b++] = v; } int deq() { return queue[e++]; } int is_empty() { return b == e; } int step[N] = {0}; void clear() { int i; for( i=0; i<N; ++i ) { queue[i] = 0; step[i] = -1; } b =...
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^ main.c: In function 'enq': main.c:8:5: error: 'queue' undeclared (first use in this function) 8 | queue[b++] = v; | ^~~~~ main.c:8:5: note: each undeclared identifier is rep...
s228181361
p02239
C
#include<stdio.h> int main(){ int n; scanf("%d", &n); int g[102][102],d[102]; int i,j; for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ g[i][j] = 0; } d[i]=-1; } int u,k; for(i=0;i<n;i++){ scanf("%d %d", &u,&k); for(j=0;j<k;j++){ int v; scanf("%d", &v); g[u][v] = 1...
main.c: In function 'main': main.c:43:13: error: 't' undeclared (first use in this function) 43 | Q[t++]=i; | ^ main.c:43:13: note: each undeclared identifier is reported only once for each function it appears in
s287024693
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N=100; static const int INFTY=(1<<21); int n,m[N][N]; int d[n]; void bfs(int s){ queue<int> q; q.push(s); for(int i=0;i<n;i++) d[i]=INFTY; d[s]=0; int u; while(!q.empty()){ u=q.front(); q.pop(); for(int v=0;v<n;v++){ ...
a.cc:9:7: error: size of array 'd' is not an integral constant-expression 9 | int d[n]; | ^
s916569509
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N=100; static const int INFTY=(1<<21); int n,m[N][N]; int d[n]; void bfs(int s){ queue<int> q; q.push(s); for(int i=0;i<n;i++) d[i]=INFTY; d[s]=0; int u; while(!q.empty()){ u=q.front(); q.pop(); for(int v=0;v<n;v++){ ...
a.cc:9:7: error: size of array 'd' is not an integral constant-expression 9 | int d[n]; | ^
s717834917
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n,M[N][N]; int d[N]; void bfs(int s){ queue<int> q; q.push(s); for(int i = 0; i < n; i++) d[i] = INFTY; d[s] = 0; int u; while(!q.empty()){ u = q.front(); q.pop(); for(int v...
a.cc: In function 'void bfs(int)': a.cc:28:18: error: expected primary-expression before '<<' token 28 | cout << i+1; << " " << ( (d[i] == INFTY) ? (-1) : d[i] ) << endl; | ^~
s675092569
p02239
C++
#include<iosrteam> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void bfs(int s) { queue<int> q; q.push(s); for ( int i = 0; i < n; i++ ) d[i] = INFTY; d[s] = 0; int u; while ( !q.empty() ) { u = q.front(); q.pop(); for ...
a.cc:1:9: fatal error: iosrteam: No such file or directory 1 | #include<iosrteam> | ^~~~~~~~~~ compilation terminated.
s432412614
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void bfs(int s) { queue<int> q; q.push(s); for ( int i = 0; i < n; i++ ) d[i] = INFTY; d[s] = 0; int u; while ( !q.empty() ) { u = q.front(); q.pop(); for ...
a.cc: In function 'int main()': a.cc:49:3: error: 'dfs' was not declared in this scope; did you mean 'bfs'? 49 | dfs(0); | ^~~ | bfs
s808225158
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void bfs(int s) { queue<int> q; q.push(s); for ( int i = 0; i < n; i++ ) d[i] = INFTY; d[s] = 0; int u; while ( !q.empty() ) { u = q.front()...
a.cc:1:20: warning: extra tokens at end of #include directive 1 | #include<iostream> #include<queue> | ^ a.cc: In function 'void bfs(int)': a.cc:9:5: error: 'queue' was not declared in this scope 9 | queue<int> q; | ^~~~~ a.cc:2:1: note: 'std::queue' is defined in header '...
s874393144
p02239
C++
from collections import deque n = int(input()) A = [0]*(n+1) D = [-1]*(n+1) DP = [0]*(n+1) d = deque() for i in range(n): A[i+1] = [int(i) for i in input().split()] d.append(1) D[1] = 0 DP[1] = 0 while(len(d)>0): tmp = d.pop() for i in A[tmp][2:]: if not DP[i]: D[i] = D[tmp]+1 ...
a.cc:1:1: error: 'from' does not name a type 1 | from collections import deque | ^~~~
s550547177
p02239
C++
from collections import deque n = int(input()) A = [0]*(n+1) D = [-1]*(n+1) DP = [0]*(n+1) d = deque() for i in range(n): A[i+1] = [int(i) for i in input().split()] d.append(1) D[1] = 0 DP[1] = 1 while(len(d)>0): tmp = d.pop() for i in A[tmp][2:]: if not DP[i]: D[i] = D[tmp]+1 ...
a.cc:1:1: error: 'from' does not name a type 1 | from collections import deque | ^~~~
s102211613
p02239
C++
#include <iostream> #include <vector> #include <unordered_map> #include <queue> #include "../cxx-prettyprint/prettyprint.hpp" int main() { int n; std::cin >> n; std::unordered_map<int, std::vector<int>> Adj(n); for (int i = 0; i < n; i ++) { int u, k; std::cin >> u >> k; std:...
a.cc:5:10: fatal error: ../cxx-prettyprint/prettyprint.hpp: No such file or directory 5 | #include "../cxx-prettyprint/prettyprint.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s827367483
p02239
C++
#include <iostream> #include <vector> #include <unordered_map> #include <queue> //#include "../cxx-prettyprint/prettyprint.hpp" int main() { int n; std::cin >> n; std::unordered_map<int, std::vector<int>> Adj(n); for (int i = 0; i < n; i ++) { int u, k; std::cin >> u >> k; st...
a.cc: In function 'int main()': a.cc:24:10: error: 'set' is not a member of 'std' 24 | std::set<int> nodes_unvisited; | ^~~ a.cc:5:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>' 4 | #include <queue> +++ |+#include <set> 5 | //#includ...
s759672779
p02239
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s161387760
p02239
C++
#include<stdio.h> #define N 101 #define WHITE 2 #define GRAY 1 #define BLACK 0 #define INF 1000000 int n, h= 0, t = 0; int col[N], d[N], a[N][N], e[N]; int Que[N]; int Dequeque(){ h++; return Que[h - 1]; } void Enqueque(int b){ Que[t] = b; t++; } void BFS(int s){ int i, u, next; for(i = 1; i < n+...
a.cc:57:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 57 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:78:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 78 | for(j = 1; j <= e; j++){ | ~~^~~~
s121564679
p02239
C++
#include <iostream> #include <queue> using namespace std; int D[100100];//始点からの距離を入れる int g[1001][1001]={{0}};//要素を0で初期化 void bfs(int src,int n){//srcは開始位置この場合だと頂点1だから0 // cerr << "bfs_root = " << src << endl; queue<int> Q; Q.push(src); D[src] = 0; while (! Q.empty() ){ int cur = Q.front(); Q.pop(...
a.cc: In function 'void ans(int)': a.cc:27:25: error: 'enl' was not declared in this scope 27 | cout << 1 <<" "<< 0 <<enl; | ^~~
s599625105
p02239
C++
#include <set> #include <map> #include <list> #include <queue> #include <stack> #include <cmath> #include <ctype.h> #include <ctime> #include <cstdio> #include <vector> #include <string> #include <bitset> #include <cctype> #include <cstdlib> #include <cstring> #include <utility> #include <numeric> #include <complex> #i...
a.cc: In function 'void bsf(int)': a.cc:52:40: error: incompatible types in assignment of 'int' to 'int [100]' 52 | if(dist[i] == INF)dist = -1; | ~~~~~^~~~
s521797645
p02239
C++
#include<iostream> #include<queue> using namespeace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; coid dfs(int s) { queue<int> q; q.push(s); for(int i = 0; i < n; i++)d[i] = INFTY; d[s] = 0; int u; while(!q.empty()) { u =.front(); q.pop(); for(int...
a.cc:4:7: error: expected nested-name-specifier before 'namespeace' 4 | using namespeace std; | ^~~~~~~~~~ a.cc:11:1: error: 'coid' does not name a type; did you mean 'void'? 11 | coid dfs(int s) | ^~~~ | void a.cc: In function 'int main()': a.cc:40:3: error: 'cin' was not declared in thi...
s924400598
p02239
C++
#include<iostream> #include<queue> using namespeace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void dfs(int s) { queue<int> q; q.push(s); for(int i = 0; i < n; i++)d[i] = INFTY; d[s] = 0; int u; while(!q.empty()) { u =.front(); q.pop(); for(int...
a.cc:4:7: error: expected nested-name-specifier before 'namespeace' 4 | using namespeace std; | ^~~~~~~~~~ a.cc: In function 'void dfs(int)': a.cc:13:3: error: 'queue' was not declared in this scope; did you mean 'std::queue'? 13 | queue<int> q; | ^~~~~ | std::queue In file included...
s419404308
p02239
C++
#include<iostream> #include<queue> using namespeace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void dfs(int s) { queue<int> q; q.push(s); for(int i = 0; i < n; i++)d[i] = INFTY; d[s] = 0; int u; while(!q.empty()) { u =q.front(); q.pop(); for(in...
a.cc:4:7: error: expected nested-name-specifier before 'namespeace' 4 | using namespeace std; | ^~~~~~~~~~ a.cc: In function 'void dfs(int)': a.cc:13:3: error: 'queue' was not declared in this scope; did you mean 'std::queue'? 13 | queue<int> q; | ^~~~~ | std::queue In file included...
s376556902
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void bfs(int s) { queue<int> q; q.push(s); for(int i = 0; i < n; i++)d[i] = INFTY; d[s] = 0; int u; while(!q.empty()) { u =q.front(); q.pop(); for(int...
a.cc: In function 'void bfs(int)': a.cc:31:19: error: expected ';' before string constant 31 | cout << i+1 " " <<((d[i] == INFTY)?(-1):d[i])<<endl; | ^~~~ | ;
s212001570
p02239
C++
#include <stdio.h> #include <stdlib.h> #define WHITE 0 #define GRAY 1 #define BLACK 2 #define MAX_N 110 int n,time,head,tail; int queue[MAX_N]; int *dist; int *color; int **matrix; void enqueue(int); int dequeue(void); void bfs(void); int main(){ int i,j,u,k,v; scanf("%d",&n); //queue = malloc(n * sizeof(in...
a.cc: In function 'int main()': a.cc:25:17: error: invalid conversion from 'void*' to 'int*' [-fpermissive] 25 | color = malloc(n * sizeof(int)); | ~~~~~~^~~~~~~~~~~~~~~~~ | | | void* a.cc:26:16: error: invalid conversion from 'void*' to 'int*' [-fpermiss...
s805463390
p02239
C++
#include <stdio.h> #include <stdlib.h> #define WHITE 0 #define GRAY 1 #define BLACK 2 #define MAX_N 110 int n,time,head,tail; int *queue; int *dist; int *color; int **matrix; void enqueue(int); int dequeue(void); void bfs(void); int main(){ int i,j,u,k,v; scanf("%d",&n); queue = malloc(MAX_N * sizeof(int));...
a.cc: In function 'int main()': a.cc:24:17: error: invalid conversion from 'void*' to 'int*' [-fpermissive] 24 | queue = malloc(MAX_N * sizeof(int)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~ | | | void* a.cc:25:17: error: invalid conversion from 'void*' to 'int*' [-...
s971343847
p02239
C++
#include <stdio.h> #include <stdlib.h> #define WHITE 0 #define GRAY 1 #define BLACK 2 #define MAX_N 100 int n,time,head,tail; int *queue; int *dist; int *color; int **matrix; void enqueue(int); int dequeue(void); void bfs(void); int main(){ int i,j,u,k,v; scanf("%d",&n); queue = malloc(MAX_N * sizeof(int));...
a.cc: In function 'int main()': a.cc:24:17: error: invalid conversion from 'void*' to 'int*' [-fpermissive] 24 | queue = malloc(MAX_N * sizeof(int)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~ | | | void* a.cc:25:17: error: invalid conversion from 'void*' to 'int*' [-...
s919234165
p02239
C++
#include <stdio.h> #include <stdlib.h> #define WHITE 0 #define GRAY 1 #define BLACK 2 #define MAX_N 100 int n,time,head,tail; int *queue; int *dist; int *color; int* matrix[MAX_N]; void enqueue(int); int dequeue(void); void bfs(void); int main(){ int i,j,u,k,v; scanf("%d",&n); queue = malloc(n * sizeof(int)...
a.cc: In function 'int main()': a.cc:24:17: error: invalid conversion from 'void*' to 'int*' [-fpermissive] 24 | queue = malloc(n * sizeof(int)); | ~~~~~~^~~~~~~~~~~~~~~~~ | | | void* a.cc:25:17: error: invalid conversion from 'void*' to 'int*' [-fpermiss...
s593339145
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n,M[N][N]; ind d[N]; void bfs( int s ){ queue<int> q; q.push(s); for( int i = 0 ; i < n ; i++ ){ d[i] = INFTY; } d[s] = 0;int u; while( !q.empty() ){ u = q.front(); q.pop(); ...
a.cc:8:1: error: 'ind' does not name a type; did you mean 'int'? 8 | ind d[N]; | ^~~ | int a.cc: In function 'void bfs(int)': a.cc:14:5: error: 'd' was not declared in this scope 14 | d[i] = INFTY; | ^ a.cc:16:3: error: 'd' was not declared in this scope 16 | d[s] = 0;int u; ...
s831008085
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n,M[N][N]; int d[N]; void bfs( int s ){ queue<int> q; q.push(s); for( int i = 0 ; i < n ; i++ ){ d[i] = INFTY; } d[s] = 0;int u; while( !q.empty() ){ u = q.front(); q.pop(); ...
a.cc: In function 'int main()': a.cc:34:11: error: expected ';' before ':' token 34 | cin >> n: | ^ | ; a.cc:35:20: error: 'i' was not declared in this scope 35 | for( int i = 0 ; i < n ; i++ ){ | ^
s459927431
p02239
C++
#include<stdio.h> int G[101][101], q1[101], q2[101], n; void f(int a, int b){ int i; q1[a] = b; for(i = 1; i <= B[a]; i++){ if(b + 1 < q1[G[a][i]]) f(G[a][i], b + 1); } } int main(){ int i, j, m; scanf("%d", &n); for(i = 1; i <= n; i++){ q1[i] = 100000000; scanf("%d", &m); scan...
a.cc: In function 'void f(int, int)': a.cc:9:19: error: 'B' was not declared in this scope 9 | for(i = 1; i <= B[a]; i++){ | ^ a.cc: In function 'int main()': a.cc:24:21: error: 'B' was not declared in this scope 24 | for(j = 1; j <= B[m]; j++) scanf("%d", &G[m][j]); | ...
s849617601
p02239
C++
#include<stdio.h> int G[101][101], q1[101], q2[101], n; void f(int a, int b){ int i; q1[a] = b; for(i = 1; i <= B[a]; i++){ if(b + 1 < q1[G[a][i]]) f(G[a][i], b + 1); } } int main(){ int i, j, m; scanf("%d", &n); for(i = 1; i <= n; i++){ q1[i] = 100000000; scanf("%d", &m); scan...
a.cc: In function 'void f(int, int)': a.cc:9:19: error: 'B' was not declared in this scope 9 | for(i = 1; i <= B[a]; i++){ | ^
s506454460
p02239
C++
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <queue> #include <limits.h> using namespace std; vector<int> v[101]; int d[101]; queue<int> q; bool flag[101]; int main(){ int n, u, k; scanf("%d", &n); for (int i = 0; i < n; ++i){ scanf("%d %d", &...
a.cc: In function 'int main()': a.cc:22:9: error: 'memset' was not declared in this scope 22 | memset(d, -1, sizeof(d)); | ^~~~~~ a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 7 | #include <limits.h> +++ |+#include <cstr...
s175013128
p02239
C++
#include <iostream> #include <limits> using namespace std; bool adjmatrix[101 * 101]; int costs[101]; void BFS(int vertex, int cur_cost, int N) { if (costs[vertex] < cur_cost) return; costs[vertex] = cur_cost; for (int i =1; i<= N; i++) { if(adjmatrix[vertex*101 + i]) { BFS(i, cur_cost + 1, N); ...
a.cc: In function 'int main()': a.cc:24:16: error: 'INT_MAX' was not declared in this scope 24 | costs[i] = INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <limits> +++ |+#include <climi...
s827242299
p02239
C++
#include <iostream> #include <limits> using namespace std; bool adjmatrix[101 * 101]; int costs[101]; void BFS(int vertex, int cur_cost, int N) { if (costs[vertex] < cur_cost) return; costs[vertex] = cur_cost; for (int i =1; i<= N; i++) { if(adjmatrix[vertex*101 + i]) { BFS(i, cur_cost + 1, N); ...
a.cc: In function 'int main()': a.cc:24:16: error: 'INT_MAX' was not declared in this scope 24 | costs[i] = INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 2 | #include <limits> +++ |+#include <climi...
s796848908
p02239
C++
def dfs(src) D[src] = $time (0..N - 1).each do |dst| if D[dst] == nil && G[src][dst] == 1 D[dst] = D[src] + 1 dfs(dst) end end end N = gets.to_i G = (1..N).map{ Array.new(N, 0) } N.times do u, k, *v = gets.split(' ').map(&:to_i) v.each do |vi| G[u - 1][vi - 1] = 1 end end D = Array...
a.cc:3:4: error: too many decimal points in number 3 | (0..N - 1).each do |dst| | ^~~~ a.cc:12:6: error: too many decimal points in number 12 | G = (1..N).map{ Array.new(N, 0) } | ^~~~ a.cc:20:18: error: stray '#' in program 20 | D = Array.new(N) #??????????¨???????????????? | ...
s186131145
p02239
C++
/** * @brief 幅優先探索のテスト * @date 作成日 : 2016/02/13 * @date 最終更新日 : 2016/02/13 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <iostream> #include <iterator> #include <functional> #include <utility> #include <algorithm> #include <vector> #...
a.cc:28:23: error: 'int32_t' in namespace 'std' does not name a type 28 | using weight_t = std::int32_t; | ^~~~~~~ a.cc:29:23: error: 'int32_t' in namespace 'std' does not name a type 29 | using index_t = std::int32_t; | ^~~~~~~ a.cc:37:6: warning: elaborat...
s634452277
p02239
C++
/** * @brief 幅優先探索のテスト * @date 作成日 : 2016/02/13 * @date 最終更新日 : 2016/02/13 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <iostream> #include <iterator> #include <functional> #include <utility> #include <algorithm> #include <vector> #...
a.cc:28:23: error: 'int32_t' in namespace 'std' does not name a type 28 | using weight_t = std::int32_t; | ^~~~~~~ a.cc:29:23: error: 'int32_t' in namespace 'std' does not name a type 29 | using index_t = std::int32_t; | ^~~~~~~ a.cc:37:6: warning: elaborat...
s332751879
p02239
C++
/** * @brief 幅優先探索のテスト * @date 作成日 : 2016/02/13 * @date 最終更新日 : 2016/02/13 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <iostream> #include <iterator> #include <functional> #include <utility> #include <algorithm> #include <vector> #...
a.cc:28:23: error: 'int32_t' in namespace 'std' does not name a type 28 | using weight_t = std::int32_t; | ^~~~~~~ a.cc:29:23: error: 'int32_t' in namespace 'std' does not name a type 29 | using index_t = std::int32_t; | ^~~~~~~ a.cc:37:6: error: use of enu...
s617280805
p02239
C++
/** * @brief 幅優先探索のテスト * @date 作成日 : 2016/02/13 * @date 最終更新日 : 2016/02/13 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <iostream> #include <iterator> #include <functional> #include <utility> #include <algorithm> #include <vector> #...
a.cc:28:23: error: 'int32_t' in namespace 'std' does not name a type 28 | using weight_t = std::int32_t; | ^~~~~~~ a.cc:29:23: error: 'int32_t' in namespace 'std' does not name a type 29 | using index_t = std::int32_t; | ^~~~~~~ a.cc:47:5: error: 'index_t' ...
s348517772
p02239
C++
/** * @brief 幅優先探索のテスト * @date 作成日 : 2016/02/13 * @date 最終更新日 : 2016/02/13 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <iostream> #include <iterator> #include <functional> #include <utility> #include <algorithm> #include <vector> #...
a.cc:28:23: error: 'int32_t' in namespace 'std' does not name a type 28 | using weight_t = std::int32_t; | ^~~~~~~ a.cc:29:23: error: 'int32_t' in namespace 'std' does not name a type 29 | using index_t = std::int32_t; | ^~~~~~~ a.cc:47:5: error: 'weight_t'...
s835051730
p02239
C++
/** * @brief 幅優先探索のテスト * @date 作成日 : 2016/02/13 * @date 最終更新日 : 2016/02/13 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <iostream> #include <iterator> #include <functional> #include <utility> #include <algorithm> #include <vector> #...
a.cc:28:23: error: 'int32_t' in namespace 'std' does not name a type 28 | using weight_t = std::int32_t; | ^~~~~~~ a.cc:29:23: error: 'int32_t' in namespace 'std' does not name a type 29 | using index_t = std::int32_t; | ^~~~~~~ a.cc:47:5: error: 'weight_t'...
s132057999
p02239
C++
/** * @brief 幅優先探索のテスト * @date 作成日 : 2016/02/13 * @date 最終更新日 : 2016/02/13 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <iostream> #include <iterator> #include <functional> #include <utility> #include <algorithm> #include <vector> #...
a.cc:39:25: error: 'int32_t' in namespace 'std' does not name a type 39 | using weight_t = std::int32_t; /**< 辺(u, v)への重みwを表す型 */ | ^~~~~~~ a.cc:40:25: error: 'int32_t' in namespace 'std' does not name a type 40 | using index_t = std::int32_t; /**< 頂点vの添字を表す型 */ | ...
s562285207
p02239
C++
#include <queue> #include <vector> #include <iostream> using namespace std; // ------ Class ------ // class Graph1 { public: // ------ Variables ------ // static const int INF = 1000000000; int V, E; vector<vector<int> > G; // ------ Constructors ------ // Graph1() : V(0), E(0), G(vector<vector<int> >()) {} Gra...
a.cc: In function 'int main()': a.cc:53:25: error: 'dist' was not declared in this scope 53 | vector<int> d = dist(0); | ^~~~
s064801143
p02239
C++
// // Created by ?????°?????? on 2016/05/15. // #include <iostream> #include <queue> using namespace std; const int N = 100; const int INFTY = (1<<21); int n,M[N][N]; int d[N]; //?????¢ void bfs(int s){ queue<int> q; q.push(s); for (int i = 0; i < n ; ++i) d[i] = INFTY; d[s] = 0; int u; while...
a.cc: In function 'int main()': a.cc:51:5: error: 'dfs' was not declared in this scope; did you mean 'bfs'? 51 | dfs(); | ^~~ | bfs
s471932779
p02239
C++
include <iostream> #include <queue> #define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i)) #define REP(i,n) FOR(i,0,n) using namespace std; int main(){ int n,u,k,v,src=0; cin >> n; int D[n],g[n][n]; REP(i,n){ D[i] = 0; REP(j,n){ g[i][j] = 0; } } REP(i,n){ ...
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/deque:62, from /usr/include/c++/14/queue:62, from a.cc:2: /usr/include/c++/14/ext/type_...
s195946489
p02239
C++
include <iostream> #include <queue> #define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i)) #define REP(i,n) FOR(i,0,n) using namespace std; int main(){ int n,u,k,v,src=0; cin >> n; int D[n],g[n][n]; REP(i,n){ D[i] = 0; REP(j,n){ g[i][j] = 0; } } REP(i,n){ ...
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/deque:62, from /usr/include/c++/14/queue:62, from a.cc:2: /usr/include/c++/14/ext/type_...
s532312353
p02239
C++
#include <iostream> #include <queue> using namespace std; int main() { int a[101][101] = {{0}}; int u, k, v, km; km = 0; while ( cin >> u, k ) { for ( int i = 1; i <= k; i++ ) { cin >> v; a[u][v] = 1; } km++; } int n0; int b[km + 1] = {- 1}; queue<int> q; q.push( 1 ); b[1] = 0; int cou = 0; for...
a.cc: In function 'int main()': a.cc:31:38: error: cannot convert 'std::queue<int>::empty' from type 'bool (std::queue<int>::)() const' to type 'bool' 31 | if ( q.empty ) break; | ^
s026687549
p02239
C++
#include <iostream> #include <queue> using namespace std; int main() { int a[101][101] = {{0}}; int u, k, v, km; km = 0; while ( cin >> u, k ) { for ( int i = 1; i <= k; i++ ) { cin >> v; a[u][v] = 1; } km++; } int n0; int b[101] = {- 1}; queue<int> q; q.push( 1 ); b[1] = 0; int cou = 0; for ( ...
a.cc: In function 'int main()': a.cc:31:38: error: cannot convert 'std::queue<int>::empty' from type 'bool (std::queue<int>::)() const' to type 'bool' 31 | if ( q.empty ) break; | ^
s042988999
p02239
C++
#include<iostream> #include<queue> using namespace std; int main() { queue<int> Q; int n,src=0; int a, b, c; cin >> n; int D[n], in[n][n]; for (int i = 0; i < n; i++) { D[i] = -1; for (int j = 0; j < n; j++) in[i][j] = 0; } for (int i = 0; i < n; i++) ...
a.cc: In function 'int main()': a.cc:29:15: error: cannot convert 'std::queue<int>::empty' from type 'bool (std::queue<int>::)() const' to type 'bool' 29 | while (!Q.empty) | ^~~~~ a.cc:29:15: error: in argument to unary ! 29 | while (!Q.empty) | ~~^~~~~
s021175427
p02239
C++
#include "stdafx.h" #include <utility> #include <iostream> #include <algorithm> #include <queue> using namespace std; int D[110]; // ?????¢????¨???¶ int v, A[100][100], u, k, w; queue<int> Q; void bfs(int src) { Q.push(src); D[src] = 0; while (!Q.empty()) { int cur = Q.front(); Q.pop(); for (int i = 0; i ...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s969107185
p02239
C++
#include <iostream> #include <vector> #include <numeric> #include <cassert> #include <queue> const int MAXINT = std::numeric_limits<int>::max(); void bfs(std::vector<std::vector<int> >& adj_list, std::vector<int>& d, int root = 0 ){ std::queue<int> target_q; // std::queue<int> dist_q; target_q.push(root); d[r...
a.cc:7:25: error: 'numeric_limits' is not a member of 'std' 7 | const int MAXINT = std::numeric_limits<int>::max(); | ^~~~~~~~~~~~~~ a.cc:7:40: error: expected primary-expression before 'int' 7 | const int MAXINT = std::numeric_limits<int>::max(); | ...
s704890684
p02239
C++
#include <iostream> #include <vector> #include <numeric> #include <cassert> #include <queue> const int MAXINT = 1000000000; void bfs(std::vector<std::vector<int> >& adj_list, std::vector<int>& d, int root = 0 ){ std::queue<int> target_q; // std::queue<int> dist_q; target_q.push(root); d[root] = 0; // dist_q...
a.cc: In function 'int main(int, const char**)': a.cc:51:37: error: expected ':' before '::' token 51 | << " " << (d[i]==MAXINT ? -1 :: d[i]) | ^~~ | : a.cc:51:41: error: '::d' has not been declared 51 | << " " << ...
s775087284
p02239
C++
#include <iostream> #include <queue> using namespace std; int n, u, k, v; int a[100][100] = {{0}}; int b[100] = { - 1 }; queue<int> q; int main() { cin >> n; for ( int i = 0; i < n; i++ ) { cin >> u >> k; for ( j = 0; j < k; j++ ) { cin >> v; a[u - 1][v - 1] = 1; } } b[0] = 0; q.push( 0 ); while ( !...
a.cc: In function 'int main()': a.cc:14:23: error: 'j' was not declared in this scope 14 | for ( j = 0; j < k; j++ ) { | ^
s234077282
p02239
C++
//push(),pop():C++ではstackと統一されいる //front():先頭の要素が何かを返す //back():末尾の要素が何であるかを返す //empty():キューが空であるかどうかを調べる //size():要素数を調べる #include<stdio.h> #include <iostream> #include <queue> using namespace std; #define MAX 101 #define WHITE 0 #define GRAY 1 #define BLACK 2 static const int INFTY = (1<<21); int G[MAX][MAX],color[M...
a.cc: In function 'int main()': a.cc:64:2: error: expected '}' at end of input 64 | } | ^ a.cc:39:11: note: to match this '{' 39 | int main(){ | ^
s752322181
p02239
C++
#include <iostream> #include <vector> #include <list> #include <cstdlib> #include <climits> const int MAX_N = 100; struct Node { int v; int d; bool visited; }; int main(void) { std::cin.tie(0); std::ios::sync_with_stdio(false); int n = 0; std::cin >> n; std::vector<std::vector<int> *> *graph = ne...
a.cc: In function 'int main()': a.cc:66:11: error: 'node' was not declared in this scope; did you mean 'Node'? 66 | if (node->d < count) { | ^~~~ | Node
s167912180
p02239
C++
#include <iostream> #include <vector> #include <list> #include <cstdlib> #include <climits> const int MAX_N = 100; struct Node { int v; int d; bool visited; }; int main(void) { std::cin.tie(0); std::ios::sync_with_stdio(false); int n = 0; std::cin >> n; std::vector<std::vector<int> *> *graph = ne...
a.cc: In function 'int main()': a.cc:66:11: error: 'node' was not declared in this scope; did you mean 'Node'? 66 | if (node->at(v)->d < count) { | ^~~~ | Node
s613412827
p02239
C++
include <iostream> #include <queue> using namespace std; typedef long long ll; #define int ll int g[105][105], d[105], n; void bfs() { queue<int> q; q.push(0); fill(d, d + n, -1); d[0] = 0; while(!q.empty()) { int que = q.front(); q.pop(); for (int i = 0; i < n; i++) { if (g[que][i] && d...
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/deque:62, from /usr/include/c++/14/queue:62, from a.cc:2: /usr/include/c++/14/ext/type_...
s047359803
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void bfs(int s) { int i, u, v; queue<int> q; q.push(s); for ( i = 0; i < n; i++ ) d[i] = INFTY; d[s] = 0; while ( !q.empty() ) { u = q.frout(); q.pop(); for ( v =...
a.cc: In function 'void bfs(int)': a.cc:19:23: error: 'class std::queue<int>' has no member named 'frout'; did you mean 'front'? 19 | u = q.frout(); | ^~~~~ | front
s138911660
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void bfs(int s) { queue<int> q; q.push(s); for (int i = 0; i < n; i++) { d[i] = INFTY; } d[s] = 0; int u; while (!q.empty()) { u = q.front(); q.pop(); ...
a.cc: In function 'void bfs(int)': a.cc:33:61: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 33 | cout << i + 1 << " " << ((d[i] == INFTY) ? (-1) : d[i]) << end; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~...
s827772785
p02239
C++
#include<iostream> #include<queue> using namespase std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void bfs(int s) { queue<int> q; q.push(s); for (int i = 0; i < n; i++) d[i] = INFTY; d[s] = 0; int u; while ( !q.empty() ) { u = q.front(); q.pop(); for ( ...
a.cc:4:7: error: expected nested-name-specifier before 'namespase' 4 | using namespase std; | ^~~~~~~~~ a.cc: In function 'void bfs(int)': a.cc:12:3: error: 'queue' was not declared in this scope; did you mean 'std::queue'? 12 | queue<int> q; | ^~~~~ | std::queue In file included fr...
s923240345
p02239
C++
#include<iostream> #include<queue> using namespase std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void bfs(int s) { queue<int> q; q.push(s); for (int i = 0; i < n; i++) d[i] = INFTY; d[s] = 0; int u; while ( !q.empty() ) { u = q.front(); q.pop(); for ( ...
a.cc:4:7: error: expected nested-name-specifier before 'namespase' 4 | using namespase std; | ^~~~~~~~~ a.cc: In function 'void bfs(int)': a.cc:12:3: error: 'queue' was not declared in this scope; did you mean 'std::queue'? 12 | queue<int> q; | ^~~~~ | std::queue In file included fr...
s541484918
p02239
C++
#include <iostream> #include <vector> #include <stack> #include <queue> using namespace std; static const int N = 100; static const int NEW = 0; static const int VISITING = 1; static const int OLD = 2; int n, m[N][N] = {0}, t; int color[N] = { 0 }, t1[N] = { 0 }, t2[N] = {0}; void getMatrix() { int u, v, k; cin >...
a.cc: In function 'void bfs(int)': a.cc:95:27: error: 'INT_MAX' was not declared in this scope 95 | dist[i] = INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <queue>...
s706699168
p02239
C++
#include <iostream> #include <vector> #include <stack> #include <queue> using namespace std; static const int N = 100; static const int NEW = 0; static const int VISITING = 1; static const int OLD = 2; int n, m[N][N] = {0}, t; int color[N] = { 0 }, t1[N] = { 0 }, t2[N] = {0}; void getMatrix() { int u, v, k; cin >...
a.cc: In function 'void bfs(int)': a.cc:95:27: error: 'INT_MAX' was not declared in this scope 95 | dist[i] = INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <queue>...
s440182892
p02239
C++
#include <bits/stdc++.h> #include <bits/stdc++.h> #define r(i,a,n) for(int i=a;i<n;i++) using namespace std; int a[101][101],start[101],end[101],n,p=0,v[101]; queue<int> q; void bfs(int u){ q.push(u); v[u]++; while(!q.empty()){ u=q.front();q.pop(); r(i,1,n+1)if(!v[i]&&a[u][i]){ v[i]++; q.push(i); start[...
a.cc: In function 'int main()': a.cc:30:13: error: 'i' was not declared in this scope 30 | bfs(i); | ^
s693961938
p02239
C++
#include <iostream> #include <queue> using namespace std; static const int N=100; static const int INF=-1; int M[N][N],n; int d[N]; void bfs(int s){ queue<int> q; q.push(s); for(int i=0;i<n;i++){ d[i]=INF; } d[s]=0; while(!q.empty()){ int u=q.front(); q.pop(); for(int v=0;v<n;v++){ ...
a.cc: In function 'int main()': a.cc:46:9: error: expected primary-expression before ';' token 46 | u=--; | ^
s334755171
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); // ?????????????????????(2^21) int n,M[N][N]; int d[N]; // ?????¢??§?¨??????¶???(color)??????????????? void bfs(int s){ queue<int> q; // ?¨??????????????????????queue????????¨ q.push(s); for(int i=0...
a.cc: In function 'int main()': a.cc:46:18: error: expected '}' at end of input 46 | } | ^ a.cc:39:29: note: to match this '{' 39 | for(int i=0;i<n;i++){ | ^ a.cc:46:18: error: expected '}' at end of input 46 | } ...
s550451661
p02239
C++
#include "taichitary.h" #define V_MAX 100 int m[V_MAX][V_MAX]; int cnt[V_MAX]; int count=0; int n; void bfs(int u){ queue<int> Q; Q.push(u); cnt[u] = 0; int v = Q.front(); while(!Q.empty()){ for(int i=0; i<n; i++){ if(m[v][i] == 1 && cnt[i] == -1){ Q.push(i);...
a.cc:1:10: fatal error: taichitary.h: No such file or directory 1 | #include "taichitary.h" | ^~~~~~~~~~~~~~ compilation terminated.
s444860133
p02239
C++
#include <iostream> #include <queue> using namespace std; #define N 100 #define INFTY (1 << 21) int n, M[N][N]; int d[N]; void bfs(int s) { queue<int> q; q.push(s); for ( int i = 0; i < n; i++ ) { d[i] = INFTY; } d[s] = 0; int u; while ( !q.empty() ) { u = q.front(); q.pop(); for ( int v = ...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s218790911
p02239
C++
#include <vector> #include <iostream> using namespace std; int n, u, k, v, dp[101]; bool li[101][101]; int main(){ fill(dp, dp + 101, -1); for (int i = 0; i < 101; i++) { fill(li[i], li[i] + 101, false); } cin >> n; for (int i = 0; i < n; i++) { cin >> u >> k; for (int j = 0; j < k; j++) { cin >> v; ...
a.cc: In function 'int main()': a.cc:35:25: error: cannot bind non-const lvalue reference of type 'std::vector<int>&' to an rvalue of type 'std::vector<int>' 35 | l2.swap(vector<int>()); | ^~~~~~~~~~~~~ In file included from /usr/include/c++/14/vector:66, ...
s211761770
p02239
C++
#include <iostream> #include <vector> #include <queue> using namespace std; int main(){ int n; vector<int> mat[100]; cin >> n; for(int i=0;i<n;i++){ int u,k; cin >> u >> k; for(int j=0;j<k;j++){ int v; cin >> v; mat[i].push_back(v); } } int d[100]; for(int i=0;i<n;i++)...
a.cc: In function 'int main()': a.cc:29:60: error: no match for 'operator!=' (operand types are 'std::vector<int>::iterator' and '<unresolved overloaded function type>') 29 | for(vector<int>::iterator it=mat[nb.front()].begin();it!=mat[nb.front()].end;it++){ | ...
s289645413
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n,M[N][N]; int d[N]; void bfs(int s){ queue<int> q; q.push(s); for(int i=0;i<n;i++) d[i]=INFTY; d[s]=0; int u; while(!q.empty()){ u=q.front(); q.pop(); for(int v=0;v<n;v++...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s973282540
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N=100; static const int INFTY=(1<<21); int n,M[N][N]; int d[N]; void bfs(int s){ queue<int> q; p.push(s); for(int i+0;i<n;i++){ d[i]=INFTY; } d[s]=0; int u; whie(!q.empty){ q.front(); q.pop(); for(int v=0;v<n;v++){ ...
a.cc: In function 'void bfs(int)': a.cc:12:3: error: 'p' was not declared in this scope 12 | p.push(s); | ^ a.cc:13:12: error: expected ';' before '+' token 13 | for(int i+0;i<n;i++){ | ^ | ; a.cc:13:18: error: expected ')' before ';' token 13 | for(int i+0;i<n;i...
s077795193
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N=100; static const int INFTY=(1<<21); int n,M[N][N]; int d[N]; void bfs(int s){ queue<int> q; q.push(s); for(int i+0;i<n;i++){ d[i]=INFTY; } d[s]=0; int u; whie(!q.empty){ q.front(); q.pop(); for(int v=0;v<n;v++){ ...
a.cc: In function 'void bfs(int)': a.cc:13:12: error: expected ';' before '+' token 13 | for(int i+0;i<n;i++){ | ^ | ; a.cc:13:18: error: expected ')' before ';' token 13 | for(int i+0;i<n;i++){ | ~ ^ | ) a.cc:13:19: error: 'i' was ...
s793151730
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N=100; static const int INFTY=(1<<21); int n,M[N][N]; int d[N]; void bfs(int s){ queue<int> q; q.push(s); for(int i=0;i<n;i++){ d[i]=INFTY; } d[s]=0; int u; whie(!q.empty){ q.front(); q.pop(); for(int v=0;v<n;v++){ ...
a.cc: In function 'void bfs(int)': a.cc:18:11: error: cannot convert 'std::queue<int>::empty' from type 'bool (std::queue<int>::)() const' to type 'bool' 18 | whie(!q.empty){ | ^~~~~ a.cc:18:11: error: in argument to unary ! 18 | whie(!q.empty){ | ~~^~~~~ a.cc:18:3: error: 'whie'...
s131822809
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N=100; static const int INFTY=(1<<21); int n,M[N][N]; int d[N]; void bfs(int s){ queue<int> q; q.push(s); for(int i=0;i<n;i++){ d[i]=INFTY; } d[s]=0; int u; while(!q.empty){ q.front(); q.pop(); for(int v=0;v<n;v++){...
a.cc: In function 'void bfs(int)': a.cc:18:12: error: cannot convert 'std::queue<int>::empty' from type 'bool (std::queue<int>::)() const' to type 'bool' 18 | while(!q.empty){ | ^~~~~ a.cc:18:12: error: in argument to unary ! 18 | while(!q.empty){ | ~~^~~~~ a.cc:19:12: warning:...
s463944197
p02239
C++
#include <iostream> #include <queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n, G[N][N]; int d[N]; void bfs(int s){ queue<int> q; q.push(s); for(int i = 0; i < n; i++) d[i] = INFTY; d[s] = 0; int u; while(!q.empty()){ u = q.front(); q.pop(); for(in...
a.cc: In function 'void bfs(int)': a.cc:28:5: error: 'cont' was not declared in this scope; did you mean 'const'? 28 | cont << i + 1 << " " << ((d[i] == INFTY) ? (-1) : d[i]) << endl; | ^~~~ | const a.cc: In function 'int main()': a.cc:46:7: error: 'M' was not declared in this scope 46 | ...
s729892448
p02239
C++
#include <stdio.h> #include <stdlib.h> struct node_t { int key; struct node_t *next; }; typedef struct node_t Node; Node *enqueue(Node *node, int key) { Node *p, *q; if (node == NULL) { node = malloc(sizeof(Node)); node->key = key; node->next = NULL; return node; } for (p = node; p !...
a.cc: In function 'Node* enqueue(Node*, int)': a.cc:14:18: error: invalid conversion from 'void*' to 'Node*' {aka 'node_t*'} [-fpermissive] 14 | node = malloc(sizeof(Node)); | ~~~~~~^~~~~~~~~~~~~~ | | | void* a.cc:23:19: error: invalid conversion fro...
s207575862
p02239
C++
# -*- coding: utf-8 -*- from collections import deque N = int(input()) adj = [[0]*N for _ in range(N)] unsearched = set(range(1, N)) result = {n:-1 for n in range(N)} for n in range(N): inp = list(map(int, input().split())) for i in inp[2:]: adj[inp[0]-1][i-1] = 1 que = deque([[0, 0]]) # edge distanc...
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- coding: utf-8 -*- | ^ a.cc:14:23: error: stray '#' in program 14 | que = deque([[0, 0]]) # edge distance | ^ a.cc:2:1: error: 'from' does not name a type 2 | from collections import deque | ^~~~ a.cc:9:1: ...
s007088015
p02239
C++
#include "stdafx.h" #include <iostream> #include <string> #include <vector> #include <algorithm> #include <queue> #include <stdio.h> #define REP(i, n) for(int i = 0;i < n;i++) using namespace std; static const int N = 100; static const int INFTY = (1 << 21); int n, M[N][N]; int d[N]; void bfs(int s) { queue<int> q...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s010913936
p02239
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <queue> #include <stdio.h> #define REP(i, n) for(int i = 0;i < n;i++) using namespace std; static const int N = 100; static const int INFTY = (1 << 21); int n, M[N][N]; int d[N]; void bfs(int s) { queue<int> q; q.push(s); REP(i...
a.cc: In function 'void bfs(int)': a.cc:26:19: error: cannot convert 'std::queue<int>::empty' from type 'bool (std::queue<int>::)() const' to type 'bool' 26 | while (!q.empty) | ^~~~~ a.cc:26:19: error: in argument to unary ! 26 | while (!q.empty) | ~~...
s633310885
p02239
C++
4 1 2 2 4 2 1 4 3 0 4 1 3 1 0 2 1 3 2 4 1 Program ended with exit code: 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 4 | ^
s474480892
p02239
C++
#include <iostream> #include <queue> using namespace std; static const int N = 100; static const int INFTY = (1 << 21); int n, M[N][N]; intd d[N]; void bfs(int s) { queue<int> q; q.push(s); for (int i = 0; i< n; i++) { d[i] = INFTY; } d[s] = 0; int u; while (!q.empty()) { u = q.front(); q.p...
a.cc:9:1: error: 'intd' does not name a type; did you mean 'int'? 9 | intd d[N]; | ^~~~ | int a.cc: In function 'void bfs(int)': a.cc:15:5: error: 'd' was not declared in this scope 15 | d[i] = INFTY; | ^ a.cc:17:3: error: 'd' was not declared in this scope 17 | d[s] = 0; | ...
s377975779
p02239
C++
#include<iostream> #include<queue> using namespace std; int n, M[100][100], d[100]; void bfs (int s) { int i, u, v; queue<int> Q; Q.push(s); for (i = 0; i < n; i++) { d[i] = (1 << 21); } d[s] = 0; while (!q.empty()) { u = Q.front(); Q.pop(); for (v = 0; v...
a.cc: In function 'void bfs(int)': a.cc:18:13: error: 'q' was not declared in this scope 18 | while (!q.empty()) { | ^
s690998468
p02239
C++
#include<iostream> #include<queue> using namespace std; int n, M[100][100], d[100]; void bfs (int s) { int i, u, v; queue<int> Q; Q.push(s); for (i = 0; i < n; i++) { d[i] = (1 << 21); } d[s] = 0; while (!Q.empty()) { u = Q.front(); Q.pop(); for (v = 0; v...
a.cc: In function 'void bfs(int)': a.cc:29:13: error: 'q' was not declared in this scope 29 | q.push(v); | ^
s730351027
p02239
C++
#include <iostream> #include <queue> using namespace std; static const int N = 100; static const int INFTY = (1 << 21); int n, M[N][N]; intd d[N]; void bfs(int s) { queue<int> q; q.push(s); for (int i = 0; i< n; i++) { d[i] = INFTY; } d[s] = 0; int u; while (!q.empty()) { u = q.front(); q.p...
a.cc:9:1: error: 'intd' does not name a type; did you mean 'int'? 9 | intd d[N]; | ^~~~ | int a.cc: In function 'void bfs(int)': a.cc:15:5: error: 'd' was not declared in this scope 15 | d[i] = INFTY; | ^ a.cc:17:3: error: 'd' was not declared in this scope 17 | d[s] = 0; | ...
s168714656
p02239
C++
#include <iostream> #include <queue> using namespace std; int main(){ int n, u, k, v; int D[100]; bool adj[100][100] = {}; cin >> n; for (int i = 0; i < n; i++){ cin >> u >> k; for (int j = 0; j < k; j++){ cin >> v; adj[u-1][v-1] = true; } } for (int i = 0; i < n; i++){ D[i] = -1; } queue<int> ...
a.cc: In function 'int main()': a.cc:24:9: error: 'e' was not declared in this scope 24 | e[0] = 1; | ^
s644006598
p02239
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s230903344
p02239
C++
#include <iostream> #include <string> #include <vector> #include <set> #include <cstdio> #include <cstdlib> #include <algorithm> #include <functional> #include <map> #include <cmath> #include <queue> using namespace std; static const int N = 100; int main() { int graph[N][N] = {0}; int distance[N] = {INT_MI...
a.cc: In function 'int main()': a.cc:20:24: error: 'INT_MIN' was not declared in this scope 20 | int distance[N] = {INT_MIN}; | ^~~~~~~ a.cc:12:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 11 | #include <queue> +++ ...
s416157694
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; // 距離で訪問状態(color)を管理する void bfs(int s) { queue<int> q; // 標準ライブラリの queue を使用 q.push(s); for ( int i = 0; i < n; i++ ) d[i] = INFTY; d[s] = 0; int u; while ( !q....
a.cc: In function 'void bfs(int)': a.cc:18:27: error: expected ';' before 'for' 18 | u = q.front(); q.pop() | ^ | ; 19 | for ( int v = 0; v < n; v++ ) { | ~~~ a.cc:19:22: error: 'v' was not declared in this scope...
s301363221
p02239
C++
#include <stdio.h> #include <stdint.h> #include <iostream> #include <fstream> #include <cassert> #include <climits> #include <vector> #include <queue> using namespace std; #define DEBUG (1) #if DEBUG #define DPRINTF(...) do { \ printf("D(L%d) %s: ", __LINE__, __func__); \ printf(__VA_ARGS__); \ } while (fa...
a.cc:35:3: error: 'unique_ptr' does not name a type 35 | unique_ptr<int[]> adjIds_; | ^~~~~~~~~~ a.cc: In member function 'void Vertex::set(int, std::vector<int>)': a.cc:51:3: error: 'adjIds_' was not declared in this scope 51 | adjIds_ = unique_ptr<int[]>(new int[adjNum_]); | ^~~~~~~ a.cc:51:...
s317265087
p02239
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s062632853
p02239
C++
import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int size = sc.nextInt(); AdjListGraph g = new AdjListGraph(size, true); for (int i = 0; i < size; i++){ int v = sc.nextInt()-1; int d = sc.nextInt(...
a.cc:35:9: error: stray '@' in program 35 | @SuppressWarnings("unchecked") | ^ a.cc:1:1: error: 'import' does not name a type 1 | import java.util.LinkedList; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type ...
s299017442
p02239
C++
#include<bits/stdc++.h> using namespace std; #define MK make_pair typedef pair<int,int> pi; int main(){ const int MX=1e9+7; int a[1000][1000]; fill(&a[0][0],&a[999][1000],MX); for(int i=0;i<1000;i++){ a[i][i]=0; } int n; cin>>n; for(int i=0;i<n;i++){ int w; cin>>w; int m; cin>>m; ...
a.cc: In function 'int main()': a.cc:35:37: error: invalid types 'int [1000][1000][int [1000][1000]]' for array subscript 35 | cout<<i<<" "<<(a[1][i]==MX? -1:a[a][i])<<endl; | ^
s588256350
p02239
C++
zc#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0;i<(n);i++) #define REAP(i,a,n) for(int i=(a);i<(n);i++) #define YES cout<<"Yes"<<endl #define NO cout<<"No"<<endl #define fr first #define sc second #define pb push_back #define All(v) v.begin(),v.end() typedef long long ll; int table[101][1...
a.cc:1:3: error: stray '#' in program 1 | zc#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'zc' does not name a type; did you mean 'sc'? 1 | zc#include <bits/stdc++.h> | ^~ | sc a.cc: In function 'int main()': a.cc:26:5: error: 'ios' has not been declared 26 | ios::sync_with_stdio(fals...
s006428189
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void bfs(int s) queue<int> q; q.push(s); for (int i = 0; i < n; i++) { d[i] = INFTY; } d[s] = 0; int u; while (!p.empty()) { u = q.front(); q.pop(); ...
a.cc:13:3: error: expected initializer before 'queue' 13 | queue<int> q; | ^~~~~ a.cc:15:3: error: 'q' does not name a type 15 | q.push(s); | ^ a.cc:16:3: error: expected unqualified-id before 'for' 16 | for (int i = 0; i < n; i++) { | ^~~ a.cc:16:19: error: 'i' does not name a ty...
s987891633
p02239
C++
#include<iostream> #include<queue> using namespace std; static const int N = 100; static const int INFTY = (1<<21); int n, M[N][N]; int d[N]; void bfs(int s) { queue<int> q; q.push(s); for (int i = 0; i < n; i++) { d[i] = INFTY; } d[s] = 0; int u; while (!p.empty()) { u = q.front(); q.pop();...
a.cc: In function 'void bfs(int)': a.cc:21:11: error: 'p' was not declared in this scope 21 | while (!p.empty()) { | ^
s296443186
p02239
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define pb push_back #define rep(i, n) for(int i = 0; i < (n); i++) #define FOR(i, a, n) for(int i = a; i < (n); i++) #define mod (ll)(1e9+7) #define int ll static const int N = 100; static const int no = -1; __attribute__((...
a.cc: In function 'void bfs(ll)': a.cc:33:26: error: expected ';' before 'continue' 33 | if(graph[u][i] == 0 continue; | ^~~~~~~~~ | ; a.cc:34:7: error: expected primary-expression before 'if' 34 | if(d[i] != no) continue; | ^~ ...
s120190841
p02239
C++
#include <iostream> #include <string> #include <map> #include <queue> #include <algorithm> using namespace std; #define MAX 100000 static const int N =100; static const int INFTY =(1<<21); void bfs(int s){ queue<int> q; q.push(s); for(int i=0;i<n;i++) d[i]=INFTY; d[s]=0; int u; while(!q.empty()){ u=q....
a.cc: In function 'void bfs(int)': a.cc:15:17: error: 'n' was not declared in this scope 15 | for(int i=0;i<n;i++) d[i]=INFTY; | ^ a.cc:15:24: error: 'd' was not declared in this scope 15 | for(int i=0;i<n;i++) d[i]=INFTY; | ^ a.cc:16:3: error: 'd' was not de...