submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s177230360 | p02238 | Java | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
#define REP(i,e) FOR(i,0,e)
#define all(o) (o).begin(), (o).end()
#define psb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
typedef long long ll;
typedef pair<int, int> PII;
const double EPS = 1e-10;
typedef stru... | Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
^
Main.java:5: error: illegal character: '#'
#define FOR(i,s,e) for((i)=(s);(i)<(int)(e);(i)++)
^
Main.java:5: error: class, interface, enum, or record e... |
s578766443 | p02238 | Java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class ALDS1_11_B_DepthFirstSearch {
static int[] first;
static int [] end;
static List[] arLs;
static int dfs(int cur,int ts) {
first[cur] = first[cur]==0 ? ts : first[cur];
int now = ts+1;
for(int i=0;i<arLs[cur].size();i... | Main.java:6: error: class ALDS1_11_B_DepthFirstSearch is public, should be declared in a file named ALDS1_11_B_DepthFirstSearch.java
public class ALDS1_11_B_DepthFirstSearch {
^
1 error
|
s082581404 | p02238 | Java | import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scr = new Scanner(System.in);
int dotcount =Integer.parseInt(scr.nextLine());
dots = new int[dotcount][];
for(int i=0; i<dotcount; i++){
String[] str = scr.nextLine().split(" ", 0);
dots[i] = new int[Integer.p... | Main.java:51: error: class, interface, enum, or record expected
}package week05;
^
Main.java:53: error: class, interface, enum, or record expected
import java.util.Scanner;
^
2 errors
|
s152748699 | p02238 | Java |
import java.util.Scanner;
public class UsingRecursive {
private static final int N = 100;
private static Scanner scanner = new Scanner(System.in);
private static int[][] Mat = new int[N][N];
private static int[] Start = new int[N];
private static int[] Finish = new int[N];
private static int... | Main.java:4: error: class UsingRecursive is public, should be declared in a file named UsingRecursive.java
public class UsingRecursive {
^
1 error
|
s073052825 | p02238 | Java | import java.util.Scanner;
public class UsingRecursive {
private static final int N = 100;
private static Scanner scanner = new Scanner(System.in);
private static int[][] Mat = new int[N][N];
private static int[] Start = new int[N];
private static int[] Finish = new int[N];
private static int ... | Main.java:3: error: class UsingRecursive is public, should be declared in a file named UsingRecursive.java
public class UsingRecursive {
^
1 error
|
s257454964 | p02238 | Java | import java.io.*;
import java.util.*;
public class Main_ALDS1_11_B2 {
private static Scanner sc;
private static Printer pr;
private static void solve() {
int n = sc.nextInt();
List<Set<Integer>> edges = new ArrayList<>();
for (int i = 0; i < n; i++) {
edges.add(new TreeSet<>(Collections.reverseOrder())... | Main.java:5: error: class Main_ALDS1_11_B2 is public, should be declared in a file named Main_ALDS1_11_B2.java
public class Main_ALDS1_11_B2 {
^
1 error
|
s833569355 | p02238 | Java | import java.util.*;
public class Main {
static int time = 0;
public static void main(String[] args) throws IOException {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[][] v = new int[n + 1][n+1];
int[] d = new int[n + 1];
int[] f = new int[n... | Main.java:6: error: cannot find symbol
public static void main(String[] args) throws IOException {
^
symbol: class IOException
location: class Main
1 error
|
s532160456 | p02238 | Java | import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
public class BepthFirstSearch {
public static final int N = 100;
public static final int WHITE = 0;
public static final int GRAY = 1;
public static final int BLACK = 2;
static int n;
stat... | Main.java:7: error: class BepthFirstSearch is public, should be declared in a file named BepthFirstSearch.java
public class BepthFirstSearch {
^
1 error
|
s363152059 | p02238 | Java | import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) throws IOException {
// Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[][] mat = new int[n+1][n+1];
// 初回訪問リ... | Main.java:13: error: cannot find symbol
int n = sc.nextInt();
^
symbol: variable sc
location: class Main
Main.java:25: error: cannot find symbol
int u = sc.nextInt(); // ??
^
symbol: variable sc
location: class Main
Main.java:26: error: cannot find symbol
int k = sc.nextInt();... |
s678929248 | p02238 | Java | public class Main {
static int[][] graph;
static int time;
static int[] d, f;
static boolean[] visited;
static void visit(int node) {
if(!visited[node]) {
visited[node] = true;
d[node] = time++;
for(int i = 1; i < d.length; i++) {
if(... | Main.java:40: error: illegal character: '\u201d'
System.out.println(i + ? ? + d[i] + ? ? + f[i]);
^
Main.java:40: error: illegal character: '\u201d'
System.out.println(i + ? ? + d[i] + ? ? + f[i]);
^
Main.jav... |
s191267718 | p02238 | Java | import java.util.*;
public class Main {
public static void main(String...args) {
final Scanner sc = new Scanner(System.in);
final int n = sc.nextInt();
final int[][] matrix = new int[n][n];
for(int i = 0; i < n; i++) {
final int u = sc.nextInt();
final int k = sc.nextInt();
for(int j = 0; j < k; j++)
matrix[u-1][sc.nex... | Main.java:26: error: incompatible types: int cannot be converted to boolean
if(matrix[id][i]) deque.offerFirst(i);
^
1 error
|
s320114098 | p02238 | Java | import java.util.*;
public class Main {
public static void main(String...args) {
final Scanner sc = new Scanner(System.in);
final int n = sc.nextInt();
final boolean[][] matrix = new boolean[n][n];
for(int i = 0; i < n; i++) {
final int u = sc.nextInt();
final int k = sc.nextInt();
for(int j = 0; j < k; j++)
matrix[u-1... | Main.java:28: error: cannot assign a value to final variable visited
visited = true;
^
Main.java:28: error: incompatible types: boolean cannot be converted to boolean[]
visited = true;
^
2 errors
|
s475723951 | p02238 | Java | import java.util.Scanner;
public class Ex3_2 {
public static void main(String args[]){
Scanner stdin = new Scanner(System.in);
int count=1;
int[] fs,es,before;
int[][] next;
int n=stdin.nextInt();
fs=new int[n+1];es=new int[n+1];before=new int[n+1];
next=new int[n+1][];
IntStack stack=new I... | Main.java:2: error: class Ex3_2 is public, should be declared in a file named Ex3_2.java
public class Ex3_2 {
^
Main.java:52: error: cannot find symbol
public static void function(int id,int[] fs,int[] es,int[][] next,int count,IntStack stack){
... |
s408510634 | p02238 | Java | import java.util.Scanner;
import IntStack.EmptyIntStackException;
import IntStack.OverflowIntStackException;
public class Ex3_2 {
public class IntStack {
private int max;
private int ptr;
private int[] stk;
public class EmptyIntStackException extends RuntimeException{
public EmptyIntStackException(){ }
... | Main.java:5: error: class Ex3_2 is public, should be declared in a file named Ex3_2.java
public class Ex3_2 {
^
Main.java:3: error: package IntStack does not exist
import IntStack.EmptyIntStackException;
^
Main.java:4: error: package IntStack does not exist
import IntStack.OverflowIntStackExceptio... |
s768994177 | p02238 | Java | import java.util.Scanner;
public class Ex3_2 {
public class IntStack {
private int max;
private int ptr;
private int[] stk;
public class EmptyIntStackException extends RuntimeException{
public EmptyIntStackException(){ }
}
public class OverflowIntStackException extends RuntimeException{
public OverflowInt... | Main.java:170: error: reached end of file while parsing
}
^
1 error
|
s355839373 | p02238 | Java | import java.util.Scanner;
public class Ex3_2 {
public static class IntStack {
private int max;
private int ptr;
private int[] stk;
public class EmptyIntStackException extends RuntimeException{
public EmptyIntStackException(){ }
}
public class OverflowIntStackException extends RuntimeException{
public Ove... | Main.java:4: error: class Ex3_2 is public, should be declared in a file named Ex3_2.java
public class Ex3_2 {
^
1 error
|
s886506461 | p02238 | C | #include <stdio.h>
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define N 100
#define INF 10000000000
int n,M[N][N],Q[N];
int color[N],d[N],f[N],tt;
int num.head,tail;
void Enqueue;
int Empty();
int Dequeue();
void dfs_b(int u){
int i,j,v;
color[u]=GRAY;
d[u]= ++tt;
for(v=0; v<n; v++) ... | main.c:9:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
9 | int num.head,tail;
| ^
|
s650726459 | p02238 | 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
| |
s837914477 | 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... | main.c: In function 'dfs':
main.c:34:26: error: expected ')' before ';' token
34 | printf("%d%d%d\n",u+1;d[u],f[u]);
| ~ ^
| )
|
s069407258 | p02238 | 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
| |
s978929900 | p02238 | C | nclude <stdio.h>
int u[101] = {0};
int d[101] = {0};
int f[101] = {0};
int next[101][101] = {0};
int cost = 1;
int top = 0;
int s[101];
void push(int x) {
top++;
s[top] = x;
}
int pop() {
top--;
return s[top + 1];
}
int next_look(int r) {
int i = 0;
int rr;
for (i = 0; i < 101; i++) {
if ((nex... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | nclude <stdio.h>
| ^
main.c: In function 'main':
main.c:60:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
60 | scanf("%d", &n);
| ^~~~~
main.c:1:1: note: include '... |
s651851992 | p02238 | C | #include<stdio.h>
#define GRAY 2
#define N 101
int color[N],d[N],f[N],e[N],count,A[N][N],v[N],B[N][N];
void DFE=Visit(int);
void DFS(int);
main(){
int n,i,j,v1;
for(i=0;i<N;i++){ //行列を0で初期化
for(j=0;j<N;j++){
A[i][j]=0;
}
}
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d%d",&v[i],&e[i... | main.c:7:1: error: variable 'DFE' has initializer but incomplete type
7 | void DFE=Visit(int);
| ^~~~
main.c:7:10: error: implicit declaration of function 'Visit' [-Wimplicit-function-declaration]
7 | void DFE=Visit(int);
| ^~~~~
main.c:7:16: error: expected expression before 'int'
7 | ... |
s758902587 | p02238 | C | #include<stdio.h>
#define GRAY 2
#define N 101
int color[N],d[N],f[N],e[N],count,A[N][N],v[N],B[N][N];
void DFE_Visit(int);
void DFS(int);
main(){
int n,i,j,v1;
for(i=0;i<N;i++){ //行列を0で初期化
for(j=0;j<N;j++){
A[i][j]=0;
}
}
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d%d",&v[i],&e[i... | main.c:10:1: error: return type defaults to 'int' [-Wimplicit-int]
10 | main(){
| ^~~~
main.c: In function 'DFE_Visit':
main.c:64:10: error: 'time' undeclared (first use in this function)
64 | f[u]=++time; //再帰の特徴から、逆順に入る
| ^~~~
main.c:2:1: note: 'time' is defined in header '<time.h>'; this... |
s609724556 | p02238 | C | #include<stdio.h>
int V[150][150],d[150],f[150],color[150];
int time, n;
void DFSVisit(int u){
int v;
color[u] = 1;
time++;
d[u] = time;
for(v = 1; v <= n; v++){
if(V[u][v] == 1 && color[v] == 0){
DFSVisit(v);
}
}
color[u] = 2;
time++;
f[u] = time;
}
void DFS(){
int i;
time = 0... | main.c: In function 'DFS':
main.c:27:7: error: 'u' undeclared (first use in this function)
27 | for(u = 1; u <= n; u++){
| ^
main.c:27:7: note: each undeclared identifier is reported only once for each function it appears in
|
s737240551 | p02238 | C | #include<stdio.h>
#define M 150
int u[M][M],s[M],t,l=1,dps,flag[M];
int tim=-1,where[M];
int visit[M];
int end(int n){
int a=1,i;
for(i=1;i<=n;i++){
if(visit[i]==0){
visit[i]=1;
return i;
}
}
return 0;
}
void push(int a){
s[t++]=a;
visit[a]=1;
}
int pop(){
return s[t--];
}
i... | main.c: In function 'main':
main.c:55:9: error: subscripted value is neither array nor pointer nor vector
55 | ans[i][0]=tim;
| ^
|
s102623967 | p02238 | C | #include <stdio.h>
typedef struct ver{
int e[101];
int se;
int color;
} ver;
int n,u;
int time;
int a[101];
int b[101];
ver c[101];
void visit(int u){
int v,w;
c[u].color=1;
a[u] = ++time;
for(v=1;v<=g[u].se;v++){
w=c[u].e[v];
if(g[w].color == 0){
visit(w);
}
}
c[u].color... | main.c: In function 'visit':
main.c:22:14: error: 'g' undeclared (first use in this function)
22 | for(v=1;v<=g[u].se;v++){
| ^
main.c:22:14: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:61:1: error: 'xsxs' undeclared (... |
s881358874 | p02238 | C | #include <stdio.h>
typedef struct ver{
int e[101];
int se;
int color;
} ver;
int n,u;
int time;
int a[101];
int b[101];
ver c[101];
void visit(int u){
int v,w;
c[u].color=1;
a[u] = ++time;
for(v=1;v<=g[u].se;v++){
w=c[u].e[v];
if(c[w].color == 0){
visit(w);
}
}
c[u].color... | main.c: In function 'visit':
main.c:22:14: error: 'g' undeclared (first use in this function)
22 | for(v=1;v<=g[u].se;v++){
| ^
main.c:22:14: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:65:5: error: 'g' undeclared (fir... |
s087231011 | p02238 | C | #include <stdio.h>
#define N 101
#define WHITE -1
#define BLACK 1
#define GRAY 0
int color[N], n, G[N][N];
int d[N], f[N];
int time = 0;
void DFSvisit(int u){
int i;
color[u] = GRAY;
d[u] = ++time;
for(i = 1; i <= n; i++){
if(G[u][i] == 1){
if(color[i] == WHITE) DFSvisit(i);
}
}
color[u... | main.c: In function 'DFSvisit':
main.c:19:14: error: 'BRACK' undeclared (first use in this function); did you mean 'BLACK'?
19 | color[u] = BRACK;
| ^~~~~
| BLACK
main.c:19:14: note: each undeclared identifier is reported only once for each function it appears in
main.c: In fu... |
s969618088 | p02238 | C | #include<stdio.h>
return 0; | main.c:3:1: error: expected identifier or '(' before 'return'
3 | return 0;
| ^~~~~~
|
s702465664 | p02238 | C | #include<stdio.h>
#define MAX 101
#define WH 0
#define GR 1
#define BL 2
void DFSV(int);
void DFS(void);
int G[MAX][MA];
int D[MAX];
int F[MAX];
int color[MAX];
int n;
int time;
main(){
int i, j, a, b, v;
scanf("%d",&n);
for(i = 1; i <= n; i++){
for(j = 1; j <= n; j++){
G[i][j] = 0;
}
}
for(... | main.c:8:12: error: 'MA' undeclared here (not in a function); did you mean 'MAX'?
8 | int G[MAX][MA];
| ^~
| MAX
main.c:14:1: error: return type defaults to 'int' [-Wimplicit-int]
14 | main(){
| ^~~~
main.c: In function 'DFS':
main.c:57:16: error: 'WHITE' undeclared (first... |
s513978211 | p02238 | C | #include<stdio.h>
#define MAX 101
#define WH 0
#define GR 1
#define BL 2
void DFSV(int);
void DFS(void);
int G[MAX][MAX];
int D[MAX];
int F[MAX];
int color[MAX];
int n;
int time;
main(){
int i, j, a, b, v;
scanf("%d",&n);
for(i = 1; i <= n; i++){
for(j = 1; j <= n; j++){
G[i][j] = 0;
}
}
for... | main.c:14:1: error: return type defaults to 'int' [-Wimplicit-int]
14 | main(){
| ^~~~
main.c: In function 'DFS':
main.c:57:16: error: 'WHITE' undeclared (first use in this function)
57 | color[i] = WHITE;
| ^~~~~
main.c:57:16: note: each undeclared identifier is reported only once ... |
s352395657 | p02238 | C | #include <iostream>
#include <stdio.h>
using namespace std;
#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) {
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s976966072 | p02238 | C | #include <iostream>
#include <stdio.h>
using namespace std;
#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) {
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s211707551 | p02238 | C | stdrsv1122{s1210074}55: cat ex11b.c
#inclede<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK
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] == WH... | main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
1 | stdrsv1122{s1210074}55: cat ex11b.c
| ^
main.c:1:21: error: expected identifier or '(' before numeric constant
1 | stdrsv1122{s1210074}55: cat ex11b.c
| ^~
main.c:2:2: error: inval... |
s690138349 | p02238 | C | stdrsv1122{s1210074}55: cat ex11b.c
#inclede<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK
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] == WH... | main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
1 | stdrsv1122{s1210074}55: cat ex11b.c
| ^
main.c:1:21: error: expected identifier or '(' before numeric constant
1 | stdrsv1122{s1210074}55: cat ex11b.c
| ^~
main.c:2:2: error: inval... |
s780838972 | p02238 | C | #include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK
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);
}
}
... | main.c:8:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
8 | int color[N], d[N], f[N], tt;
| ^~~
main.c: In function 'dfs_visit':
main.c:13:3: error: 'color' undeclared (first use in this function)
13 | color[u] = GRAY;
| ^~~~~
main.c:13:3: note: each undeclared identi... |
s287037740 | p02238 | C | #include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK
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);
}
}
c... | main.c: In function 'dfs_visit':
main.c:23:19: error: expected expression before ';' token
23 | color[u] = BLACK;
| ^
|
s686291191 | p02238 | C | #include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK
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);
}
}
... | main.c: In function 'dfs_visit':
main.c:23:19: error: expected expression before ';' token
23 | color[u] = BLACK;
| ^
|
s794579233 | p02238 | C | #include<stdio.h>
void visit(int);
int map[101][101];
int f[101],d[101],color[101],time,n;
void visit(int u)
{
int i;
color[u]=1;
d[u]=++time;
for(i=0;i<n;i++){
if(map[u][i]==1){
if(color[i]==0)visit(i);
}
}
color[u]=2;
f[u]=++time;
}
int main()
{
int i,j,v,v2,m;
scanf("%d",&... | main.c: In function 'main':
main.c:38:19: error: 'vv' undeclared (first use in this function); did you mean 'v2'?
38 | scanf("%d",&vv);
| ^~
| v2
main.c:38:19: note: each undeclared identifier is reported only once for each function it appears in
|
s278661399 | p02238 | C | #define WHITE 0
#define BLACK 1
#define GRAY 2
int n;
int A[N][N],d[N],f[N],color[N],t=0;
void DFSvisit(int u){
int v;
color[u]=GRAY;
t++;
d[u] = t;
for(v=1;v<=n;v++){
if((A[u][v]==1)&&(color[v]==WHITE)) DFSvisit(v);
}
color[u] = BLACK;
f[u] = ++t;
}
int main(){
int i,j,u,v,k;
scanf("... | main.c:8:7: error: 'N' undeclared here (not in a function)
8 | int A[N][N],d[N],f[N],color[N],t=0;
| ^
main.c: In function 'main':
main.c:28:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
28 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include '<stdio.h>... |
s957083703 | p02238 | C | #include <stdio.h>
#define N 100
#define WHITE 0
#define GRSY 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] ... | main.c: In function 'dfs_visit':
main.c:13:14: error: 'Gray' undeclared (first use in this function)
13 | color[u] = Gray;
| ^~~~
main.c:13:14: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dft':
main.c:30:30: error: assignment to exp... |
s854505482 | p02238 | C | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include<stdio.h>
#define BLACK -1
#define GRAY -2
#define WHITE -3
void DFSvisit(int);
int G[100][100],d[100],f[100],color[100]... | main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 1
| ^
In file included from /usr/include/stdio.h:47,
from main.c:66:
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t'
28 | ... |
s263849796 | p02238 | C | #include<stdio.h>
#define WHITE 1
#define BLACK 0
#define GLAY 3
#define N 102
int g[N][N],d[N],f[N],color[N],k[N];
int time,u,v,n;
void DFSVisit(int u){
int i;
color[u] = GLAY;
d[u] = ++time;
for(i = 0;i < k[u];i++){
if(color[g[u][i]] == WHITE){
DFSVisit(g[u][i]);
}
}
color[u] = BL... | main.c: In function 'main':
main.c:47:3: error: expected declaration or statement at end of input
47 | }
| ^
|
s822470821 | p02238 | C | #include<stdio.h>
#define MAX 105
#define WHITE 0
#define GRAY 1
#define BLACK 2
void DFS(void);
void DFSVisit(int);
int G[MAX][MAX];
int d[MAX];
int f[MAX];
int color[MAX];
int n;
int t;
void DFSVisit(int u){
int v;
color[u] = GRAY;
d[u] = ++t;
for(v = 1; v <= n; v++){
if(G[u][v] == 1 ... | main.c: In function 'DFS':
main.c:37:5: error: 'time' undeclared (first use in this function)
37 | time = 0;
| ^~~~
main.c:2:1: note: 'time' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
1 | #include<stdio.h>
+++ |+#include <time.h>
2 | #define MAX 10... |
s842168546 | p02238 | C | #include<stdio.h>
#define MAX 105
#define WHITE 0
#define GRAY 1
#define BLACK 2
void DFS(void);
void DFSVisit(int);
int G[MAX][MAX];
int d[MAX];
int f[MAX];
int color[MAX];
int n;
int t;
void DFSVisit(int u){
int v;
color[u] = GRAY;
d[u] = ++t;
for(v = 1; v <= n; v++){
if(G[u][v] == 1 ... | main.c: In function 'DFS':
main.c:37:5: error: 'time' undeclared (first use in this function)
37 | time = 0;
| ^~~~
main.c:2:1: note: 'time' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
1 | #include<stdio.h>
+++ |+#include <time.h>
2 | #define MAX 10... |
s225864557 | p02238 | C | #include <iostream>
#include <queue>
using namespace std;
void dfs(int cur);
int df[100][2]={};
bool dc[100]={};
bool adj[100][100]={};//初期化を忘れない
int n,u,v,k;
int t = 1;
queue<int> q;
int main(){
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-... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s761831450 | p02238 | C | #include <iostream>
#include <queue>
using namespace std;
void dfs(int cur);
int df[100][2]={};
bool dc[100]={};
bool adj[100][100]={};//初期化を忘れない
int n,u,v,k;
int t = 1;
queue<int> q;
int main(){
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-... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s479635500 | p02238 | C | #include<stdio.h>
void Serch(int);
typedef struct{
int a,m,dis,fin,count,A[101];
} Graph;
int way = 1;
Graph B[101];
int main(void){
int n, m, i, j;
scanf("%d", &n);
for(i = 1; i <= n; i++){
scanf("%d%d", &B[i].a, &B[i].m);
B[i].count = B[i].dis = G[i].fin = 0;
for(j = 0; j < B[i].m; j++) s... | main.c: In function 'main':
main.c:17:29: error: 'G' undeclared (first use in this function)
17 | B[i].count = B[i].dis = G[i].fin = 0;
| ^
main.c:17:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:27: error: implicit declarat... |
s908277576 | p02238 | C | int n, time = 0;
int color[N], d[N], f[N], array[N][N];
void DFS(){
int i;
for(i = 1; i < n+1; i++){
color[i] = WHITE;
}
for(i = 1; i < n+1; i++){
if(color[i] == WHITE) DFSvisit(i);
}
}
void DFSvisit(int u){
int i;
color[u] = GRAY;
d[u] = ++time;
for(i = 1; i < n+1; i++){
if((color... | main.c:2:11: error: 'N' undeclared here (not in a function)
2 | int color[N], d[N], f[N], array[N][N];
| ^
main.c: In function 'DFS':
main.c:7:18: error: 'WHITE' undeclared (first use in this function)
7 | color[i] = WHITE;
| ^~~~~
main.c:7:18: note: each undeclared ... |
s741607647 | p02238 | C | #include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include "stdafx.h"
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#define MAX_INP (100)
#define MAX_DEG (100)
#define MAX_DATA (32*4)
//#define TEST
typedef struct {
int ... | main.c:8:10: fatal error: stdafx.h: No such file or directory
8 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s753413324 | p02238 | C | #include<stdio.h>
int G[101][102];
int found[101];
int comp[101]; // complete.
int t; // time.
typedef struct box{ int val; box* next; } box_t; // stack.
box_t* init()
{
box_t* head = new box_t;
head->val = -1;
head->next = NULL;
return head;
}
bool isEmpty(box_t* head){ return (head->next == NU... | main.c:8:30: error: unknown type name 'box'
8 | typedef struct box{ int val; box* next; } box_t; // stack.
| ^~~
main.c: In function 'init':
main.c:12:19: error: 'new' undeclared (first use in this function)
12 | box_t* head = new box_t;
| ^~~
main.... |
s196285319 | 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);
void dfs();
int main(){
int i,j,u,k,v;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
M[i][j]=0;
}
}
for(i=0;i<n;i++){
scanf("%d %d",&... | main.c: In function 'dfs_visit':
main.c:42:10: error: 't' undeclared (first use in this function)
42 | d[u]=++t;
| ^
main.c:42:10: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dfs':
main.c:70:1: error: expected declaration or statement a... |
s039266532 | p02238 | C | #include<stdio.h>
#define WHITE 0
#define GRAY 1
#define BLACK 2
void visit(int u){
int v;
c[u] = GRAY;
d[u] =++tt;
for(v=0;v<n;v++){
if(M[u][v]==0)continue;
if(c[v]==WHITE){
visit(v);
}
}
c[u]=BLACK;
f[u]=++tt;
}
int main(){
int M[200][200];
int n,u,k,v,i,j;
int c[200],d[200],f[1... | main.c: In function 'visit':
main.c:7:3: error: 'c' undeclared (first use in this function)
7 | c[u] = GRAY;
| ^
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:3: error: 'd' undeclared (first use in this function)
8 | d[u] =++tt;
| ... |
s202792130 | p02238 | C | #include<stdio.h>
#define 0
#define 1
#define 2
int n,u,k,v,i,j,tt,n;
int M[200][200],d[200],f[200],c[200];
void visit(int u){
int v;
c[u] = 1;
d[u] =++tt;
for(v=0;v<n;v++){
if(M[u][v]==0)continue;
if(c[v]==0){
visit(v);
}
}
c[u]=2;
f[u]=++tt;
}
int main(){
scanf("%d",&n);
for(i =... | main.c:2:9: error: macro names must be identifiers
2 | #define 0
| ^
main.c:3:9: error: macro names must be identifiers
3 | #define 1
| ^
main.c:4:9: error: macro names must be identifiers
4 | #define 2
| ^
|
s350737828 | p02238 | C | #include<stdio.h>
#define 0
#define 1
#define 2
int n,u,k,v,i,j,tt,n;
int M[200][200],d[200],f[200],c[200];
void visit(int u){
int v;
c[u] = 1;
d[u] =++tt;
for(v=0;v<n;v++){
if(M[u][v]==0)continue;
if(c[v]==0){
visit(v);
}
}
c[u]=2;
f[u]=++tt;
}
int main(){
scanf("%d",&n);
for(i =... | main.c:2:9: error: macro names must be identifiers
2 | #define 0
| ^
main.c:3:9: error: macro names must be identifiers
3 | #define 1
| ^
main.c:4:9: error: macro names must be identifiers
4 | #define 2
| ^
|
s937177010 | p02238 | C | #include<stdio.h>
#define N 101
typedef struct{
int u;
int k;
int v[N];
int color;
int d;
int f;
}Graph;
void dfs(void);
void visit(int);
void push(int);
int isFull(void);
int isEmpty(void);
int pop(void);
Graph G[N];
int n, time, S[N];
int top=0;
int main()
{
int u, k, i, j;
scanf("%d", &n);
f... | main.c: In function 'visit':
main.c:70:5: error: 'else' without a previous 'if'
70 | else v = G[G[u].v[1]].u;
| ^~~~
|
s169245855 | p02238 | C | #include<stdio.h>
void visit(int);
int G[101][101];
int d[101],f[101],color[101],time,n;
void visit(int v){
int i;
color[v]=1;
d[v]=++time;
for(i=0;i<n;i++){
if(G[v][i]==1){
if(color[i]==0) visit(i);
}
}
color[v]=2;
f[v]=++time;
}
int main(){
int i,j,v1,v2,m;
scanf("%d",&n);
for(i... | main.c: In function 'main':
main.c:38:9: error: 'v' undeclared (first use in this function)
38 | G[v-1][v2-1]=1;
| ^
main.c:38:9: note: each undeclared identifier is reported only once for each function it appears in
|
s451841387 | p02238 | C | int temp[101],d[101],f[101];
int time,N;
int A[101][101];
void DFS();
void DFSvisit(int u){
int v;
temp[u]=g;
time++;
d[u]=time;
for(v=1;v<=N;v++){
if(A[u][v]==0){
continue;
}
if(temp[v]==w){
DFSvisit(v);
}
}
temp[u] = b;
f[u] = ++time;
}
void DFS(){
int i;
for(... | main.c: In function 'DFSvisit':
main.c:10:11: error: 'g' undeclared (first use in this function)
10 | temp[u]=g;
| ^
main.c:10:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:17: error: 'w' undeclared (first use in this function)
18 | if(t... |
s145435146 | p02238 | C | int n,t;
int d[MAX],f[MAX],color[MAX];
int A[MAX][MAX];
int main(){
int i,j,u,v,k;
scanf("%d",&n);
for(i=1 ; i<=n ; i++){
for(j=1 ; j<=n ; j++){
A[i][j]=0;
}
}
for(i=0 ; i<n ; i++){
scanf("%d %d",&u,&k);
for(j=0 ; j<k ; j++){
scanf("%d",&v);
A[u][v]=1;
}
}
DFS();... | main.c:2:7: error: 'MAX' undeclared here (not in a function)
2 | int d[MAX],f[MAX],color[MAX];
| ^~~
main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
8 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' o... |
s619295757 | p02238 | C | #include<stdio.h>
#define N 100
#define WHITE 0
#define BLACK 1
#define GRAY 2
int n,time;
int d[N+1],f[N+1],G[N+1][N+1],C[N+1];
void Dfs(void){
int i;
for(i=1;i<=n;i++){
C[i]=WHITE;
}
time=0;
for(i=1;i<=n;i++){
if(C[i]==WHITE){
Dfsvisit(i);
}
}
}
void Dfsvisit(int u){
int v;
... | main.c: In function 'Dfs':
main.c:22:7: error: implicit declaration of function 'Dfsvisit' [-Wimplicit-function-declaration]
22 | Dfsvisit(i);
| ^~~~~~~~
main.c: At top level:
main.c:27:6: warning: conflicting types for 'Dfsvisit'; have 'void(int)'
27 | void Dfsvisit(int u){
| ^~~~~~~... |
s784703082 | p02238 | C | #include<stdio.h>
int d[100];
int f[100];
int n;
int graph[100][100]={0};
int time=1;
int dood(int node){
d[node]=time++;
int i,j;
for(i=0;i<n;i++){
if(graph[node][i]==1 && d[i]==0){
dfs(i);
}
}
f[node]=time++;
}
int main(void){
int u, k, v;
int i, j;
... | main.c: In function 'dood':
main.c:15:13: error: implicit declaration of function 'dfs' [-Wimplicit-function-declaration]
15 | dfs(i);
| ^~~
|
s763039670 | p02238 | C | include<stdio.h>
#define BLACK 2
#define WHITE 0
#define GRAY 1
#define N 101
int V[N][N];
int mark[N],d[N],f[N],n,count;
void dfs_visit(int u){
int v;
mark[u]=GRAY;
d[u]=++count;
for(v=1;v<=n;v++){
if(V[u][v]==0) continue;
if(mark[v]==WHITE){
dfs_visit(v);
}
}
mark[u]=BLACK;
f[u]==++c... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'dfs_visit':
main.c:15:8: error: 'V' undeclared (first use in this function)
15 | if(V[u][v]==0) continue;
| ^
main.c:15:8: note: each undeclared identif... |
s673518151 | p02238 | C | include<stdio.h>
#define BLACK 2
#define WHITE 0
#define GRAY 1
#define N 101
int V[N][N];
int mark[N],d[N],f[N],n,count;
void dfs_visit(int u){
int v;
mark[u]=GRAY;
d[u]=++count;
for(v=1;v<=n;v++){
if(V[u][v]==0) continue;
if(mark[v]==WHITE){
dfs_visit(v);
}
}
mark[u]=BLACK;
f[u]==++c... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'dfs_visit':
main.c:15:8: error: 'V' undeclared (first use in this function)
15 | if(V[u][v]==0) continue;
| ^
main.c:15:8: note: each undeclared identif... |
s731302822 | p02238 | C | include<stdio.h>
#define BLACK 2
#define WHITE 0
#define GRAY 1
#define N 101
int V[N][N];
int mark[N],d[N],f[N],n,count;
void dfs_visit(int u){
int v;
mark[u]=GRAY;
d[u]=++count;
for(v=1;v<=n;v++){
if(V[u][v]==0) continue;
if(mark[v]==WHITE){
dfs_visit(v);
}
}
mark[u]=BLACK;
f[u]==++c... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'dfs_visit':
main.c:15:8: error: 'V' undeclared (first use in this function)
15 | if(V[u][v]==0) continue;
| ^
main.c:15:8: note: each undeclared identif... |
s107481810 | p02238 | C | void dfs(Graph *f){
int u;
int color[N];
for(u=0; u<n; u++){
color[u] = WHITE;
}
time = 0;
for(u=0; u<n; u++){
if(color[u] == WHITE){
visit(u);
}
}
}
void visit(int x){
int v, u;
int color[N], d[N], f[N];
//push(u);
color[u] = GRAY;
d[u] = ++time;
for(v=0; v<n; v++){
... | main.c:1:10: error: unknown type name 'Graph'
1 | void dfs(Graph *f){
| ^~~~~
main.c: In function 'visit':
main.c:22:13: error: 'N' undeclared (first use in this function)
22 | int color[N], d[N], f[N];
| ^
main.c:22:13: note: each undeclared identifier is reported only once fo... |
s113641327 | p02238 | C | #include <stdio.h>
#define N 100
#define W 1
#define G 2
#define B 3
int n,d[N],f[N],time,S[N],G[N][N];
void DFS(void);
void DFSvisit(int);
int main(){
int i,j,u,v,k;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
G[i][j]=0;
}
}
for(i=0;i<n;i++){
scanf("%d %d",&u,&k);
for(j=... | main.c:4:11: error: expected identifier or '(' before numeric constant
4 | #define G 2
| ^
main.c:7:27: note: in expansion of macro 'G'
7 | int n,d[N],f[N],time,S[N],G[N][N];
| ^
main.c: In function 'main':
main.c:19:8: error: subscripted value is neither array no... |
s881147464 | p02238 | C | #include<stdio.h>
#define WHITE 1
#define BLACK 0
#define GLAY 3
#define N 102
int g[N][N],d[N],f[N],color[N],k[N];
int time,u,v,n;
void DFSVisit(int u){
int i;
color[u] = GLAY;
d[u] = ++time;
for(i = 0;i < k[u];i++){
if(color[g[u][i]] == WHITE){
DFSVisit(g[u][i]);
}
}
color[u] = B... | main.c:57:1: error: unknown type name 'Compile'
57 | Compile Error Logs:
| ^~~~~~~
main.c:57:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Logs'
57 | Compile Error Logs:
| ^~~~
main.c:61:81: error: invalid digit "9" in octal constant
61 | Judge: 8/8 C ... |
s781200589 | p02238 | C | #include <stdio.h>
#define N 100
int n;
int G[N][N]
int H[N], f[N], d[N];
int t=0;
void DFS(int a){
int i;
for(i = 1; i <= n; i++){
if (G[a][i] == 1 && H[i] == 0){
H[i] = 1;
t++;
d[i] = t;
DFS(i);
}
}
t++;
f[a] = t;
}
int main()
{
int i, j, u, k, v;
scanf("%d",&n);
fo... | main.c:5:12: error: expected ';' before 'int'
5 | int G[N][N]
| ^
| ;
6 | int H[N], f[N], d[N];
| ~~~
main.c: In function 'DFS':
main.c:12:9: error: 'G' undeclared (first use in this function)
12 | if (G[a][i] == 1 && H[i] == 0){
| ^
main.c:1... |
s590822829 | 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);
}
}
... | main.c:5:1: warning: missing terminating " character
5 | "define BRACK 2;
| ^
main.c:5:1: error: missing terminating " character
5 | "define BRACK 2;
| ^~~~~~~~~~~~~~~~
main.c: In function 'dfs_visit':
main.c:3:16: error: expected ')' before ';' token
3 | #define WHITE 0;
| ... |
s496347745 | 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 (N[u][v] == 0) {
continue;
}
if (color[v] == WHITE) {
... | main.c: In function 'dfs_visit':
main.c:17:12: error: subscripted value is neither array nor pointer nor vector
17 | if (N[u][v] == 0) {
| ^
main.c:21:19: error: subscripted value is neither array nor pointer nor vector
21 | dfs_visit[v];
| ^
main.c: In func... |
s495303072 | 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);
}
... | main.c: In function 'dfs_visit':
main.c:3:16: error: expected ')' before ';' token
3 | #define WHITE 0;
| ^
main.c:16:22: note: in expansion of macro 'WHITE'
16 | if ( color[v] == WHITE ){
| ^~~~~
main.c:16:8: note: to match this '('
16 | if ( color[v] =... |
s149524040 | 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 (N[u][v] == 0) {
continue;
}
if (color[v] == WHITE) {
... | main.c: In function 'dfs_visit':
main.c:17:12: error: subscripted value is neither array nor pointer nor vector
17 | if (N[u][v] == 0) {
| ^
main.c:21:19: error: subscripted value is neither array nor pointer nor vector
21 | dfs_visit[v];
| ^
|
s405005483 | p02238 | C | #include<stdio.h>
#define MAX 100
??
int g[MAX][MAX], labels[MAX], n, d[MAX], f[MAX], time;
??
??
void dfs(int u) {
????????int v;
????????labels[u] = 1;
????????d[u] = ++time;
????????for(v=0; v<n; v++){
????????if (g[u][v] && labels[v] == 0) {
????????????????dfs(v);
????????}
????????}
????????labels[u] = 2;
??????... | main.c:3:1: error: expected identifier or '(' before '?' token
3 | ??
| ^
main.c:6:1: error: expected identifier or '(' before '?' token
6 | ??
| ^
main.c:21:1: error: expected identifier or '(' before '?' token
21 | ??
| ^
|
s824782201 | p02238 | C | #include<stdio.h>
#define MAX 100
??
/*
????unvisited 0
????visited 1
????finished search 2
??????
??*/
int g[MAX][MAX], labels[MAX], n, d[MAX], f[MAX], time;
??
??
void dfs(int u) {
????????int v;
????????labels[u] = 1;
????????d[u] = ++time;
????????for(v=0; v<n; v++){
????????if (g[u][v] && labels[v] == 0) {
???????... | main.c:3:1: error: expected identifier or '(' before '?' token
3 | ??
| ^
main.c:11:1: error: expected identifier or '(' before '?' token
11 | ??
| ^
main.c:26:1: error: expected identifier or '(' before '?' token
26 | ??
| ^
|
s144704063 | p02238 | C | #include <stdio.h>
#define N 1000
#define WHITE 0
#define BLACK 1
#define GRAY 2
??
int A[N][N],color[N],d[N],f[N],k[N];
int n,u,time;
??
??
void visit(int r){
??
????int i;
??
????color[r] = GRAY;
????d[r] = ++time;
????for(i=1;i<=k[r];i++){
????????if(color[A[r][i]] == WHITE){
????????????visit(A[r][i]);
????????}
??... | main.c:6:1: error: expected identifier or '(' before '?' token
6 | ??
| ^
main.c:9:1: error: expected identifier or '(' before '?' token
9 | ??
| ^
main.c:25:1: error: expected identifier or '(' before '?' token
25 | ??
| ^
main.c:40:1: error: expected identifier or '(' before '?' token
... |
s603511673 | 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);
}
}
colo... | main.c: In function 'dfs':
main.c:29:3: error: expected declaration specifiers before 'for'
29 | for (u=0; u < n; u++) color[u] = WHITE;
| ^~~
main.c:29:13: error: expected declaration specifiers before 'u'
29 | for (u=0; u < n; u++) color[u] = WHITE;
| ^
main.c:29:20: error: expecte... |
s540241088 | 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;
... | main.c:67:6: error: redefinition of 'dfs_visit'
67 | void dfs_visit(int u) {
| ^~~~~~~~~
main.c:10:6: note: previous definition of 'dfs_visit' with type 'void(int)'
10 | void dfs_visit(int u) {
| ^~~~~~~~~
main.c:81:6: error: redefinition of 'dfs'
81 | void dfs() {
| ^~~
main.c... |
s892451212 | p02238 | C | #include <stdbool.h>
#include <stdint.h>
typedef enum {
WHITE,
GRAY,
} color_t;
typedef struct {
uint32_t index;
size_t len;
uint32_t array[GRAPH_MATRIX_SIZE];
color_t color;
} graph_vertex_t;
void graph_depth_first_search(graph_vertex_t *vertexes, uint32_t index, graph_depth_first_search_callback_t cal... | main.c:11:3: error: unknown type name 'size_t'
11 | size_t len;
| ^~~~~~
main.c:3:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
2 | #include <stdint.h>
+++ |+#include <stddef.h>
3 |
main.c:12:18: error: 'GRAPH_MATRIX_SIZE' undeclare... |
s002780918 | p02238 | C | #include <stdbool.h>
#include <stdint.h>
#define GRAPH_MATRIX_SIZE 256
typedef enum {
WHITE,
GRAY,
} color_t;
typedef struct {
uint32_t index;
size_t len;
uint32_t array[GRAPH_MATRIX_SIZE];
color_t color;
} graph_vertex_t;
void graph_depth_first_search(graph_vertex_t *vertexes, uint32_t index, graph_de... | main.c:13:3: error: unknown type name 'size_t'
13 | size_t len;
| ^~~~~~
main.c:3:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
2 | #include <stdint.h>
+++ |+#include <stddef.h>
3 |
main.c:19:73: error: unknown type name 'graph_dept... |
s282285927 | p02238 | C | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<stack>
using namespace std;
int main(){
int n,u,k,v;
int M[100][100];
stack<int> S;
cin >> n;
for(int i=0;i<n;i++){
cin >> u;
u--;
cin >> k;
for(int j=0;j<k;j++){
cin >> v;
v--;
M[u][v]=1;
}
}
int time=0;
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s662197664 | p02238 | C | void visit(int);
int t=0,n;
int array[N][N], road_color[N] ,arr1[N], time[N];
int main(){
int i,j,num1,num2,num3;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
array[i][j] = 0;
}
}
for(i=0;i<n;i++){
scanf("%d %d",&num1,&num2);
num1--;
for(j=0;j<num2;j++){
scanf("%d",&num3... | main.c:3:11: error: 'N' undeclared here (not in a function)
3 | int array[N][N], road_color[N] ,arr1[N], time[N];
| ^
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: ... |
s248092245 | p02238 | C | #include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
void dfsvisit(int);
void dfs(void);
int n,M[N][N];
int color[N],d[N],f[N]
int t;
main(){
int u,k,v;
int i,j;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++)M[i][j]=0;
}
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
u--;
for(j=0;j<k;j++){
sc... | main.c:12:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
12 | int t;
| ^~~
main.c:14:1: error: return type defaults to 'int' [-Wimplicit-int]
14 | main(){
| ^~~~
main.c: In function 'dfsvisit':
main.c:40:8: error: 't' undeclared (first use in this function)
40 | d[u]=++t;
... |
s252552368 | 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]
int t;
void dfsvisit(int);
void dfs(void);
main(){
int u,k,v;
int i,j;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++)M[i][j]=0;
}
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
u--;
for(j=0;j<k;j++){
sc... | main.c:9:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
9 | int t;
| ^~~
main.c:14:1: error: return type defaults to 'int' [-Wimplicit-int]
14 | main(){
| ^~~~
main.c: In function 'dfsvisit':
main.c:40:8: error: 't' undeclared (first use in this function)
40 | d[u]=++t;
... |
s468831870 | 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]
int t;
void dfsvisit(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)dfsvisit(v);
}
color[u]=BLACK;
f[u]=++t;
}
void dfs(void){
int u;
for(u=0;u<n;... | main.c:9:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
9 | int t;
| ^~~
main.c: In function 'dfsvisit':
main.c:14:8: error: 't' undeclared (first use in this function)
14 | d[u]=++t;
| ^
main.c:14:8: note: each undeclared identifier is reported only once for each func... |
s583386875 | p02238 | C | #include <stdio.h>
#define MAX 101
#define WHITE 0
#define GLAY 1
#define BLACK 2
int n,V[MAX][MAX];
int color[MAX];
int time;
int d[MAX],f[MAX];
void DFS(int id){
int i;
for(i=1;i<=n;i++){
color[id] = WHITE;
}
time = 0;
for(i=1;i<=n;i++){
if(color[id] == WHITE){
Visit(id);
}
}
for(... | main.c: In function 'DFS':
main.c:21:7: error: implicit declaration of function 'Visit' [-Wimplicit-function-declaration]
21 | Visit(id);
| ^~~~~
main.c:25:5: error: implicit declaration of function 'prinrf'; did you mean 'printf'? [-Wimplicit-function-declaration]
25 | prinrf("%d %d %d\n",i... |
s306392787 | p02238 | C | #include<stdio.h>
#define Black 2
#define GRAY 1
#define WHITE 0
#define N 101
int color[N];
int n, G[N][N],f[N],d[N],time;
void visit(int u){
int i;
color[u]=GRAY;
d[u]= ++time;
for(i=0; i<n; i++){
if(G[u][i] == 1){
if(color[i] == WHITE)visit(i);
}
}
color[u]= BLACK;
f[u]=++time;
}
... | main.c: In function 'visit':
main.c:20:13: error: 'BLACK' undeclared (first use in this function)
20 | color[u]= BLACK;
| ^~~~~
main.c:20:13: note: each undeclared identifier is reported only once for each function it appears in
|
s160298724 | p02238 | C | #include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
void dfs(void);
void visit(int);
int G[N][N],n,d[N],f[N],color[N],time;
int main(void){
int i,j,k,u,v;
scanf("%d",&n);
for(i = 0; i < n; i++){
for(j = 0; j < n; j++){
G[i][j] = 0;
}
}
for(i = 0; i < n; i++){
... | main.c: In function 'visit':
main.c:48:10: error: 'A' undeclared (first use in this function)
48 | if(A[u][v] == 0) continue;
| ^
main.c:48:10: note: each undeclared identifier is reported only once for each function it appears in
|
s110968804 | p02238 | C | #include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
void dfs(void);
void visit(int);
int G[N][N],n,d[N],f[N],color[N],time;
int main(void){
int i,j,k,u,v;
scanf("%d",&n);
for(i = 0; i < n; i++){
for(j = 0; j < n; j++){
G[i][j] = 0;
}
}
for(i = 0; i < n; i++){
... | main.c: In function 'visit':
main.c:48:10: error: 'A' undeclared (first use in this function)
48 | if(A[u][v] == 0) continue;
| ^
main.c:48:10: note: each undeclared identifier is reported only once for each function it appears in
|
s570618929 | p02238 | C | #include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
void dfs(void);
void visit(int);
int G[N][N],n,d[N],f[N],color[N],time;
int main(void){
int i,j,k,u,v;
scanf("%d",&n);
for(i = 0; i < n; i++){
for(j = 0; j < n; j++){
G[i][j] = 0;
}
}
for(i = 0; i < n; i++){
... | main.c: In function 'visit':
main.c:48:10: error: 'A' undeclared (first use in this function)
48 | if(A[u][v] == 0) continue;
| ^
main.c:48:10: note: each undeclared identifier is reported only once for each function it appears in
|
s971342934 | p02238 | C | #include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
void dfs(void);
void visit(int);
int G[N][N],n;
int d[N],f[N],color[N],time;
int main(){
int i,j,k,u,v;
scanf("%d",&n);
for(i = 0; i < n; i++){
for(j = 0; j < n; j++){
G[i][j] = 0;
}
}
for(i = 0; i < n; i++){
... | main.c: In function 'visit':
main.c:49:10: error: 'A' undeclared (first use in this function)
49 | if(A[u][v] == 0) continue;
| ^
main.c:49:10: note: each undeclared identifier is reported only once for each function it appears in
|
s400925755 | p02238 | C | #include <stdio.h>
#define N 100
#define A 1
#define B 2
#define C 3
int n,d[N],f[N],time,S[N],G[N][N];
void DFS(void);
void DFSiku(int);
int main(){
int i,j,u,v,k;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
G[i][j]=0;
}
}
for(i=0;i<n;i++){
scanf("%d %d",&u,&k);
for(j=0;j... | /usr/bin/ld: /tmp/ccvCmFMB.o: in function `DFS':
main.c:(.text+0x226): undefined reference to `DFSiku'
collect2: error: ld returned 1 exit status
|
s354624108 | p02238 | C | #include <stdio.h>
#define N 100;
int d[N], f[N], g[N][N] = {0};
int n;
int depth(int);
int time=1;
int main(){
int i, j, a, b, c;
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d%d", &a, &b);
for(j = 0; j < b; j++){
scanf("%d", &c);
g[a-1][c-1] = 1;
}
}
depth(0);
i = 0;
while(1){
... | main.c:2:14: error: expected ']' before ';' token
2 | #define N 100;
| ^
main.c:4:7: note: in expansion of macro 'N'
4 | int d[N], f[N], g[N][N] = {0};
| ^
main.c:4:14: error: expected identifier or '(' before ']' token
4 | int d[N], f[N], g[N][N] = {0};
| ^... |
s217092006 | 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];
int tt;
void dfs_visit(int);
void dfs();
int main(){
int u,k,v;
int i,j;
scanf("%d", &n);
for (i = 0; i<n; i++){
for (j = 0; j<n; j++) {
M[i][j] = 0;
}
}
for (i =... | main.c: In function 'dfs_visit':
main.c:53:8: error: 'v' undeclared (first use in this function)
53 | for (v = 0; v < n; v++ ){
| ^
main.c:53:8: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:84:9: error: 'u' undeclared here (not in ... |
s591448145 | 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];
int t;
void dfs_visit(int);
void dfs();
int main(){
int u, k, v;
int i, j;
scanf("%d", &n);
for ( i = 0; i <n; i++ ){
for ( j = 0; j <n; j++ ) {
M[i][j] = 0;
... | main.c: In function 'dfs_visit':
main.c:65:12: error: 'tt' undeclared (first use in this function); did you mean 't'?
65 | f[u] = ++tt;
| ^~
| t
main.c:65:12: note: each undeclared identifier is reported only once for each function it appears in
|
s461878999 | p02238 | C | #include <stdio.h>
#define max 100
int arr[max][max];
int d[max],f[max];
int count = 0,n;
void dfs(int i){
int j;
count++;
d[i] = t;
for(j = 0 ; j < n ; j++){
if(arr[i][j] != 0 && d[j] == 0)dfs(j);
}
count++;
f[i] = count;
}
int main(){
int i,j;
int u,k,v;
scanf("%d",&n);
for... | main.c: In function 'dfs':
main.c:12:10: error: 't' undeclared (first use in this function)
12 | d[i] = t;
| ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
|
s026686747 | p02238 | C | #include<stdio.h>
#define N 105
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n;
int color[N], d[N], f[N], array[N][N];
int main(){
scanf("%d", &n);
int i, u, v, j, e;
for(i = 1; i < n+1; i++){
for(j = 1; j < n+1; j++){
array[i][j] = 0;
}
}
for(i = 1; i < n+1; i++){
scanf("%d%d",... | main.c: In function 'main':
main.c:29:3: error: implicit declaration of function 'DFS' [-Wimplicit-function-declaration]
29 | DFS();
| ^~~
main.c: At top level:
main.c:39:6: warning: conflicting types for 'DFS'; have 'void()'
39 | void DFS(){
| ^~~
main.c:29:3: note: previous implicit declara... |
s665810347 | p02238 | C | #include<stdio.h>
#define N 105
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, t = 0;
int color[N], d[N], f[N], array[N][N];
int main(){
scanf("%d", &n);
int i, u, v, j, e;
for(i = 1; i < n+1; i++){
for(j = 1; j < n+1; j++){
array[i][j] = 0;
}
}
for(i = 1; i < n+1; i++){
scanf(... | main.c: In function 'main':
main.c:29:3: error: implicit declaration of function 'DFS' [-Wimplicit-function-declaration]
29 | DFS();
| ^~~
main.c: At top level:
main.c:39:6: warning: conflicting types for 'DFS'; have 'void()'
39 | void DFS(){
| ^~~
main.c:29:3: note: previous implicit declara... |
s226352852 | p02238 | C | #include<stdio.h>
#define N 105
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, t = 0;
int color[N], d[N], f[N], array[N][N];
int main(){
scanf("%d", &n);
int i, u, v, j, e;
for(i = 1; i < n+1; i++){
for(j = 1; j < n+1; j++){
array[i][j] = 0;
}
}
for(i = 1; i < n+1; i++){
scanf(... | main.c: In function 'main':
main.c:29:3: error: implicit declaration of function 'DFS' [-Wimplicit-function-declaration]
29 | DFS();
| ^~~
main.c: At top level:
main.c:39:6: warning: conflicting types for 'DFS'; have 'void()'
39 | void DFS(){
| ^~~
main.c:29:3: note: previous implicit declara... |
s562374160 | p02238 | C | #include <stdio.h>
#include<stdlib.h>
#define N 101
void push(int x);
void pop(void);
int isEmpty(void);
int isFull(void);
void visit(int);
void dfs(int);
int next(int, int);
int d[N], f[N], A[N][N], t = 0, top = 0, n, S[N];
char color[N];
int main(){
int i, j, k, l, m;
scanf("%d",&n);
for(i = 1; i <=... | main.c: In function 'dfs':
main.c:45:1: error: number of arguments doesn't match prototype
45 | void dfs(){
| ^~~~
main.c:11:6: error: prototype declaration
11 | void dfs(int);
| ^~~
main.c:49:16: error: 'WHITE' undeclared (first use in this function)
49 | color[i] = WHITE;
| ... |
s867813103 | p02238 | C | #include <stdio.h>
int connect[101][101]={0};
int d[101]={0};
int f[101]={0};
int used[101] = {0};
int n;
int cd = 1;
int dfs(int now)
{
int i;
if(used[now]) return???0;
used[now] = 1;
for(i = 0; i < n; i++){
if(connect[now][i]){
if(d[i] == 0){
cd++;
d[i] = cd;
}
dfs(i);
}
}
... | main.c: In function 'dfs':
main.c:14:23: error: expected expression before '?' token
14 | if(used[now]) return???0;
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.