submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s067101136
p02238
C
#include <stdio.h> int n,M[100][100],color[100],d[100],f[100],time; void dfs_visit(int u){ int v; color[u]=1; d[u]=++time; for(v=0;v<n;v++){ if(M[u][v]==0){ continue; } if(color[v]==0){ dfs_visit(v); } } color[u]=2; f[u]=++time; } void dfs(){ int u; for(u=0;u<n;u++){ ...
main.c: In function 'dfs': main.c:25:3: error: 't' undeclared (first use in this function) 25 | t=0; | ^ main.c:25:3: note: each undeclared identifier is reported only once for each function it appears in
s707349167
p02238
C
#include <stdio.h> int A[101][101]; int ans[101][3]; int an = 1; int serch(int a[][], int ni, int n){ int j; for(j=0; j<n; j++){ if(A[ni][j] == 1){ judge(j, 1); serch(A, j, n); } } judge(ni, 2); } int judge(int i, int j){ ans[i][j] = an; an++; } int main(){ int i, j, k, n, x,...
main.c:7:15: error: array type has incomplete element type 'int[]' 7 | int serch(int a[][], int ni, int n){ | ^ main.c:7:15: note: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first main.c: In function 'serch': main.c:12:7: error: implicit declarat...
s451894305
p02238
C
#include<stdio.h> int color[100],d[100],f[100],time,stack[100],point=0; int a[100][100]; void push(int d) { stack[point]=d; if(color[d]==0){ color[d]=1; d[d]=++time; } point++; } void pop(){ point--; } void search(int n) { int i,u; u = 1; for(i=0;i<n;i++) color[i]=0; push(u); for(i=0;i<n;i...
main.c: In function 'push': main.c:9:6: error: subscripted value is neither array nor pointer nor vector 9 | d[d]=++time; | ^ main.c: In function 'search': main.c:23:12: error: expected ';' before 'int' 23 | a[u][i] | ^ | ; ...... 27 | int main() { | ...
s911399210
p02238
C
#include<stdio.h> ?? int color[101], n, d[101], f[101], v[101][101], time; ?? void visit(int u){ int i; color[u] = 1; d[u] = ++time; for(i=1;i<=n;i++){ if(color[i] == 0&&v[u][i]==1)visit(i); } color[u]=2; f[u] = ++time; } ?? void dfs(){ int i; for(i=1;i<=n;i++){ color[i]=0; } time=0; ...
main.c:2:1: error: expected identifier or '(' before '?' token 2 | ?? | ^ main.c:4:1: error: expected identifier or '(' before '?' token 4 | ?? | ^ main.c:18:1: error: expected identifier or '(' before '?' token 18 | ?? | ^ main.c: In function 'main': main.c:36:15: error: 'n' undeclared (fi...
s199517381
p02238
C
#include<stdio.h> int color[101], n, d[101], f[101], v[101][101], time; void visit(int u){ int i; color[u] = 1; d[u] = ++time; for(i=1;i<=n;i++){ if(color[i] == 0&&v[u][i]==1)visit(i); } color[u]=2; f[u] = ++time; } void dfs(){ int i; for(i=1;i<=n;i++){ color[i]=0; } time=0; f...
main.c: In function 'dfs': main.c:29:1: error: expected expression before '?' token 29 | ????} | ^
s507588517
p02238
C
#include<stdio.h> #define N 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n, M[N][N]; int color[N], d[N], f[N], tt; // 再帰関数による深さ優先探索 void dfs_visit(int u) { int v; color[u] = GRAY; d[u] = ++t; // 最初の訪問 for ( v = 0; v < n; v++ ) { if ( M[u][v] == 0) continue; if ( color[v] == WHITE ) df...
main.c: In function 'dfs_visit': main.c:14:12: error: 't' undeclared (first use in this function) 14 | d[u] = ++t; // 最初の訪問 | ^ main.c:14:12: note: each undeclared identifier is reported only once for each function it appears in
s260450959
p02238
C
#include<stdio.h> #define N 100 #define GRAY 1 #define BLACK 2 using namespace std; int n,M[N][N]; int color[N],d[N],f[N],tt; void dfs_visit(int u) { int v; color[u] = GRAY; d[u] = ++tt; for(v = 0;v<n;v++) { if(M[u][v] == 0) continue; if(color[v] == 0) { dfs_visit(v); } } color[u] ...
main.c:5:1: error: unknown type name 'using' 5 | using namespace std; | ^~~~~ main.c:5:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std' 5 | using namespace std; | ^~~
s892783924
p02238
C
#16D8101014F KurumeRyunosuke 2018/6/20 n=int(input()) ls=[[0 for i in range(n)]for j in range(n)] for i in range(n): tmp=input().split() for j in range(int(tmp[1])): ls[i][int(tmp[j+2])-1]=1 """ for i in range(n): for j in range(n): if(j!=n-1): print(int(ls[i][j]), end=' ') else: ...
main.c:1:2: error: "16D8101014F" after # is not a positive integer 1 | #16D8101014F KurumeRyunosuke 2018/6/20 | ^~~~~~~~~~~ main.c:3:1: warning: data definition has no type or storage class 3 | n=int(input()) | ^ main.c:3:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main....
s100881200
p02238
C
#16D8101014F KurumeRyunosuke 2018/6/20 n=int(input()) ls=[[0 for i in range(n)]for j in range(n)] for i in range(n): tmp=input().split() for j in range(int(tmp[1])): ls[i][int(tmp[j+2])-1]=1 """ for i in range(n): for j in range(n): if(j!=n-1): print(int(ls[i][j]), end=' ') else: ...
main.c:1:2: error: "16D8101014F" after # is not a positive integer 1 | #16D8101014F KurumeRyunosuke 2018/6/20 | ^~~~~~~~~~~ main.c:3:1: warning: data definition has no type or storage class 3 | n=int(input()) | ^ main.c:3:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main....
s895720189
p02238
C
#16D8101014F KurumeRyunosuke 2018/6/20 n=int(input()) ls=[[0 for i in range(n)]for j in range(n)] for i in range(n): tmp=input().split() for j in range(int(tmp[1])): ls[i][int(tmp[j+2])-1]=1 """ for i in range(n): for j in range(n): if(j!=n-1): print(int(ls[i][j]), end=' ') else: ...
main.c:1:2: error: "16D8101014F" after # is not a positive integer 1 | #16D8101014F KurumeRyunosuke 2018/6/20 | ^~~~~~~~~~~ main.c:3:1: warning: data definition has no type or storage class 3 | n=int(input()) | ^ main.c:3:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main....
s007145548
p02238
C
#include <sstream> #include <string> #include <vector> #include <map> #include <algorithm> #include <iostream> #include <utility> #include <set> #include <cctype> #include <queue> #include <stack> #include <cstdio> #include <cstdlib> #include <cmath> using namespace std; #define MAXN 100 int n, timecount = 1; int ans[...
main.c:1:10: fatal error: sstream: No such file or directory 1 | #include <sstream> | ^~~~~~~~~ compilation terminated.
s264137196
p02238
C++
def dfs(n): global t S[n] = t DP[n]=1 for i in A[n][2:]: if not DP[i]: t += 1 dfs(i) t += 1 F[n] = t n = int(input()) A = [0]*(n+1) S = [0]*(n+1) F = [0]*(n+1) DP = [0]*(n+1) for i in range(n): A[i+1] = [int(i) for i in input().split()] t = 0 for i in range(1,...
a.cc:1:1: error: 'def' does not name a type 1 | def dfs(n): | ^~~
s021200397
p02238
C++
#include <iostream> using namespace std; int n; int M[100][100]; int color[100], d[100], f[100]; int time; void Dfs(int u) { color[u] = 1; d[u] = ++time; for (int v = 0; v < n; v++) if (M[u][v] && color[v] == 0) Dfs(v); color[u] = 2; f[u] = ++time; } int main() { cin >> n; for (int i = 0; i < n; i++) ...
a.cc:7:5: error: 'int time' redeclared as different kind of entity 7 | int time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s878666244
p02238
C++
#include <iostream> using namespace std; int n; int M[100][100]; int color[100], d[100], f[100]; int time = 1; void Dfs(int u) { color[u] = 1; d[u] = time; time++; for (int v = 0; v < n; v++) if (M[u][v] && color[v] == 0) Dfs(v); color[u] = 2; f[u] = time; time++; } int main() { cin >> n; for (int...
a.cc:7:5: error: 'int time' redeclared as different kind of entity 7 | int time = 1; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s353725300
p02238
C++
#include <cstdio> #include <cstring> #include <stack> #define N 110 using namespace std; int n; int m[N][N]; int used[N]; int time = 1; int _start[N]; int _end[N]; int getnext(int u){ for(int i = 1; i <= n; i++){ if(m[u][i] == 1) return i; } return -1; } void dfs(int root){ used[root] = 1; _...
/usr/bin/ld: /tmp/ccHp1BkY.o:(.bss+0xbf00): multiple definition of `_start'; /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o:(.text+0x0): first defined here collect2: error: ld returned 1 exit status
s277800507
p02238
C++
6 1 2 2 3 2 2 3 4 3 1 5 4 1 6 5 1 6 6 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 6 | ^
s733457662
p02238
C++
#include<iostream> using namespace std; struct vertex { int id; int discover; int finish; bool flag; }; static int time = 1; void DFS(int **arr, int n, int u , vertex *ver) { ver[u - 1].flag = 1; ver[u - 1].discover = time; time++; for (int i = 0; i < n; i++) { if (u - 1 == i) continue; if (arr[u - 1...
a.cc:12:12: error: 'int time' redeclared as different kind of entity 12 | static int time = 1; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gt...
s095838553
p02238
C++
#include<bits/stdc++.h> using namespace std; #define ll long long vector<vector<int>> graph; vector<int> d,f; int tm =0; void dfs(int v){ if(d[v]!=0) return; tm++; d[v]=tm; for(int i=0;i<graph[v].size();i++){ dfs(graph[v][i]); } tm++; f[v] = tm; } int main(){ ...
a.cc: In function 'void dfs(int)': a.cc:11:7: error: reference to 'tm' is ambiguous 11 | tm++; | ^~ In file included from /usr/include/time.h:39, from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from...
s072041665
p02238
C++
#include <iostream> using namespace std; int a[100][100]; int n,p,q,r; int T[100],F[100]; int Time = 0; void dfs(int cur) { T[cur] = Time; Time += 1; for (int dst=0; dst < n; ++dst) { if(a[cur][dst] == 1 && T[dst] == -1) { dfs(dst); } } F[cur] = Time; Time += 1; } int main() { cin >> n; for (int i=0; i...
a.cc: In function 'int main()': a.cc:34:48: error: expected ';' before '}' token 34 | cout << n << " " << T[n-1]+1 << " " << F[n-1]+1 | ^ | ; 35 | } | ~
s379624976
p02238
C++
#include <iostream> using namespace std; int time = 0; int d[101]; int f[101]; int num; int graph[101][101] = {0}; void dfs(int x){ time++; d[x] = time; for(int i=1;i<=num;i++){ if(graph[x][i] == 1 && d[i]==0){ printf("%d -> %d\n",x,i); dfs(i); } } f[x] = ++time; } int main(){ int hon; int ed...
a.cc:5:13: error: 'int time' redeclared as different kind of entity 5 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/g...
s970714832
p02238
C++
#include <iostream> #include <string> #include <stdio.h> using namespace std; int d[100]; int f[100]; int map[100][100]; int time=0; int n; void visit(int); int main(){ int i,j,k,u,v; for(i=0;i<100;i++) d[i]=-1; for(i=0;i<100;i++) f[i]=-1; cin >> n; for(i=0;i<n;i++){ for(j=0;j<n;j++){ map[i][j]=0; } } f...
a.cc:9:5: error: 'int time' redeclared as different kind of entity 9 | int time=0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s983699610
p02238
C++
#include <iostream> #include <string> #include <stdio.h> using namespace std; int d[100]; int f[100]; int map[100][100]; int time; int n; void visit(int); int main(){ time=0; int i,j,k,u,v; for(i=0;i<100;i++) d[i]=-1; for(i=0;i<100;i++) f[i]=-1; cin >> n; for(i=0;i<n;i++){ for(j=0;j<n;j++){ map[i][j]=0; ...
a.cc:9:5: error: 'int time' redeclared as different kind of entity 9 | int time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s478702249
p02238
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 dfs(int)': a.cc:52:18: error: reference to 'tm' is ambiguous 52 | d[k] = ++tm; | ^~ In file included from /usr/include/time.h:39, from /usr/include/c++/14/ctime:42, from a.cc:8: /usr/include/x86_64-linux-gnu/bits/types/struct_tm...
s224220559
p02238
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 dfs(int)': a.cc:52:18: error: reference to 'tm' is ambiguous 52 | d[k] = ++tm; | ^~ In file included from /usr/include/time.h:39, from /usr/include/c++/14/ctime:42, from a.cc:8: /usr/include/x86_64-linux-gnu/bits/types/struct_tm...
s569315287
p02238
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 dfs(int)': a.cc:52:18: error: reference to 'tm' is ambiguous 52 | d[k] = ++tm; | ^~ In file included from /usr/include/time.h:39, from /usr/include/c++/14/ctime:42, from a.cc:8: /usr/include/x86_64-linux-gnu/bits/types/struct_tm...
s805279038
p02238
C++
#include <cstdio> #include <iostream> #include <stack> #define MAX_VERTEXES 100 #define ZERO 0 #define NIL -1 using namespace std; //think easy make easy int n;//num of vertexes(頂点) int matrix_graph[MAX_VERTEXES+1+1][MAX_VERTEXES+1+1];//1オリジン stack<int> stk; bool discovered[MAX_VERTEXES+1+1];//1オリジン int discovered_...
a.cc: In function 'void DFS(int)': a.cc:25:17: error: 'else' without a previous 'if' 25 | else if(matrix_graph[v][i] == 1 && !discovered[i]){ | ^~~~
s700319242
p02238
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int time = 0; void dfs(int cur, vector<vector <int> > &list, vector<int> &d, vector<int> &f) { d[cur] =time; time +=1; for(int i = 0; i < list.size();i++){ vector<int>::iterator it = list[cur].end(); vector<int>::iterator...
a.cc:6:5: error: 'int time' redeclared as different kind of entity 6 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s322395884
p02238
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int time = 0; void dfs(int cur, vector<vector <int> > &list, vector<int> &d, vector<int> &f) { d[cur] =time; time +=1; for(int i = 0; i < list.size();i++){ vector<int>::iterator it = list[cur].end(); vector<int>::iterator...
a.cc:6:5: error: 'int time' redeclared as different kind of entity 6 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s492085916
p02238
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int time = 0; void dfs(int cur, vector<vector <int> > &list, vector<int> &d, vector<int> &f) { d[cur] =time; time +=1; for(int i = 0; i < list.size();i++){ vector<int>::iterator it = list[cur].end(); vector<int>::iterator...
a.cc:6:5: error: 'int time' redeclared as different kind of entity 6 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s808048159
p02238
C++
#include<iostream> #include<stack> #include<vector> #include<string> struct node { int num; std::vector<int> child; }; int recurcive(node nodes[],int d[100], int f[100], int n, int count) { d[n] = count++; for (size_t i = 0; i < nodes[n].child.size(); i++) { if (d[nodes[n].child[i]] == 0) { count = recurcive...
a.cc: In function 'int recurcive(node*, int*, int*, int, int)': a.cc:17:55: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 17 | nodes[n].child.erase(std::find(nodes[n].chi...
s437872830
p02238
C++
#include <iostream> #include <queue> using namespace std; int G[100][100]; int In[100]; int Out[100]; void init() { for (int i = 0; i < 100; i++) { for(int j = 0; j < 100; j++) G[i][j] = 0; In[i] = -1; Out[i] = -1; } } void dfs(int src); int main() { init(); int n; cin >> n; for (int i = 0; i < n; i...
a.cc:38:5: error: 'int time' redeclared as different kind of entity 38 | int time = 1; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s431101171
p02238
C++
#include <iostream> #include <unordered_map> #include <vector> using namespace std; int timecount = 0; void dfs(int cur, int u, bool* visited, int* timearray, int* timearray_end, unordered_map<int, vector<int> > mymap); int main(){ int u, i, id, k, j; cin >> u; unordered_map<int, vector<int> > mymap; for ...
a.cc: In function 'void dfs(int, int, bool*, int*, int*, std::unordered_map<int, std::vector<int> >)': a.cc:57:23: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 57 | if((i!=cur)&&(find(mymap[cur].begin(), mymap[cur].end(), i) != mymap[cur].end())&&(!...
s966435210
p02238
C++
#include <iostream> #include <unordered_map> #include <vector> using namespace std; int timecount = 0; void dfs(int cur, int u, bool* visited, int* timearray, int* timearray_end, unordered_map<int, vector<int> > mymap); int main(){ int u, i, id, k, j; cin >> u; unordered_map<int, vector<int> > mymap; for ...
a.cc: In function 'void dfs(int, int, bool*, int*, int*, std::unordered_map<int, std::vector<int> >)': a.cc:57:23: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 57 | if((i!=cur)&&(find(mymap[cur].begin(), mymap[cur].end(), i) != mymap[cur].end())&&(!...
s605038353
p02238
C++
#include <iostream> #include <unordered_map> #include <vector> using namespace std; int timecount = 0; void dfs(int cur, int u, bool* visited, int* timearray, int* timearray_end, unordered_map<int, vector<int> > mymap); int main(){ int u, i, id, k, j; cin >> u; unordered_map<int, vector<int> > mymap; for ...
a.cc: In function 'void dfs(int, int, bool*, int*, int*, std::unordered_map<int, std::vector<int> >)': a.cc:57:23: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 57 | if((i!=cur)&&(find(mymap[cur].begin(), mymap[cur].end(), i) != mymap[cur].end())&&(!...
s989336003
p02238
C++
#include <iostream> #include <unordered_map> #include <vector> using namespace std; int timecount = 0; void dfs(int cur, int u, bool* visited, int* timearray, int* timearray_end, unordered_map<int, vector<int> > mymap); int main(){ int u, i, id, k, j; cin >> u; unordered_map<int, vector<int> > mymap; for ...
a.cc: In function 'void dfs(int, int, bool*, int*, int*, std::unordered_map<int, std::vector<int> >)': a.cc:57:23: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 57 | if((i!=cur)&&(find(mymap[cur].begin(), mymap[cur].end(), i) != mymap[cur].end())&&(!...
s430152926
p02238
C++
#include<iostream> #include<stack> using namespace std; stack<int> S; int n, x[10000][10000], a, b, c, d, time=2; int y[10000][3]; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> b >> c; for (int j = 1; j <= c; j++) { cin >> d; x[i][d] = 1; } } S.push(1); y[1][1] = 1; while (!S.empty())...
a.cc:6:37: error: 'int time' redeclared as different kind of entity 6 | int n, x[10000][10000], a, b, c, d, time=2; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, fr...
s079704129
p02238
C++
n = int(raw_input()) d = [0 for i in range(n)] f = [0 for i in range(n)] a = [[0 for i in range(n)] for j in range(n)] st = [0 for i in range(n)] time = [0] G = [0 for i in range(n)] def dfs_visit(s): st[s] = 1 time[0] += 1 d[s] = time[0] for k in range(n): if a[s][k] == 1 and st[k] ...
a.cc:28:14: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes 28 | print'{0} {1} {2}'.format(s+1, d[s], f[s]) | ^~~~~~~~~~~~~ a.cc:1:1: error: 'n' does not name a type 1 | n = int(raw_input()) | ^
s922092719
p02238
C++
class Node(object): def __init__(self, V): self.V = V self.find_time = 0 self.finish_time = 0 self.is_finded = False n = int(input()) nodes = [0] * 101 for i in range(n): data = input().split() V = list(map(int, data[2:])) V.sort(reverse = True) nodes[int(data[0])...
a.cc:22:6: error: invalid preprocessing directive #print 22 | #print(find_q) | ^~~~~ a.cc:42:13: error: stray '#' in program 42 | else: #node is finded | ^ a.cc:1:19: error: expected initializer before ':' token 1 | class Node(object): | ^
s157377959
p02238
C++
#include<iostream> #include<algorithm> using namespace std; struct VRTX { int dt, ft, v[101]; }; int time = 1; VRTX ver[101]; void depthFirstSearch(int u); int main() { int i, j, n, u, k; cin >> n; for (i = 0; i < n; i++) { cin >> u >> k; for (j = 0; j < k; j++) { cin >> ver[u].v[j]; } } depthFirst...
a.cc:9:5: error: 'int time' redeclared as different kind of entity 9 | int time = 1; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s938195668
p02238
C++
/** * @brief 深さ優先探索のテスト * @date 作成日 : 2016/02/15 * @date 最終更新日 : 2016/02/15 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <iterator> #include <functional> #include <utility> #include <algorithm> #include <vector> #include <iostream> ...
a.cc:25:23: error: 'int32_t' in namespace 'std' does not name a type 25 | using weight_t = std::int32_t; | ^~~~~~~ a.cc:26:23: error: 'int32_t' in namespace 'std' does not name a type 26 | using index_t = std::int32_t; | ^~~~~~~ a.cc:34:6: warning: elaborat...
s347281547
p02238
C++
def dfs(v, cnt): D[v] = cnt cnt += 1 for c in edge[v]: if D[c] == -1: cnt = dfs(c, cnt) F[v] = cnt cnt += 1 return cnt V = int(input()) edge = [[] for _ in range(V)] for _ in range(V): u, _, *v = map(lambda x: int(x)-1, input().split()) edge[u] = sorted(v) D, F = [-...
a.cc:1:1: error: 'def' does not name a type 1 | def dfs(v, cnt): | ^~~
s758549470
p02238
C++
/** * @brief 深さ優先探索のテスト * @date 作成日 : 2016/02/15 * @date 最終更新日 : 2016/02/15 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <iterator> #include <functional> #include <utility> #include <algorithm> #include <vector> #include <stack> #inc...
a.cc:99:25: error: 'int32_t' in namespace 'std' does not name a type 99 | using weight_t = std::int32_t; /**< 辺(u, v)への重みwを表す型 */ | ^~~~~~~ a.cc:100:25: error: 'int32_t' in namespace 'std' does not name a type 100 | using index_t = std::int32_t; /**< 頂点vの添字を表す型 */ |...
s569645376
p02238
C++
c/** * @brief 深さ優先探索のテスト * @date 作成日 : 2016/02/15 * @date 最終更新日 : 2016/02/15 */ //**************************************** // 必要なヘッダファイルのインクルード //**************************************** #include <iterator> #include <functional> #include <utility> #include <algorithm> #include <vector> #include <stack> #in...
a.cc:1:1: error: 'c' does not name a type 1 | c/** | ^ In file included from /usr/include/c++/14/bits/stl_iterator_base_types.h:67, from /usr/include/c++/14/iterator:61, from a.cc:12: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | temp...
s299202401
p02238
C++
#include <iostream> #include <cstdio> #include <vector> #include <stack> #include <string> #include <queue> using namespace std; int d[101]; int f[101]; bool isUsed[101]; int time = 0; void DFS(vector< vector<int> >& G, int vertex) { d[vertex] = ++time; for (int i = 0; i < G[vertex].size(); ++i) { if (G[vertex]...
a.cc:13:5: error: 'int time' redeclared as different kind of entity 13 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s493705504
p02238
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 'void rec(int)': a.cc:32:28: error: 'g' was not declared in this scope 32 | for(int i = 0; i < g[i].size(); i++) { | ^ a.cc:33:28: error: 'j' was not declared in this scope 33 | if(!d[g[i][j]][0]) { | ^
s157673009
p02238
C++
#include <vector> #include <iostream> using namespace std; int n, u, k, v, t, d[100][2]; vector<int> g[100]; void rec(int pos) { for(int i = 0; i < g[i].size(); i++) { if(!d[g[i][j]][0]) { d[g[i][j]][0] = ++t; rec(g[i][j]); d[g[i][j]][1] = ++t; } } } int main() { cin >> n; for(int i = 0; i < n; i++) { ...
a.cc: In function 'void rec(int)': a.cc:7:28: error: 'j' was not declared in this scope 7 | if(!d[g[i][j]][0]) { | ^
s216056128
p02238
C++
#include <iostream> #include <stack> using namespace std; const int N = 100; const int WHITE = 0; const int GRAY = 1; const int BLACK = 2; int n,M[N][N]; int color[N],d[N],f[N],tt; int nt[N]; // u?????£??\??????v????????????????????? int next(int u){ for (int v = nt[u]; v < n ; v++) { nt[u] = v +1; ...
a.cc: In function 'void dfs_visit(int)': a.cc:36:28: error: 'white' was not declared in this scope; did you mean 'fwrite'? 36 | if(color[v] == white) { | ^~~~~ | fwrite a.cc: In function 'void dfs()': a.cc:52:20: error: 'white' was not dec...
s239604649
p02238
C++
#include <iostream> #include <vector> #include <numeric> const int MAXINT = std::numeric_limits<int>::max(); // typedef std::vector<std::vector<int> > mat_int; // typedef std::vector<std::vector<bool> > mat_bool; void dfs(std::vector<std::vector<int> >& adj_list, std::vector<int>& d, std::vector<int>& f, int& time, ...
a.cc:5:25: error: 'numeric_limits' is not a member of 'std' 5 | const int MAXINT = std::numeric_limits<int>::max(); | ^~~~~~~~~~~~~~ a.cc:5:40: error: expected primary-expression before 'int' 5 | const int MAXINT = std::numeric_limits<int>::max(); | ...
s748224633
p02238
C++
#include <conio.h> #include <cstdio> #include <stack> using namespace std; #define start first #define end second static const int NOT = false; static const int WHITE = 1; static const int GRAY = 2; static const int BLACK = 3; static const int N = 101; int n; int VisitedInfo[N]; bool Graph[N][N]; pair< int, ...
a.cc:1:10: fatal error: conio.h: No such file or directory 1 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s724500729
p02238
C++
/* * ALDS1_11B.cpp */ #include <iostream> #include <vector> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; int N; int ad_k[101]; int ad_list[101][101]; int time = 0; int d[101], f[101]; bool visited[101]; void visit(int id) { if (visited[id]) return; visited[id] = t...
a.cc:16:5: error: 'int time' redeclared as different kind of entity 16 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s121330163
p02238
C++
/* * ALDS1_11B.cpp */ #include <iostream> #include <vector> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; int N; int ad_k[101]; int ad_list[101][101]; int time = 0; int d[101], f[101]; bool visited[101]; void visit(int id) { if (visited[id]) return; visited[id] = t...
a.cc:16:5: error: 'int time' redeclared as different kind of entity 16 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s334087183
p02238
C++
#include <cstdio> #include <iostream> #include <vector> using namespace std; static const int DFS_VISIT_NO = 0; static const int DFS_VISIT_NOW = 1; static const int DFS_VISIT_DONE = 2; static int g_time = 0; static int g_setime[100][2] = {0}; void DfsVisit(vector<int> &graph, int node, vector<int> &state) { i...
a.cc: In function 'void DfsVisit(std::vector<int>&, int, std::vector<int>&)': a.cc:24:24: error: request for member 'size' in '(& graph)->std::vector<int>::operator[](((std::vector<int>::size_type)node))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} 24 | ...
s499846350
p02238
C++
#include "bits/stdc++.h" #include <unordered_set> #define _CRT_SECURE_NO_WARNINGS #define REP(i, n) for(decltype(n) i = 0; i < (n); i++) #define REP2(i, x, n) for(decltype(x) i = (x); i < (n); i++) #define REP3(i, x, n) for(decltype(x) i = (x); i <= (n); i++) #define RREP(i, n) for (decltype(n) i = (n) - 1; i >= 0; i...
a.cc: In function 'void dfs(int)': a.cc:42:18: error: reference to 'tm' is ambiguous 42 | D[u] = ++tm; | ^~ In file included from /usr/include/time.h:39, from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, ...
s850538987
p02238
C++
#include<iostream> #include<vector> #include<queue> #include"print_vec.h" using namespace std; vector<vector<int>> adjacent; vector<pair<int, int>> ans; vector<bool>checked; //?????????is???????????? int dfs(int now,int time = 1) { cout << now << endl; ans[now].first = time; checked[now] = true; for (int i = 0; ...
a.cc:4:9: fatal error: print_vec.h: No such file or directory 4 | #include"print_vec.h" | ^~~~~~~~~~~~~ compilation terminated.
s658296516
p02238
C++
#include <stdio.h> #define N 100 #define WHITE 0; #define GRAY 1; #define BRACK 2; int n, M[N][N]; int color[N], d[N], f[N], tt; void dfs_visit(int u){ int v; color[u] = GRAY; d[u] = ++tt; for( v = 0; v < n; v++ ){ if ( M[u][v] == 0 ) { continue; } if ( color[v] == WHITE ){ dfs_visit(v); } ...
a.cc: In function 'void dfs_visit(int)': a.cc:16:28: error: expected primary-expression before ')' token 16 | if ( color[v] == WHITE ){ | ^ a.cc: In function 'void dfs()': a.cc:31:27: error: expected primary-expression before ')' token 31 | if (color[u] == WHITE ) { dfs_vi...
s265821738
p02238
C++
#include<bits/stdc++.h> using namespace std; void solve(int); typedef struct{ int k; vector<int> ls; int f,d; }node_t; node_t node[101]; int t=0; int main(){ int n; int u; cin >> n; for(int i=0; i<n; i++){ cin >> u; cin >> node[u].k; node[u].ls.resize(node[u].k); node[u].d = node[u]...
/usr/bin/ld: /tmp/ccRuXsXC.o: in function `main': a.cc:(.text+0x220): undefined reference to `solve(int)' collect2: error: ld returned 1 exit status
s317297278
p02238
C++
#if 0 #endif #include <iostream> #include <vector> using namespace std; int n; int t; //mytime?????????????????§???????´? int mytime1[110],mytime2[110]; //?????§?????? int G[110][110]; int c[110]; void dfs(int cur){ t+=1; mytime1[cur]=t; c[cur]=1; for(int dst=0; dst<n; ++dst){ if(G[cur][dst]==1&&c[dst]==0){ ...
a.cc:45:9: error: expected unqualified-id before 'for' 45 | for(int i=0;i<n;++i){ | ^~~ a.cc:45:21: error: 'i' does not name a type 45 | for(int i=0;i<n;++i){ | ^ a.cc:45:25: error: expected unqualified-id before '++' token 45 | for(int i=0;i<n;++...
s619076377
p02238
C++
#include <iostream> #include <cstdio> #include <stack> using namespace std; stack<int> st; int v[102][101], n; int time[102][2]; int ct = 1; inline void search(int t) { if(!time[t][0]) time[t][0] = ct++; int tf = 0; for (int a = 1; a <= n; a++) { if (v[t][a]) { st.push(a); for (int i = 1; i <= n; i++) { ...
a.cc:7:17: error: 'int time [102][2]' redeclared as different kind of entity 7 | int time[102][2]; | ^ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14...
s422645802
p02238
C++
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <iostream> #include <cstdio> #include <stack> using namespace std; stack<int> st; int v[102][101], n; int time[102][2]; int ct = 1; inline void search(int t) { if(!time[t][0]) time[t][0] = ct++; int tf = 0; for (int a = 1; a <= n; a++) { if (v[t]...
a.cc:9:17: error: 'int time [102][2]' redeclared as different kind of entity 9 | int time[102][2]; | ^ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14...
s367706650
p02238
C++
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <iostream> #include <cstdio> #include <stack> using namespace std; stack<int> st; int v[102][101], n; int time[102][2]; int ct = 1; inline void search(int t) { if(!time[t][0]) time[t][0] = ct++; int tf = 0; for (int a = 1; a <= n; a++) { if (v[t]...
a.cc:9:17: error: 'int time [102][2]' redeclared as different kind of entity 9 | int time[102][2]; | ^ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14...
s343055779
p02238
C++
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <iostream> #include <cstdio> #include <stack> using namespace std; stack<int> st; int v[102][101], n; int tim[102][2]; int ct = 1; int go[102]; inline void search(int t) { if(!tim[t][0]) tim[t][0] = ct++; go[t] = 1; int tf = 0; for (int a = 1; a <...
a.cc: In function 'int main()': a.cc:61:2: error: expected '}' at end of input 61 | } | ^ a.cc:33:12: note: to match this '{' 33 | int main() { | ^
s694684553
p02238
C++
#include <iostream> #include <vector> #include <vector> #include <algorithm> #include <stack> using namespace std; static const int N = 100; int n, m[N][N]; int time, begT[N], endT[N]; bool visited[N]; int nxt(int u) { for (int v = 0; v < n; ++v) { if (m[u][v] > 0 && !visited[v]) return v; } return -1; } void...
a.cc:11:5: error: 'int time' redeclared as different kind of entity 11 | int time, begT[N], endT[N]; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gth...
s466161517
p02238
C++
#include<iostream> #include<string> using namespace std; void dfs_init(); void dfs(int u); int n,*d,*f,time; string *color; bool **M; int main(){ cin>>n; color = new string[n]; M = new bool*[n]; for(int i=0;i<n;i++) M[i] = new bool[n]; d = new int[n]; f = new int[n]; for(int i=0;i<n;i++){ for(int j=0;j<n;j++...
a.cc:8:13: error: 'int time' redeclared as different kind of entity 8 | int n,*d,*f,time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr....
s646734001
p02238
C++
#include<iostream> #include<string> #include<stack> using namespace std; void dfs_init(); void dfs(int u); int n,**List,*deg,*d,*f; bool **M; string *color; stack<int> S; int vertex,time; int main(){ cin>>n; List = new int*[n]; M = new bool*[n]; deg = new int[n]; color = new string[n]; d = new int[n]; f = new int[...
a.cc:13:12: error: 'int time' redeclared as different kind of entity 13 | int vertex,time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h...
s017485388
p02238
C++
#include<iostream> #include<string> #include<stack> using namespace std; void dfs_init(); void dfs(int u); int n,**List,*deg,*d,*f; bool **M; string *color; stack<int> S; int vertex,time; int main(){ cin>>n; List = new int*[n]; M = new bool*[n]; deg = new int[n]; color = new string[n]; d = new int[n]; f = new int[...
a.cc:13:12: error: 'int time' redeclared as different kind of entity 13 | int vertex,time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h...
s107552783
p02238
C++
#include<iostream> #include<cstdlib> #include<string> using namespace std; void dfs_init(); void dfs(int u); int n,**List,*deg,*d,*f; bool **M; string *color; int vertex,time; int main(){ cin>>n; List = new int*[n]; M = new bool*[n]; deg = new int[n]; color = new string[n]; d = new int[n]; f = new int[n]; for(int...
a.cc:12:12: error: 'int time' redeclared as different kind of entity 12 | int vertex,time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h...
s661258218
p02238
C++
#include<iostream> #include<cstdlib> #include<string> using namespace std; void dfs_init(); void dfs(int u); int n,**List,*deg,*d,*f; bool **M; string *color; int vertex; int time; int main(){ cin>>n; List = new int*[n]; M = new bool*[n]; deg = new int[n]; color = new string[n]; d = new int[n]; f = new int[n]; fo...
a.cc:13:5: error: 'int time' redeclared as different kind of entity 13 | int time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s179448915
p02238
C++
#include <iostream> #include <string> #include <vector> #include <stack> using namespace std; const int max_v = 100; vector<vector<int>> adj_list; int d[max_v] = { 0 }; int f[max_v] = { 0 }; int discovered[max_v] = { 0 }; int time = 1; // Depth-first Search ( Stack implementation) void DFS(int v) { stack<int> S; S...
a.cc:13:5: error: 'int time' redeclared as different kind of entity 13 | int time = 1; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s849100820
p02238
C++
#include <iostream> #include <stack> using namespace std; static const int N=100; static const int WHITE=0; static const int GRAY=1; static const int BLACK=2; int n,M[n][n]; int color[N],d[N],f[N],tt; int nt[N]; //????????????????????????u?????????v int next(int u){ for(int v=nt[u];v<n;v++){ nt[u]=v+1; ...
a.cc:9:12: error: size of array 'M' is not an integral constant-expression 9 | int n,M[n][n]; | ^ a.cc:9:9: error: size of array 'M' is not an integral constant-expression 9 | int n,M[n][n]; | ^
s343446966
p02238
C++
#include <iostream> #include <stack> using namespace std; static const int N=100; static const int WHITE=0; static const int GRAY=1; static const int BLACK=2; //??¶????????° int n; //?????\?????? int M[N][N]; //??°?????¶???????¢???? int color[N]; //??\??¶????????°??¶??? int d[N]; //??\??¶???????????¶??? int f[N]; //??...
a.cc: In function 'void dfs()': a.cc:66:12: error: 'u' was not declared in this scope 66 | nt[u]=v+1,color[i]=WHITE; | ^ a.cc:66:15: error: 'v' was not declared in this scope 66 | nt[u]=v+1,color[i]=WHITE; | ^
s605803229
p02238
C++
#include<iostream> #define FOR(i,a,b) for (int i=(a);i<(b);i++) using namespace std; int G[100][100] = {}; int time = 0; typedef struct ANS { int id, t, e; bool done; }; void rec(ANS a[],int t) { ::time++; a[t].t = ::time; a[t].done = true; FOR(i, 0, 100) { if (G[t][i] == 1 && a[i].done == false) { rec(a...
a.cc:5:5: error: 'int time' redeclared as different kind of entity 5 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s224371156
p02238
C++
#include<iostream> #define FOR(i,a,b) for (int i=(a);i<(b);i++) using namespace std; int G[100][100] = {}; int time = 0; typedef struct ANS { int id, t, e; bool done; }; void rec(ANS a[],int t) { ::time++; a[t].t = ::time; a[t].done = true; FOR(i, 0, 100) { if (G[t][i] == 1 && a[i].done == false) { rec(a...
a.cc:5:5: error: 'int time' redeclared as different kind of entity 5 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s824503474
p02238
C++
#include<iostream> #define FOR(i,a,b) for (int i=(a);i<(b);i++) using namespace std; int G[100][100] = {}; int time = 0; typedef struct ANS { int id, t, e; bool done; }; void rec(ANS a[],int t) { ::time++; a[t].t = ::time; a[t].done = true; FOR(i, 0, 100) { if (G[t][i] == 1 && a[i].done == false) { rec(a...
a.cc:5:5: error: 'int time' redeclared as different kind of entity 5 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s689203980
p02238
C++
#include<iostream> #define FOR(i,a,b) for (int i=(a);i<(b);i++) using namespace std; int G[100][100] = {}; int time = 0; typedef struct ANS { int id, t, e; bool done; }; void rec(ANS a[],int t) { time++; a[t].t = time; a[t].done = true; FOR(i, 0, 100) { if (G[t][i] == 1 && a[i].done == false) { rec(a, i)...
a.cc:5:5: error: 'int time' redeclared as different kind of entity 5 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s185520515
p02238
C++
#include <iostream> #include <vector> using namespace std; int n; vector<vector<int> > A; vector<vector<int> > T; int time = 0; void dfs(int cur){ // cur????¨???? // cur ????¨??????????????¨???? time += 1; T[cur][0] = time; // ???????¢??????¨??¨??? cerr << "visiting " << cur << " " << time << endl...
a.cc:8:5: error: 'int time' redeclared as different kind of entity 8 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s560190060
p02238
C++
#include<stdio.h> #define N 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n, M[N][N]; int color[N], d[N], f[N], tt; void dfs_visit(int u) { int v; color[u] = GRAY; d[u] = ++tt; for(v = 0; v < n; v++) { if(M[u][v] == 0) continue; if(color[v] == WHITE) { dfs_visit(v); } } color[u] = BLACK; f...
a.cc: In function 'int main()': a.cc:39:20: error: expected initializer before 'j' 39 | int u, k, v, i j; | ^
s173462282
p02238
C++
#include<iostream> #include<stack> using namespace std; static const int N = 100; static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, tt; int M[N][N], color[N], d[N], f[N], nt[N]; int next(int u){ for(int v = nt[u]; v < n; v++) { nt[u] = v + 1; if(M[u][v] = 1) return v; } ...
a.cc: In function 'int main()': a.cc:74:2: error: expected '}' at end of input 74 | } | ^ a.cc:58:12: note: to match this '{' 58 | int main() { | ^
s179619535
p02238
C++
#include <iostream> #include <vector> #include <string> using namespace std; int n; vector<vector<int>> g; int time = 0; vector<int> d, f; void dfs(int node){ time++; if(d[node] == 0){ d[node] = time; } for(auto next : g[node]){ if(d[next] == 0){ dfs(next); } ...
a.cc:9:5: error: 'int time' redeclared as different kind of entity 9 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s459362435
p02238
C++
#include <iostream> #include <vector> #include <string> using namespace std; int n; vector<vector<int>> g; int time = 0; vector<int> d, f; void dfs(int node){ time++; if(d[node] == 0){ d[node] = time; } for(auto next : g[node]){ if(d[next] == 0){ dfs(next); } ...
a.cc:9:5: error: 'int time' redeclared as different kind of entity 9 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s313649710
p02238
C++
#include <iostream> #include <vector> #include <string> using namespace std; int n; vector<vector<int>> g; int time = 0; vector<int> d, f; void dfs(int node){ time++; if(d[node] == 0){ d[node] = time; } for(auto next : g[node]){ if(d[next] == 0){ dfs(next); } ...
a.cc:9:5: error: 'int time' redeclared as different kind of entity 9 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s653526860
p02238
C++
#include <iostream> #include <vector> #include <string> using namespace std; int n; vector<vector<int>> g; int time = 0; vector<int> d, f; void dfs(int node){ time++; if(d[node] == 0){ d[node] = time; } for(auto next : g[node]){ if(d[next] == 0){ dfs(next); } ...
a.cc:9:5: error: 'int time' redeclared as different kind of entity 9 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s386098189
p02238
C++
#include <iostream> #include <vector> #include <string> using namespace std; int n; vector<vector<int>> g; int time = 0; vector<int> d, f; void dfs(int node){ time++; if(d[node] == 0){ d[node] = time; } for(auto next : g[node]){ if(d[next] == 0){ dfs(next); } ...
a.cc:9:5: error: 'int time' redeclared as different kind of entity 9 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s653367771
p02238
C++
#include <iostream> #include <string> using namespace std; int n; vector<vector<int>> g; int time = 0; int timeT = 0; vector<int> d, f; void dfs(int node){ timeT++; if(d[node] == 0){ d[node] = timeT; } for(auto next : g[node]){ if(d[next] == 0){ dfs(next); } ...
a.cc:7:1: error: 'vector' does not name a type 7 | vector<vector<int>> g; | ^~~~~~ a.cc:8:5: error: 'int time' redeclared as different kind of entity 8 | int time = 0; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-def...
s262781346
p02238
C++
#include<iostream> #include<stack> using namespace int N = 100; static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[N][N]; int color[N], d[N], f[N], tt; int[N]; int next() { for (int v = nt[u]; v < n; v++) { nt[u] = v + 1; if (M[u][v]) = return v; } return -1 } void dfs...
a.cc:3:17: error: expected identifier before 'int' 3 | using namespace int N = 100; | ^~~ a.cc:3:16: error: expected ';' before 'int' 3 | using namespace int N = 100; | ^~~~ | ; a.cc:8:13: error: size of array 'M' is not an integral constant-expres...
s633032303
p02238
C++
#include<stdio.h> int d[100],f[100],n,g[100][100],time=1; int func(int n){ d[n]=time++; int i,j; for(i=0;i<n;i++){ if(gn][i]==1 && d[i]==0){ func(i); } } f[n]=time++; } int main(void){ int i, j, u, k, v; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %...
a.cc: In function 'int func(int)': a.cc:9:12: error: 'gn' was not declared in this scope; did you mean 'n'? 9 | if(gn][i]==1 && d[i]==0){ | ^~ | n a.cc:9:14: error: expected ')' before ']' token 9 | if(gn][i]==1 && d[i]==0){ | ~ ^ | ...
s557006058
p02238
C++
#include<stdio.h> #define MAX 100 #define WHITE -1 #define GRAY 0 #define BLACK 1 int n,t; int color[MAX],d[MAX],f[MAX],Adj[MAX][MAX]; dfs(){ int i; for(i=0;i<n;i++) color[i]=WHITE; t=0; for(i=0;i<n;i++){ if(color[i]==WHITE) visit(i); } } visit(int r){ int i; color[r]=GRAY; d[r]=++t; ...
a.cc:11:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive] 11 | dfs(){ | ^~~ a.cc: In function 'int dfs()': a.cc:17:25: error: 'visit' was not declared in this scope 17 | if(color[i]==WHITE) visit(i); | ^~~~~ a.cc:19:1: warning: no return statement i...
s563183131
p02238
C++
#include<stdio.h> #define MAX 101 #define WHITE -1 #define GRAY 0 #define BLACK 1 int n,t; int color[MAX],d[MAX],f[MAX],Adj[MAX][MAX]; dfs(){ int i; for(i=0;i<n;i++) color[i]=WHITE; t=0; for(i=0;i<n;i++){ if(color[i]==WHITE) visit(i); } } visit(int r){ int i; color[r]=GRAY; d[r]=++t; ...
a.cc:11:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive] 11 | dfs(){ | ^~~ a.cc: In function 'int dfs()': a.cc:17:25: error: 'visit' was not declared in this scope 17 | if(color[i]==WHITE) visit(i); | ^~~~~ a.cc:19:1: warning: no return statement i...
s892187397
p02238
C++
#include<stdio.h> #define MAX 100 #define WHITE -1 #define GRAY 0 #define BLACK 1 int n,t; int color[MAX],d[MAX],f[MAX],Adj[MAX][MAX]; dfs(){ int i; for(i=0;i<n;i++) color[i]=WHITE; t=0; for(i=0;i<n;i++){ if(color[i]==WHITE) visit(i); } } visit(int r){ int i; color[r]=GRAY; d[r]=++t; ...
a.cc:11:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive] 11 | dfs(){ | ^~~ a.cc: In function 'int dfs()': a.cc:17:25: error: 'visit' was not declared in this scope 17 | if(color[i]==WHITE) visit(i); | ^~~~~ a.cc:19:1: warning: no return statement i...
s421770664
p02238
C++
#include<stdio.h> #include<stdlib.h> #define WHITE 10000 #define BLACK 10001 #define GRAY 10002 #define TRUE 1 #define FALSE 0 #define NUL NULL void dfs(void); void visit(int); void push(int); void pop(void); int isEmpty(void); int v[101][101],s[101],time1,n; int *d,*f,*color; int top = 0; int main(){ int u,i...
a.cc: In function 'int main()': a.cc:26:13: error: invalid conversion from 'void*' to 'int*' [-fpermissive] 26 | d = malloc(sizeof(int) * (n + 1)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ | | | void* a.cc:27:13: error: invalid conversion from 'void*' to 'int*' [-fpermissive]...
s678658956
p02238
C++
def main(): n = input() A = [] s = [] B = [[0,0] for i in xrange(n)] for i in xrange(n): A.append(map(int,raw_input().split())) color = [-1]*n d = [0]*n f = [0]*n dfs(0,0,color,d,f,A,n) for i in xrange(n): print i+1, d[i], f[i] def dfs(u,t,color,d,f,A,n):...
a.cc:31:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 31 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:1:1: error: 'def' does not name a type 1 | def main(): | ^~~
s867992121
p02238
C++
N = input() color = [0] * N d = [0] * N f = [0] * N nt = [0] * N m = [[0] * N for i in range(N)] S = [] tt = 0 def next(u): global nt w = nt[u] print "w = ",nt[u] for v in range(w, N): nt[u] = v + 1 if( m[u][v] ): return v return -1 def dfs_visit(r): nt = [0] * N ...
a.cc:53:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 53 | if __name__ == '__main__': | ^~~~~~~~~~ a.cc:1:1: error: 'N' does not name a type 1 | N = input() | ^
s552894124
p02238
C++
#include <bits/stdc++.h> #define REP0(i,n) for(int i=0;i<n;i++) #define N 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 using namespace std; int n,M[N][N]; int color[N],D[N],F[N],tt; int nt[N]; int next(int u){ for(int v=nt[u];v<n;v++){ nt[u]=v+1; if(M[u][v]) return v; } return -1; } void DFS_visit(i...
a.cc: In function 'void DFS_visit(int)': a.cc:22:12: error: 'gray' was not declared in this scope 22 | color[r]=gray; | ^~~~ a.cc:31:15: error: no matching function for call to 'std::stack<int>::push()' 31 | S.push(); | ~~~~~~^~ In file included from /usr/include/c++/14/st...
s713355979
p02238
C++
#include<cstdio> #include<cstdlib> #include<cmath> #include<cstring> #include<iostream> #include<algorithm> #include<queue> #include<map> #include<set> #include<vector> #include<stack> #include<list> typedef long long ll; using namespace std; int a[110][110]; int d[110]; int f[110]; int vis[110]; int n; int time; v...
a.cc:23:5: error: 'int time' redeclared as different kind of entity 23 | int time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s309125437
p02238
C++
#include <iostream> #include <cmath> #include <vector> #include <string> #include <map> #include <algorithm> #include <tuple> #include <set> #include <stack> #include <queue> #include <functional> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi...
a.cc:59:5: error: 'int time' redeclared as different kind of entity 59 | int time = 1; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s107548744
p02238
C++
#include <iostream> #include <cmath> #include <vector> #include <string> #include <map> #include <algorithm> #include <tuple> #include <set> #include <stack> #include <queue> #include <functional> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi...
a.cc:59:5: error: 'int time' redeclared as different kind of entity 59 | int time = 1; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s594989085
p02238
C++
#include <iostream> #include <cmath> #include <vector> #include <string> #include <map> #include <algorithm> #include <tuple> #include <set> #include <stack> #include <queue> #include <functional> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>; using vvi = vector<vi...
a.cc:59:5: error: 'int time' redeclared as different kind of entity 59 | int time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157, ...
s884618638
p02238
C++
#include "stdafx.h" #include <iostream> #include <cmath> #include <vector> #include <string> #include <map> #include <algorithm> #include <tuple> #include <set> #include <stack> #include <queue> #include <functional> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<int>; u...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s192399589
p02238
C++
#include<iostream> #include<stack> using namespace std; int n, M[100][100], d[100], f[100], color[100], time, nt[100], W = 0, G = 1, B = 2; int next (int u) { int v; for (v = nt[u]; v < n; v++) { nt[u] = v + 1; if (M[u][v] != 0) { return v; } } return -1; } voi...
a.cc:6:50: error: 'int time' redeclared as different kind of entity 6 | int n, M[100][100], d[100], f[100], color[100], time, nt[100], W = 0, G = 1, B = 2; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-...
s415792035
p02238
C++
#include<iostream> #include<stack> using namespace std; int n, M[100][100], d[100], f[100], color[100], time, nt[100], W = 0, G = 1, B = 2; int next (int u) { int v; for (v = nt[u]; v < n; v++) { nt[u] = v + 1; if (M[u][v] != 0) { return v; } } return -1; } voi...
a.cc:6:50: error: 'int time' redeclared as different kind of entity 6 | int n, M[100][100], d[100], f[100], color[100], time, nt[100], W = 0, G = 1, B = 2; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-...
s928022319
p02238
C++
#include<iostream> #include<stack> using namespace std; int n, M[100][100], d[100], f[100], color[100], tt, nt[100], W = 0, G = 1, B = 2; int next (int u) { int v; for (v = nt[u]; v < n; v++) { nt[u] = v + 1; if (M[u][v] != 0) { return v; } } return -1; } void ...
a.cc: In function 'void dfs()': a.cc:60:10: error: assignment of function 'time_t time(time_t*)' 60 | time = 0; | ~~~~~^~~