submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s268786826 | p02239 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <cstdint>
using namespace std;
enum COLOR {
WHITE,
GRAY,
BLACK,
};
static const int INFTY = INT_MAX;
static const int N = 100;
static int M[N][N] = {};
static vector<COLOR> color(N, WHITE);
static vector<int> d(N, INFTY);
static void bfs(int n, ... | a.cc:14:26: error: 'INT_MAX' was not declared in this scope
14 | static const int INFTY = INT_MAX;
| ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
4 | #include <cstdint>
+++ |+#include <climits>
5 |... |
s136523452 | p02239 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <cstdint>
using namespace std;
enum COLOR {
WHITE,
GRAY,
BLACK,
};
static const int INFTY = INT_MAX;
static const int N = 100;
static int M[N][N] = {};
static vector<COLOR> color(N, WHITE);
static vector<int> d(N, INFTY);
static void bfs(int n, ... | a.cc:14:26: error: 'INT_MAX' was not declared in this scope
14 | static const int INFTY = INT_MAX;
| ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
4 | #include <cstdint>
+++ |+#include <climits>
5 |... |
s324884857 | p02239 | C++ | #include <stdio.h>
#include <queue>
int time, n;
int d[100], color[100];
int M[100][100];
void bfs(int s) {
queue<int> Q;
for (int i=0; i<100; i++) color[i] = 0:
for (int i=0; i<100; i++) d[i] = -1;
color[s] = 1;
d[s] = 0;
Q.push(s);
while (!Q.empty()) {
int u = Q.front()... | a.cc: In function 'void bfs(int)':
a.cc:9:5: error: 'queue' was not declared in this scope; did you mean 'std::queue'?
9 | queue<int> Q;
| ^~~~~
| std::queue
In file included from /usr/include/c++/14/queue:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_queue.h:96:11: note: 's... |
s964972162 | p02239 | C++ | #include <stdio.h>
#include <queue>
int time, n;
int d[100], color[100];
int M[100][100];
void bfs(int s) {
std::queue<int> Q;
for (int i=0; i<100; i++) color[i] = 0:
for (int i=0; i<100; i++) d[i] = -1;
color[s] = 1;
d[s] = 0;
Q.push(s);
while (!Q.empty()) {
int u = Q.fr... | a.cc: In function 'void bfs(int)':
a.cc:11:43: error: expected ';' before ':' token
11 | for (int i=0; i<100; i++) color[i] = 0:
| ^
| ;
a.cc:12:19: error: 'i' was not declared in this scope
12 | for (int i=0; ... |
s071367530 | p02239 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<cassert>
#include<cstdio>
#include<queue>
using namespace std;
int N, G[100][100], V[100], D[100];//G:2頂点,V:次数,D:距離
void bfs(int src){
queue<int> Q;
Q.push(src);
fill(D, D + N, -1);
D[src] = 0;
while (!Q.empty()){
int cur = Q.front();
Q.pop();... | a.cc: In function 'int main()':
a.cc:33:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
33 | scanf_s("%d", &N);
| ^~~~~~~
| scanf
|
s085023889 | p02239 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<cassert>
#include<cstdio>
#include<queue>
using namespace std;
int N, G[100][100], V[100], D[100];//G:2頂点,V:次数,D:距離
void bfs(int src){
queue<int> Q;
Q.push(src);
fill(D, D + N, -1);
D[src] = 0;
while (!Q.empty()){
int cur = Q.front();
Q.pop();... | a.cc: In function 'int main()':
a.cc:33:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
33 | scanf_s("%d", &N);
| ^~~~~~~
| scanf
|
s201969233 | p02239 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<cassert>
#include<cstdio>
#include<queue>
using namespace std;
int N, G[100][100], V[100], D[100];//G:2頂点,V:次数,D:距離
void bfs(int src){
queue<int> Q;
Q.push(src);
fill(D, D + N, -1);
D[src] = 0;
while (!Q.empty()){
int cur = Q.front();
Q.pop();... | a.cc: In function 'int main()':
a.cc:33:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
33 | scanf_s("%d", &N);
| ^~~~~~~
| scanf
|
s049878104 | p02239 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<cassert>
#include<cstdio>
#include<queue>
using namespace std;
int N, G[100][100], V[100], D[100];//G:2頂点,V:次数,D:距離
void bfs(int src){
queue<int> Q;
Q.push(src);
fill(D, D + N, -1);
D[src] = 0;
while (!Q.empty()){
int cur = Q.fr... | a.cc: In function 'int main()':
a.cc:65:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
65 | scanf_s("%d", &N);
| ^~~~~~~
| scanf
|
s576801594 | p02239 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<cassert>
#include<cstdio>
#include<queue>
using namespace std;
int N, G[100][100], V[100], D[100];//G:2頂点,V:次数,D:距離
void bfs(int src){
queue<int> Q;
Q.push(src);
fill(D, D + N, -1);
D[src] = 0;
while (!Q.empty()){
int cur = Q.front();
Q.pop();... | a.cc: In function 'int main()':
a.cc:33:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
33 | scanf_s("%d", &N);
| ^~~~~~~
| scanf
|
s861329731 | p02240 | Java | import java.util.Scanner;
import java.util.HashMap;
import java.util.Queue;
import java.util.ArrayDeque;
import java.util.ArrayList;
public class Main{
HashMap<Integer, Integer> components;
ArrayList<Integer> vertexToIndex;
Graph g;
public ConnectedComponent(Graph g) {
components = new HashMap<Integer, Integer... | Main.java:12: error: invalid method declaration; return type required
public ConnectedComponent(Graph g) {
^
Main.java:106: error: class, interface, enum, or record expected
import java.util.Arrays;
^
Main.java:107: error: class, interface, enum, or record expected
import java.util.Collections;
^
3 errors
|
s824966110 | p02240 | Java | import java.util.Scanner;
import java.util.HashMap;
import java.util.Queue;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
public class Main{
HashMap<Integer, Integer> components;
ArrayList<Integer> vertexToIndex;
Graph g;
public ConnectedComponen... | Main.java:15: error: invalid method declaration; return type required
public ConnectedComponent(Graph g) {
^
1 error
|
s830513897 | p02240 | Java | import java.util.*;
public class Main {
private int[][] matrix;
private int numEdge;
public int[] Mark;
public int size;
public boolean[] visited;
public Main() {};
public Main(int n) {
Init(n);
}
public void Init(int n) {
Mark = new int[n];
visited = new boolean[n];
matrix = new int[n][n];
... | Main.java:72: error: cannot find symbol
ConnectedGraph graph = new ConnectedGraph(size);
^
symbol: class ConnectedGraph
location: class Main
Main.java:72: error: cannot find symbol
ConnectedGraph graph = new ConnectedGraph(size);
^
symbol: class ConnectedGraph
location: cl... |
s012173325 | p02240 | Java | import java.util.*;
public class Main {
private int[][] matrix;
private int numEdge;
public int[] Mark;
public int size;
public boolean[] visited;
public ConnectedGraph() {};
public ConnectedGraph(int n) {
Init(n);
}
public void Init(int n) {
Mark = new int[n];
visited = new boolean[n];
matrix... | Main.java:12: error: invalid method declaration; return type required
public ConnectedGraph() {};
^
Main.java:13: error: invalid method declaration; return type required
public ConnectedGraph(int n) {
^
2 errors
|
s445496163 | p02240 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.InputMismatchException;
public class Main_ALDS1_11_D {
public static void main(String[] a... | Main.java:11: error: class Main_ALDS1_11_D is public, should be declared in a file named Main_ALDS1_11_D.java
public class Main_ALDS1_11_D {
^
1 error
|
s637062063 | p02240 | Java |
import java.util.*;
public class Sub{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
Graph graph = new Graph(scan.nextInt());
int relationNum = scan.nextInt();
for(int i=0; i<relationNum; i++)
graph.setRelation(scan.nextInt(), scan.nextInt());
int queryNum = scan.nextI... | Main.java:5: error: class Sub is public, should be declared in a file named Sub.java
public class Sub{
^
1 error
|
s576498846 | p02240 | Java |
import java.util.*;
public class Sub{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
Graph graph = new Graph(scan.nextInt());
int relationNum = scan.nextInt();
for(int i=0; i<relationNum; i++)
graph.setRelation(scan.nextInt(), scan.nextInt());
int queryNum = scan.nextI... | Main.java:5: error: class Sub is public, should be declared in a file named Sub.java
public class Sub{
^
1 error
|
s520230708 | p02240 | Java | import java.util.*;
class ID{
public int id;
public ID(int id){
this.id = id;
}
}
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
ID nullID = new ID(-1);
ID[] group = new ID[scanner.nextInt()];
for(... | Main.java:32: error: ';' expected
int tempID = group[s].id
^
1 error
|
s292816844 | p02240 | Java | import java.util.Scanner;
public class QuickFindUF {
private int[] id;
public QuickFindUF(int N) {
id = new int[N];
for (int i = 0; i < N; i++) {
id[i] = i;
}
}
public boolean connected(int p, int q){
return id[p] == id[q];
}
public void union(int ... | Main.java:3: error: class QuickFindUF is public, should be declared in a file named QuickFindUF.java
public class QuickFindUF {
^
1 error
|
s276222235 | p02240 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
int N = scanner.nextInt();
int M = scanner.nextInt();
QuickFindUF uf = new QuickFindUF(N);
// input
for (int i = 0; i < M; i++) {
... | Main.java:32: error: class QuickFindUF is public, should be declared in a file named QuickFindUF.java
public class QuickFindUF {
^
1 error
|
s280498967 | p02240 | Java | import java.util.Scanner;
public class Main {
public class QuickUnionUF {
private int[] id;
public QuickUnionUF(int N) {
id = new int[N];
for (int i = 0; i < N; i++) {
id[i] = i;
}
}
public void union(int p, int q) {
int i = root(p);
int j = root(q... | Main.java:40: error: non-static variable this cannot be referenced from a static context
QuickUnionUF uf = new QuickUnionUF(N);
^
1 error
|
s209569563 | p02240 | Java | import java.util.Scanner;
static class QuickUnionUF {
private int[] id;
private int[] sz;
QuickUnionUF(int N) {
id = new int[N];
sz = new int[N];
for (int i = 0; i < N; i++) {
id[i] = i;
sz[i] = 0;
}
}
private int root(int i) {
whil... | Main.java:3: error: modifier static not allowed here
static class QuickUnionUF {
^
1 error
|
s956503042 | p02240 | Java | import java.util.Scanner;
public static class QuickUnionUF {
private int[] id;
private int[] sz;
QuickUnionUF(int N) {
id = new int[N];
sz = new int[N];
for (int i = 0; i < N; i++) {
id[i] = i;
sz[i] = 0;
}
}
private int root(int i) {
... | Main.java:3: error: class QuickUnionUF is public, should be declared in a file named QuickUnionUF.java
public static class QuickUnionUF {
^
1 error
|
s602297572 | p02240 | Java | import java.util.Scanner;
public static class QuickUnionUF {
private int[] id;
private int[] sz;
public QuickUnionUF(int N) {
id = new int[N];
sz = new int[N];
for (int i = 0; i < N; i++) {
id[i] = i;
sz[i] = 0;
}
}
private int root(int i) ... | Main.java:3: error: class QuickUnionUF is public, should be declared in a file named QuickUnionUF.java
public static class QuickUnionUF {
^
1 error
|
s110155669 | p02240 | Java | import java.util.Scanner;
public static class Main {
private int[] id;
private int[] sz;
QuickUnionUF(int N) {
id = new int[N];
sz = new int[N];
for (int i = 0; i < N; i++) {
id[i] = i;
sz[i] = 0;
}
}
private int root(int i) {
while... | Main.java:8: error: invalid method declaration; return type required
QuickUnionUF(int N) {
^
1 error
|
s251463222 | p02240 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import static java.lang.Integer.parseInt;
/**
* Graph I - Connected Components
*/
public class Main {
static final int NIL = -1;
public static void main(String[] args) throws IOException {
Buffered... | Main.java:19: error: cannot find symbol
D main = new D();
^
symbol: class D
location: class Main
Main.java:19: error: cannot find symbol
D main = new D();
^
symbol: class D
location: class Main
2 errors
|
s268634004 | p02240 | Java |
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.Stack;
public class Sample {
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(System.in);
int n = in.nextI... | Main.java:10: error: class Sample is public, should be declared in a file named Sample.java
public class Sample {
^
1 error
|
s754537798 | p02240 | Java | import java.io.File;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Deque;
import java.util.List;
import java.util.Scanner;
import java.util.Stack;
public class Main {
public static void main(String[] args) throws IOException {
Scanne... | Main.java:68: error: reached end of file while parsing
}
^
1 error
|
s364913328 | p02240 | Java | import java.util.*;
public class ConnectedComponents{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
int[] A=new int[n];
for(int i=0;i<n;i++){
A[i]=i;
}
for(int i=0;i<m;i++){
int a=sc.nextInt();
int b=sc.nextInt();
A[b]=A[a];... | Main.java:2: error: class ConnectedComponents is public, should be declared in a file named ConnectedComponents.java
public class ConnectedComponents{
^
1 error
|
s495418809 | p02240 | 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
| |
s482751357 | p02240 | C | #include<stdio.h>
#include<string.h>
#define L 100000
int V,E;
int color=0;
typedef struct list{
int id;
struct list *next;
}list;
list * makelist(int x){
list *new = malloc(sizeof(list));
new->id = x;
new->next = NULL;
return new;
}
void list_insert(list* L[], int x, list *new){
list **p = &L[x];
... | main.c: In function 'makelist':
main.c:15:15: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
15 | list *new = malloc(sizeof(list));
| ^~~~~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
2 | #include<string.h>
+++ |+#includ... |
s644376008 | p02240 | C | #include<stdio.h>
#include<string.h>
#define LANGE 100000
int V,E;
int color=0;
typedef struct list{
int id;
struct list *next;
}list;
list * makelist(int x){
list *new = malloc(sizeof(list));
new->id = x;
new->next = NULL;
return new;
}
void list_insert(list* L[], int x, list *new){
list **p = &L[x];... | main.c: In function 'makelist':
main.c:15:15: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
15 | list *new = malloc(sizeof(list));
| ^~~~~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
2 | #include<string.h>
+++ |+#includ... |
s816263136 | p02240 | C | #include<stdio.h>
#define N 100000
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n;
int time;
short int color[N];
int d[N],f[N];
void visit(int u,int G[n][n]){
int i;
color[u] = GRAY;
d[u] = ++time;
for(i=1;i<=n;i++){
if(G[u][i]==1 && color[i]==WHITE) visit(i,G);
}
color[u] = BLACK;
f[u] =... | main.c: In function 'main':
main.c:71:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
71 | for(i=0;i<q;i++){
| ^~~
main.c:71:18: error: expected ';' before ')' token
71 | for(i=0;i<q;i++){
| ^
| ;
main.c:71:18: error: expected state... |
s762515576 | p02240 | C | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;
int n;
vector<int> G[MAX];
int color[MAX];
void dfs(int r, int c) {
stack<int> S;
S.push(r);
color[r] = c;
while ( !S.empty() ) {
int u = S.top();
S.pop();
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s738420862 | p02240 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_N 100000
#define MAX_M 100000
typedef struct EDGE {
int to;
struct EDGE *next;
} edge;
int buff_size;
edge buff[MAX_M + MAX_M];
edge *adj[MAX_N];
void init(int n, int m) {
int i;
for(i = 0; i < n; ++i) {
adj[i] = NULL;
}
for(i = 0; i < m... | main.c: In function 'main':
main.c:103:1: error: unknown type name '_'
103 | _ puts(label[s] == label[t] ? "yes" : "no");
| ^
main.c:103:22: error: expected declaration specifiers or '...' before 'label'
103 | _ puts(label[s] == label[t] ? "yes" : "no");
| ... |
s024680302 | p02240 | C | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
??
typedef struct Node {
????int val;
????struct Node *next;??
} node_t;
??
node_t *G[100000];
int connected[100000];
int color;
??
node_t* add_node(node_t *node, int val)
{
????????node_t *n = (node_t*)malloc(sizeof(node_t));
????????n->val = val;
????????n->... | main.c:4:1: error: expected identifier or '(' before '?' token
4 | ??
| ^
main.c:8:3: warning: data definition has no type or storage class
8 | } node_t;
| ^~~~~~
main.c:8:3: error: type defaults to 'int' in declaration of 'node_t' [-Wimplicit-int]
main.c:9:1: error: expected identifier or '(' bef... |
s539496600 | p02240 | C | #include <stdio.h>
#include <stdlib.h>
??
typedef struct Node {
????int val;
????struct Node *next;??
} node_t;
??
node_t *G[100000];
int connected[100000];
int color;
??
node_t* add_node(node_t *node, int val)
{
????????node_t *n = (node_t*)malloc(sizeof(node_t));
????????n->val = val;
????????n->next = node;
???????... | main.c:3:1: error: expected identifier or '(' before '?' token
3 | ??
| ^
main.c:7:3: warning: data definition has no type or storage class
7 | } node_t;
| ^~~~~~
main.c:7:3: error: type defaults to 'int' in declaration of 'node_t' [-Wimplicit-int]
main.c:8:1: error: expected identifier or '(' bef... |
s739960707 | p02240 | C | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
??
typedef struct Node {
????int val;
????struct Node *next;??
} node_t;
??
node_t *G[100000];
int connected[100000];
int color;
??
node_t* add_node(node_t *node, int val)
{
????????node_t *n = (node_t*)malloc(sizeof(node_t));
????????n->val = val;
????????n->... | main.c:4:1: error: expected identifier or '(' before '?' token
4 | ??
| ^
main.c:8:3: warning: data definition has no type or storage class
8 | } node_t;
| ^~~~~~
main.c:8:3: error: type defaults to 'int' in declaration of 'node_t' [-Wimplicit-int]
main.c:9:1: error: expected identifier or '(' bef... |
s752300345 | p02240 | C | #include <stdio.h>
#include <stdlib.h>
#define MAX 100010
#define INFTY 10000000
#define NIL -1
struct Node {
int value;
struct Node *next;
};
typedef struct Node node_t;
int N;
int M;
node_t *G[MAX];
int color[MAX];
node_t* addNode(node_t *node, int value)
{
node_t *new = (node_t*)malloc(sizeof(node_t));
new->... | main.c: In function 'dfs':
main.c:29:20: error: 'id' undeclared (first use in this function)
29 | color[r] = id;
| ^~
main.c:29:20: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'assignColor':
main.c:48:38: error: too many ... |
s130873416 | p02240 | C | #include <stdio.h>
#include <stdlib.h>
#define MAX 100010
#define INFTY 10000000
#define NIL -1
struct Node {
int value;
struct Node *next;
};
typedef struct Node node_t;
int N;
int M;
node_t *G[MAX];
int color[MAX];
node_t* addNode(node_t *node, int value)
{
node_t *new = (node_t*)malloc(sizeof(node_t));
new->... | main.c: In function 'dfs':
main.c:29:20: error: 'id' undeclared (first use in this function)
29 | color[r] = id;
| ^~
main.c:29:20: note: each undeclared identifier is reported only once for each function it appears in
|
s813258991 | p02240 | C |
#include <stdio.h>
#define WHITE 1
#define GRAY 0
#define BLACK -1
void dfs(int);
void visit(int);
int color[100002],n,vv[100002][10002],k[100002];
int main()
{
int i,m,q,s,t;
/* n ユーザ数 */
/* m 友達関係の数 */
scanf("%d %d",&n,&m);
for(i=0;i<n;i++){
k[i]=0;
}
//友達関係をinput
for(i=0;i<m;i++){
sc... | /tmp/ccSPC7Zk.o: in function `main':
main.c:(.text+0x46): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccSPC7Zk.o
main.c:(.text+0x9e): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccSPC7Zk.o
main.c:(.text+0xdd): relocation... |
s209963617 | p02240 | C | #include <stdio.h>
#define MAX_N 100001
#define VISITED 1
struct vertex
{
int N[MAX_N];
int len_N;
} typedef vertex;
int n;
vertex V[MAX_N];
int flag[MAX_N];
void setDefault();
int CanReach(int, int);
void reTravel(int);
int main()
{
int i;
int m, q;
int id1, id2;
setDefault();
scanf("%d %d", &n, &m);
... | /tmp/ccFMk8oG.o: in function `CanReach':
main.c:(.text+0x248): relocation truncated to fit: R_X86_64_PC32 against symbol `flag' defined in .bss section in /tmp/ccFMk8oG.o
main.c:(.text+0x27c): relocation truncated to fit: R_X86_64_PC32 against symbol `flag' defined in .bss section in /tmp/ccFMk8oG.o
/tmp/ccFMk8oG.o: in... |
s624457971 | p02240 | C | #include <stdio.h>
#define MAX_N 100001
#define VISITED 1
struct vertex
{
int N[MAX_N];
int len_N;
} typedef vertex;
int n;
vertex V[MAX_N];
int flag[MAX_N];
void setDefault();
int CanReach(int, int);
void reTravel(int);
int main()
{
int i;
int m, q;
int id1, id2;
setDefault();
scanf("%d %d", &n, &m);
... | /tmp/ccdlAXiA.o: in function `CanReach':
main.c:(.text+0x248): relocation truncated to fit: R_X86_64_PC32 against symbol `flag' defined in .bss section in /tmp/ccdlAXiA.o
main.c:(.text+0x27c): relocation truncated to fit: R_X86_64_PC32 against symbol `flag' defined in .bss section in /tmp/ccdlAXiA.o
/tmp/ccdlAXiA.o: in... |
s215180963 | p02240 | C | #iclude <stdio.h>
int main() {
int n, m, i, k[1000000][2], s, si[100000][2];
scanf ("%d %d",&n, &m);
for (i = 0; i < m - 1; i++)
scanf ("%d %d", &k[i][0], &k[i][1]);
scanf ("%d", &s);
for (i = 0; i < s; i++)
scanf ("%d %d", &si[i][1], &si[i][2]);
return 0;
} | main.c:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
1 | #iclude <stdio.h>
| ^~~~~~
| include
main.c: In function 'main':
main.c:6:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | scanf ("%d %d",&n, &m);
| ^~~~~
main.c:1:1... |
s168926763 | p02240 | C | #include<stdio.h>
#define MAX 100000
#define NIL -1
int G[MAX][MAX];
int n, color[MAX], S[MAX], top=0;
void push(int x) {
S[++top]=x;
}
int pop() {
top--;
return S[top+1];
}
int isEmpty() {
return top==0;
}
void dfs(int r, int c) {
int i, v, u;
push(r);
color[r]=c;
while (! isEmpty()) {
u=S[top... | /tmp/ccddZfan.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccddZfan.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccddZfan.o
main.c:(.text+0x18): relocat... |
s304113288 | p02240 | C | #include<stdio.h>
#define MAX 100000
#define NIL -1
int G[MAX][MAX];
int n, color[MAX], S[MAX], top=0;
void push(int x) {
S[++top]=x;
}
int pop() {
top--;
return S[top+1];
}
int isEmpty() {
return top==0;
}
void dfs(int r, int c) {
int i, v, u;
push(r);
color[r]=c;
while (! isEmpty()) {
u=S[to... | /tmp/ccqxC1Na.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccqxC1Na.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccqxC1Na.o
main.c:(.text+0x18): relocat... |
s666348477 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100000
#define NIL -1
int G[MAX][MAX];
int n, color[MAX], S[MAX], top=0;
void push(int x) {
S[++top]=x;
}
int pop() {
top--;
return S[top+1];
}
int isEmpty() {
return top==0;
}
void dfs(int r, int c) {
int i, v, u;
push(r);
color[r]=c;
while (! isEm... | /tmp/cc433cUS.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/cc433cUS.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/cc433cUS.o
main.c:(.text+0x18): relocat... |
s722013519 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100000
#define NIL -1
int G[MAX][MAX];
int n, color[MAX], S[100000], top=0;
void push(int x) {
S[++top]=x;
}
int pop() {
top--;
return S[top+1];
}
int isEmpty() {
return top==0;
}
void dfs(int r, int c) {
int i, v, u;
push(r);
color[r]=c;
while (! i... | /tmp/ccZCSxbQ.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccZCSxbQ.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccZCSxbQ.o
main.c:(.text+0x18): relocat... |
s373718981 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100000
#define NIL -1
int G[MAX][MAX];
int n, color[MAX], S[100000], top;
void push(int x) {
S[++top]=x;
}
int pop() {
top--;
return S[top+1];
}
int isEmpty() {
return top==0;
}
void dfs(int r, int c) {
int i, v, u;
push(r);
color[r]=c;
while (! isE... | /tmp/ccjatu0w.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccjatu0w.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccjatu0w.o
main.c:(.text+0x18): relocat... |
s571648126 | p02240 | C | #include<stdio.h>
#define MAX 10000000
#define NIL -1
int G[MAX][MAX];
int n, color[MAX], N[1000000000], top=0;
void push(int x) {
N[++top]=x;
}
int pop() {
top--;
return N[top+1];
}
int isEmpty() {
return top==0;
}
void dfs(int r, int c) {
int i, v, u;
push(r);
color[r]=c;
while (! isEmpty()) {
... | /tmp/ccBy9Ciw.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccBy9Ciw.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccBy9Ciw.o
main.c:(.text+0x18): relocat... |
s952437513 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 10000000
#define NIL -1
int G[MAX][MAX];
int n, color[MAX], N[1000000000], top=0;
void push(int x) {
N[++top]=x;
}
int pop() {
top--;
return N[top+1];
}
int isEmpty() {
return top==0;
}
void dfs(int r, int c) {
int i, v, u;
push(r);
color[r]=c;
whil... | /tmp/cc15Q1tO.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/cc15Q1tO.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/cc15Q1tO.o
main.c:(.text+0x18): relocat... |
s350203431 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100000000000
#define NIL -1
int G[MAX][MAX];
int n, color[MAX], N[MAX], top=0;
void push(int x) {
N[++top]=x;
}
int pop() {
top--;
return N[top+1];
}
int isEmpty() {
return top==0;
}
void dfs(int r, int c) {
int i, v, u;
push(r);
color[r]=c;
while (... | main.c:6:5: error: size of array 'G' exceeds maximum object size '9223372036854775807'
6 | int G[MAX][MAX];
| ^
|
s298291340 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 1000000000
#define NIL -1
int G[MAX][MAX];
int n, color[MAX], N[MAX], top=0;
void push(int x) {
N[++top]=x;
}
int pop() {
top--;
return N[top+1];
}
int isEmpty() {
return top==0;
}
void dfs(int r, int c) {
int i, v, u;
push(r);
color[r]=c;
while (! ... | /tmp/ccMlnEu7.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccMlnEu7.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccMlnEu7.o
main.c:(.text+0x18): relocat... |
s796990586 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 10000000000
#define NIL -1
int G[100000][100000];
int n, color[100000], N[MAX], top=0;
void push(int x) {
N[++top]=x;
}
int pop() {
top--;
return N[top+1];
}
int isEmpty() {
return top==0;
}
void dfs(int r, int c) {
int i, v, u;
push(r);
color[r]=c;
... | /tmp/ccZ6kFat.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccZ6kFat.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccZ6kFat.o
main.c:(.text+0x18): relocat... |
s120720273 | p02240 | C | #include<iostream>
#include<vector>
#inlcude<stack>
using namespace std;
#define MAX 100000
#define NIL -1
int G[MAX][MAX];
int n, color[MAX], top=0;
vector<int> G[MAX];
void dfs(int r, int c) {
stack<int> S;
int i, v, u;
S.push(r);
color[r]=c;
while (! S.empty()) {
u=S.top();
S.pop();
for (i=0... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s432895752 | p02240 | C | #include <stdio.h>
#define M 100000
#define N -1
int n;
int G[M][M] = {N};
int color[M];
void dfs(int r, int c) {
int s[M] = {N};
int a = 0, x = 0, m = 0, i;
s[a] = r;
color[r] = c;
while (x == 0) {
int u = s[m];
for (i = 0 ; i < n; i++) {
int v = G[u][i];
if (color[v] == N) {... | gcc: internal compiler error: File size limit exceeded signal terminated program as
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
|
s516369741 | p02240 | C | #include <stdio.h>
#define M 100000
int n;
int G[1000][1000] = {-1};
int color[M];
void dfs(int r, int c) {
int s[M] = {-1};
int a = 0, x = 0, m = 0, i;
s[a] = r;
color[r] = c;
while (x == 0) {
int u = s[m];
for (i = 0 ; i < n; i++) {
int v = G[u][i];
if (color[v] == -1) {
... | main.c: In function 'assignColor':
main.c:35:15: error: lvalue required as left operand of assignment
35 | -color[i] = 1;
| ^
|
s441406591 | p02240 | C | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;
int n;
vector<int> G[MAX];
int color[MAX];
void dfs(int r, int c) {
stack<int> S;
S.push(r);
color[r] = c;
while ( !S.empty()) {
int u = S.top(); S.pop();
for ( int i = 0; i <... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s269474840 | p02240 | C | #include<stdio.h>
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
int e[112345][112345]={};
int sumi[112345]={};
int n,m;
int dfs(int v,int g)
{
int i;
int ret=0;
if(v==g)
return 1;
rep(i,n)
if(e[v][i]==1 && sumi[i]==0)
{
sumi[i]=1;
ret=dfs(i,g);
if(ret==1)
break;
}
return ret;
}
int main... | /tmp/ccxrRvzz.o: in function `dfs':
main.c:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccxrRvzz.o
main.c:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccxrRvzz.o
main.c:(.text+0xb0): reloc... |
s875922341 | p02240 | C | #include<stdio.h>
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
int e[112345][112345]={};
int sumi[112345]={};
int n,m;
int dfs(int v,int g)
{
int i;
int ret=0;
if(v==g)
return 1;
else
{
rep(i,n)
if(e[v][i]==1 && sumi[i]==0)
{
sumi[i]=1;
ret=dfs(i,g);
if(ret==1)
break;
}
... | /tmp/ccQs4e8L.o: in function `dfs':
main.c:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccQs4e8L.o
main.c:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccQs4e8L.o
main.c:(.text+0xb0): reloc... |
s095911481 | p02240 | C | #include<stdio.h>
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
int e[112345][112345]={};
int sumi[112345]={};
int n,m;
int dfs(int v,int g)
{
int i;
int ret=0;
if(v==g)
ret=1;
else
rep(i,n)
if(e[v][i]==1 && sumi[i]==0)
{
sumi[i]=1;
ret=dfs(i,g);
if(ret==1)
break;
}
return ret;
}
int... | /tmp/ccph3XGl.o: in function `dfs':
main.c:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccph3XGl.o
main.c:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccph3XGl.o
main.c:(.text+0xb2): reloc... |
s207800765 | p02240 | C | #include<stdio.h>
int e[112345][112345]={};
int sumi[112345]={};
int n,m;
int dfs(int v,int g)
{
int i;
int ret=0;
if(v==g)
ret=1;
else
for(i=0;i<n;i++)
if(e[v][i]==1 && sumi[i]==0)
{
sumi[i]=1;
ret=dfs(i,g);
if(ret==1)
break;
}
return ret;
}
int main(void)
{
int i;
int a,b;
... | /tmp/ccYLgcBW.o: in function `dfs':
main.c:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccYLgcBW.o
main.c:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccYLgcBW.o
main.c:(.text+0xb2): reloc... |
s942914527 | p02240 | C | #include<stdio.h>
int e[112345][112345]={};
int sumi[112345]={};
int n;
int m;
int dfs(int v,int g)
{
int i;
int ret=0;
if(v==g)
ret=1;
else
for(i=0;i<n;i++)
if(e[v][i]==1 && sumi[i]==0)
{
sumi[i]=1;
ret=dfs(i,g);
if(ret==1)
break;
}
return ret;
}
int main(void)
{
int i;
int ... | /tmp/ccgdc332.o: in function `dfs':
main.c:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccgdc332.o
main.c:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccgdc332.o
main.c:(.text+0xb2): reloc... |
s523583888 | p02240 | C | #include<stdio.h>
#define MAX 100000
#define NIL -1
typedef int data_t;
data_t S[MAX];
int stack_num;
int n;
int G[MAX][MAX];
int color[MAX];
int push(data_t push_data)
{
if (stack_num < MAX) {
S[stack_num] = push_data;
stack_num ++;
return 1;
} else {
return 0;
}
}
v... | main.c: In function 'bfs':
main.c:31:4: error: request for member 'push' in something not a structure or union
31 | S.push(r);
| ^
main.c:34:10: error: request for member 'pop' in something not a structure or union
34 | u = S.pop();
| ^
main.c:35:19: error: request for member 'size' ... |
s087069167 | p02240 | C | #include<bits/stdc++.h>
using namespace std;
#define MAX 100000
int pa[MAX];
int ra[MAX];
void init(){
for(int i=0;i<MAX;i++){
pa[i]=i;
ra[i]=0;
}
}
int find(int x){
if(pa[x]==x)return x;
else return pa[x]=find(pa[x]);
}
void unite(int x,int y){
x=find(x),y=find(y);
if(x==y)return;
if(ra[x]<ra... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s724055308 | p02240 | C | #include<stdio.h>
#define N 100000;
int G[N] = {0};
void init() {
int i;
for(i=0;i<N;++i) G[i]=i;
}
int find(int x) {
if(x == G[x]) return x;
return G[x] = find(G[x]);
}
int eq(int a, int b) {
if(find(a) == find(b)) return 1;
else return 0;
}
void cone(int a,int b) {
a = find(a);
b = find(b);
if... | main.c:2:17: error: expected ']' before ';' token
2 | #define N 100000;
| ^
main.c:4:7: note: in expansion of macro 'N'
4 | int G[N] = {0};
| ^
main.c: In function 'init':
main.c:8:14: error: expected expression before ';' token
8 | for(i=0;i<N;++i) G[i]=i;
| ... |
s547985328 | p02240 | C | int main | main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
1 | int main
| ^~~
|
s632469151 | p02240 | C | #include<stdio.h>
#define MAX 100000
int a[MAX][MAX];
int color[MAX],stack[MAX],point=0;
void push(int d) {
stack[point]=d;
point++;
if(color[d]==0){
color[d]=1;
}
}
void pop(){
point--;
}
int search(int s,int t) {
int i;
for (i = 0;i<MAX;i++) color[i]=0;
push(s);
while(point!=0){
i=0;
while(a... | main.c: In function 'main':
main.c:33:22: error: expected expression before '%' token
33 | scanf("%d %d",&p,%w);
| ^
main.c:40:3: error: expected declaration or statement at end of input
40 | }
| ^
main.c: In function 'search':
main.c:40:3: error: expected declaration or s... |
s904951092 | p02240 | C | #include<stdio.h>
#define N 10000
int ID[N];
void def(int N){
int i;
for(i=0;i<N;i++){
ID[i]=i;
}
}
int find(int a){
if(a==ID[a]){
return a;
}
return ID[a]=find(ID[a]);
}
int Judge(int a, int b){
if(find(a)==find(b))return 1;
else return 0;
}
void unite(int a, int b){
a=find(a);
b=find(b);
if(a==b... | main.c:3:11: error: expected ';', ',' or ')' before numeric constant
3 | #define N 10000
| ^~~~~
main.c:7:14: note: in expansion of macro 'N'
7 | void def(int N){
| ^
main.c: In function 'unite':
main.c:29:17: error: break statement not within loop or switch
29 | if... |
s136678275 | p02240 | C | #define N 100000
#define white -1
int c[N][N], num[N], color[N], n, S[N];
void tansaku_2(int a, int b) {
int i, t, co, u;
S[0] = a;
t = 0;
co = 1;
while (t != co) {
u = S[t];
for (i = 0; i < num[u]; ++i) {
if (color[c[u][i]] == white){
color[c[u][i]] = ... | main.c: In function 'main':
main.c:38:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
38 | scanf("%d %d", &n, &m);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | #define N 100000
main.c:38:5: warn... |
s537136883 | p02240 | C | #include <stdio.h>
#define MAX 100000
#define WHITE 0
#define GRAY 1
#define BLACK 2
longint color[MAX];
longint memo[MAX];
longint v[MAX][MAX];
int dfs(int u, int t) {
longint stack[MAX];
int i = 0;
int j;
int judge = 0;
stack[0] = u;
color[u] = GRAY;
while (stack[0] != -1) {
u = stack[i];
... | main.c:6:1: error: unknown type name 'longint'; did you mean 'long int'?
6 | longint color[MAX];
| ^~~~~~~
| long int
main.c:7:1: error: unknown type name 'longint'; did you mean 'long int'?
7 | longint memo[MAX];
| ^~~~~~~
| long int
main.c:8:1: error: unknown type name 'longint'; did y... |
s188721977 | p02240 | C | #include <stdio.h>
#define MAX 100000
#define WHITE 0
#define GRAY 1
#define BLACK 2
long int color[MAX];
long int memo[MAX];
long int v[MAX][MAX];
int dfs(int u, int t) {
long int stack[MAX];
int i = 0;
int j;
int judge = 0;
stack[0] = u;
color[u] = GRAY;
while (stack[0] != -1) {
u = stack[i];... | main.c: In function 'main':
main.c:71:23: error: passing argument 1 of 'CC' from incompatible pointer type [-Wincompatible-pointer-types]
71 | ans[i] = CC(v, s, t, n);
| ^
| |
| long int (*)[100000]
main.c:40:12: note: expe... |
s750407872 | p02240 | C | #include<stdio.h>
#define MAX 100000
int a[MAX][MAX];
int color[MAX],stack[MAX],point=0;
void push(int d) {
stack[point]=d;
point++;
if(color[d]==0){
color[d]=1;
}
}
int pop(int d){
point--;
color[d]=2;
return stack[point];
}
int search(int s,int t,int n) {
int i,flag;
for (i = 0;i<MAX;i++) colo... | /tmp/cchANmYS.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `point' defined in .bss section in /tmp/cchANmYS.o
main.c:(.text+0x1a): relocation truncated to fit: R_X86_64_PC32 against symbol `stack' defined in .bss section in /tmp/cchANmYS.o
main.c:(.text+0x26): rel... |
s446815043 | p02240 | C | #include <stdio.h>
#define N 100000
int main(void)
{
int i,n,m,q,s,t,a[N]={0};
for(i=0;i<N;i++) a[i]=i;
scanf("%d %d",&n,&m);
for(i=0;i<m;i++){
scanf("%d %d",&s,&t);
if(a[s]==a[t]) a[t]=s;
}
scanf("%d",&q);
for(i0;i<q;i++){
scanf(%d %d",&s,&t);
if(a[s]==a[t]) printf("yes\n");
else printf("n... | main.c: In function 'main':
main.c:22:6: error: 'i0' undeclared (first use in this function); did you mean 'i'?
22 | for(i0;i<q;i++){
| ^~
| i
main.c:22:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:9: error: expected expression before '%' ... |
s346323120 | p02240 | C | #include <stdio.h>
#define N 100000
int main(void)
{
int i,n,m,q,s,t,a[N]={0};
for(i=0;i<N;i++) a[i]=i;
scanf("%d %d",&n,&m);
for(i=0;i<m;i++){
scanf("%d %d",&s,&t);
if(a[s]==a[t]) a[t]=s;
}
scanf("%d",&q);
for(i=0;i<q;i++){
scanf(%d %d",&s,&t);
if(a[s]==a[t]) printf("yes\n");
else printf("... | main.c: In function 'main':
main.c:24:9: error: expected expression before '%' token
24 | scanf(%d %d",&s,&t);
| ^
main.c:24:14: warning: missing terminating " character
24 | scanf(%d %d",&s,&t);
| ^
main.c:24:14: error: missing terminating " character
24 | scanf(%d %d",&... |
s838805433 | p02240 | C | #include <stdio.h>
#define N 100000
int search(int c)
{
if(c==a[c]) return c;
return a[c]=search(a[c]);
}
int main(void)
{
int i,n,m,q,s,t,a[N]={0};
for(i=0;i<N;i++) a[i]=i;
scanf("%d %d",&n,&m);
for(i=0;i<m;i++){
scanf("%d %d",&s,&t);
if(search(s)==search(t)) a[t]=s;
}
scanf("%d",&q);
for(i=0;... | main.c: In function 'search':
main.c:6:15: error: 'a' undeclared (first use in this function)
6 | if(c==a[c]) return c;
| ^
main.c:6:15: note: each undeclared identifier is reported only once for each function it appears in
|
s837708925 | p02240 | C | #include <stdio.h>
int i,j,n,e,M[100][100];
int prim(int n){
int u,,sum,mincost,d[100].p[100],color[100];
for(i=0;i<n;i++){
d[i]=(1<<21);
p[i]=-1;
color[i]=0;
}
d[0]=0;
while(1){
mincost=(1<<21);
u=-1;
for(i=0;i<n;i++){
if(mincost>d[i]&&color[i]!=2){
u=i;
... | main.c: In function 'prim':
main.c:6:9: error: expected identifier or '(' before ',' token
6 | int u,,sum,mincost,d[100].p[100],color[100];
| ^
main.c:9:5: error: 'd' undeclared (first use in this function)
9 | d[i]=(1<<21);
| ^
main.c:9:5: note: each undeclared identifier is repor... |
s931653985 | p02240 | C | #include<stdio.h>
#define Num 100000
int main(){
int i,x,y,n,m,z;
int a[Num];
for(i=0;i<Num;i++){
a[i] = i;
}
scanf("%d %d",&x,&y);
for(i=0;i<y;i++){
scanf("%d %d", &n,&m);
if(search(n) != search(m)){
a[search(m)] = search(n);
}
}
scanf("%d",&z);
for(i=0... | main.c: In function 'main':
main.c:16:10: error: implicit declaration of function 'search' [-Wimplicit-function-declaration]
16 | if(search(n) != search(m)){
| ^~~~~~
|
s785339363 | p02240 | C | #include<stdio.h>
#define Num 100000
int search(int c){
if(c == a[c])
return c;
return a[c] = search(a[c]);
}
int main(){
int i,x,y,n,m,z;
int a[Num];
for(i=0;i<Num;i++){
a[i] = i;
}
scanf("%d %d",&x,&y);
for(i=0;i<y;i++){
scanf("%d %d", &n,&m);
if(search(n) != sea... | main.c: In function 'search':
main.c:5:12: error: 'a' undeclared (first use in this function)
5 | if(c == a[c])
| ^
main.c:5:12: note: each undeclared identifier is reported only once for each function it appears in
|
s131813273 | p02240 | C | #include<stdio.h>
#define Num 100000
int a[Num]
int search(int c){
if(c == a[c])
return c;
return a[c] = search(a[c]);
}
int main(){
int i,x,y,n,m,z;
for(i=0;i<Num;i++){
a[i] = i;
}
scanf("%d %d",&x,&y);
for(i=0;i<y;i++){
scanf("%d %d", &n,&m);
if(search(n) != search... | main.c:4:11: error: expected ';' before 'int'
4 | int a[Num]
| ^
| ;
5 |
6 | int search(int c){
| ~~~
main.c: In function 'search':
main.c:7:12: error: 'a' undeclared (first use in this function)
7 | if(c == a[c])
| ^
main.c:7:12: note: ... |
s284270092 | p02240 | C | #include<stdio.h>
#define MAX 100000
#define NIL -1
int n;
int G[MAX], color[MAX]
void dfs(int r, int c)
{
color[r] = c;
while ()
void assignColor()
{
int id = 1;
for (i=0; i<n; i++)
color[i] = NIL;
for (u=0; u<n; u++){
if (color[u]==NIL)
dfs(u, id++);
}
}
int main()
{
... | main.c:8:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
8 | void dfs(int r, int c)
| ^~~~
|
s695492145 | p02240 | C | #include<stdio.h>
int main(){
int m, n, i, s, t;
scanf("%d %d",&n, &m);
int A[n][n];
for ( i = 0; i < n; i++ ) {
A[i][0] = i;
}
for ( i = 0; i < m; i++ ) {
scanf("%d %d", &s, &t);
A[s][i+1] = t; | main.c: In function 'main':
main.c:16:5: error: expected declaration or statement at end of input
16 | A[s][i+1] = t;
| ^
main.c:16:5: error: expected declaration or statement at end of input
|
s666143339 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100000
int matrix[MAX][MAX], *visit, *queue;
int bfs(int, int, int);
main()
{
int i, n, m, q, s, t;
scanf("%d%d", &n, &m);
visit = (int*)malloc(sizeof(int) * n);
queue = (int*)malloc(sizeof(int) * n);
for (i = 0; i < m; i++) {
... | main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
6 | main()
| ^~~~
|
s757981678 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100000
int matrix[MAX][MAX] = {0}, *visit, *queue;
int bfs(int, int, int);
main()
{
int i, n, m, q, s, t;
scanf("%d%d", &n, &m);
visit = (int*)malloc(sizeof(int) * n);
queue = (int*)malloc(sizeof(int) * n);
for (i = 0; i < m; i++) {
... | main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
6 | main()
| ^~~~
|
s631981639 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100000
int matrix[MAX][MAX] = {0}, *visit, *queue;
int bfs(int, int, int);
main()
{
int i, n, m, q, s, t;
scanf("%d%d", &n, &m);
visit = (int*)malloc(sizeof(int) * n);
queue = (int*)malloc(sizeof(int) * n);
for (i = 0; i < m; i++) {
... | main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
6 | main()
| ^~~~
|
s877428633 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define MAX 100000
int matrix[MAX][MAX] = {0}, *visit, *queue;
int bfs(int, int, int);
main()
{
int i, n, m, q, s, t;
scanf("%d%d", &n, &m);
visit = (int*)malloc(sizeof(int) * n);
queue = (int*)malloc(sizeof(int) * n);
for (i = 0; i < m; i++) {
... | main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
6 | main()
| ^~~~
|
s256587993 | p02240 | C | #include "stdio.h"
int JudgeYesNo(int s, int t);
int main()
{
int i=0;
int j=0;
int input=0;
int buff=0;
int N=0;
int M=0;
int SwithT[2];
int nFriend[100000];
int Q=0;
for(i = 0; i < 100000; i++)
{
nFriend[i]=i;
}
scanf("%d",&input);
if(input < 2 || in... | main.c: In function 'main':
main.c:50:28: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
50 | nFriend[SwithT[1]] = &nFriend[SwithT[0]];
| ^
main.c: In function 'JudgeYesNo':
main.c:76:8: error: 'nFriend' undeclared (first ... |
s147362784 | p02240 | C | #include "stdio.h"
int JudgeYesNo(int s, int t);
int main()
{
int i=0;
int j=0;
int input=0;
int buff=0;
int N=0;
int M=0;
int SwithT[2];
int nFriend[100000];
int Q=0;
for(i = 0; i < 100000; i++)
{
nFriend[i]=i;
}
scanf("%d",&input);
if(input < 2 || in... | main.c: In function 'main':
main.c:50:29: error: lvalue required as left operand of assignment
50 | &nFriend[SwithT[1]] = &nFriend[SwithT[0]];
| ^
|
s133947886 | p02240 | C | #include<stdio.h>
#include<stdlib.h>
#define LARGE 100000
int V,E;
int color=0;
int C[LARGE];
typedef struct list{
int id;
struct list *next;
}list;
list * makelist(int x){
list *new=malloc(sizeof(list));
new->id=x;
new->next=NULL;
return new;
}
void list_insert(list* L[],int x,list *new){
list **p=&L[x];
... | main.c: In function 'main':
main.c:95:31: error: expected statement before ')' token
95 | if(C[x]==C[y]))printf("yes\n");
| ^
main.c:96:17: error: 'else' without a previous 'if'
96 | else printf("no\n");
| ^~~~
|
s784519778 | p02240 | C++ | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX=100000;
static const int NIL=-1;
int n;
vector<int> g[MAX];
int color[MAX];
void dfs(int r,int c){
stack<int> s;
s.push(r);
color[r]=c;
while(!s.empty()){
int u=s.top();
s.pop();
for(int i=0;i<g[u].size()... | a.cc: In function 'void assignColor()':
a.cc:33:14: error: 'v' was not declared in this scope
33 | if(color[v]==NIL) dfs(u,id++);
| ^
|
s394272402 | p02240 | C++ | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX=100000;
static const int NIL=-1;
int n;
vector<int> g[MAX];
int color[MAX];
void dfs(int r,int c){
stack<int> s;
s.push(r);
color[r]=c;
while(!s.empty()){
int u=s.top();
s.pop();
for(int i=0;i<g[u].size()... | a.cc: In function 'void assignColor()':
a.cc:33:16: error: 'i' was not declared in this scope
33 | int v=g[u][i];
| ^
|
s912099983 | p02240 | C++ | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX=100000;
static const int NIL=-1;
int n;
vector<int> g[MAX];
int color[MAX];
void dfs(int r,int c){
stack<int> s;
s.push(r);
color[r]=c;
while(!s.empty()){
int u=s.top();
s.pop();
for(int i=0;i<g[u].size()... | a.cc: In function 'void assignColor()':
a.cc:33:16: error: 'i' was not declared in this scope
33 | int v=g[u][i];
| ^
|
s089234124 | p02240 | C++ | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;
int n;
vector<int> G[MAX];
int color[MAX];
void dfs(int r,int c){
stack<int> S;
S.push(r);
color[r] = c;
while(!S.empty()){
int u = S.top();
S.pop();
for(int i = 0;i<G... | a.cc: In function 'void dfs(int, int)':
a.cc:21:20: error: 'INL' was not declared in this scope; did you mean 'NIL'?
21 | if(color[v]==INL){
| ^~~
| NIL
a.cc: In function 'int main()':
a.cc:49:3: error: 'sin' was not declared in this scope
49 | sin>>q;
... |
s760262356 | p02240 | C++ | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;
int n;
vector<int> G[MAX];
int color[MAX];
void dfs(int r,int c){
stack<int> S;
S.push(r);
color[r] = c;
while(!S.empty()){
int u = S.top();
S.pop();
for(int i = 0;i<G... | a.cc: In function 'int main()':
a.cc:49:3: error: 'sin' was not declared in this scope
49 | sin>>q;
| ^~~
|
s508918041 | p02240 | C++ | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;
int n;
vector<int> G[MAX];
int color[MAX];
void dfs(int r, int c ) {
stack<int> S;
S.push(r);
color[r] = c;
while ( !S.empty() ) {
int u = S.top(); S.pop();
for ( int i = ... | a.cc: In function 'void dfs(int, int)':
a.cc:18:31: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
18 | for ( int i = 0; i < G[u].size; i++... |
s413953042 | p02240 | C++ | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;
int n;
vector<int> G[MAX];
int color[MAX];
void dfs(int r, int c ) {
stack<int> S;
S.push(r);
color[r] = c;
while ( !S.empty() ) {
int u = S.top(); S.pop();
for ( int i = ... | a.cc: In function 'int main()':
a.cc:54:12: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [4]')
54 | cout >> "yes" >> endl;
| ~~~~ ^~ ~~~~~
| | |
| | const char [4]
| std::ostream {... |
s598812610 | p02240 | C++ | def dfs(s):
global t
if s == t:
return True
DP[s]=1
for i in F[s]:
if not DP[i]:
if dfs(i):
return True
return False
n,m = [int(i) for i in input().split()]
F = [{}]*n
for _ in range(m):
i,j = [int(i) for i in input().split()]
F[i][j] = 1
... | a.cc:1:1: error: 'def' does not name a type
1 | def dfs(s):
| ^~~
a.cc:13:8: error: expected unqualified-id before ']' token
13 | F = [{}]*n
| ^
|
s679644470 | p02240 | C++ | import sys
sys.setrecursionlimit(10000)
def dfs(s):
global t
if s == t:
return True
DP[s]=1
for i in F[s]:
if not DP[i]:
if dfs(i):
return True
return False
n,m = [int(i) for i in input().split()]
F = [{} for i in range(n)]
for _ in range(m):
i,j ... | a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:15:9: error: expected unqualified-id before 'for'
15 | F = [{} for i in range(n)]
| ^~~
|
s237523339 | p02240 | C++ | import sys
sys.setrecursionlimit(50000)
def dfs(s):
global t
if s == t:
return True
DP[s]=1
for i in F[s]:
if not DP[i]:
if dfs(i):
return True
return False
n,m = [int(i) for i in input().split()]
F = [{} for i in range(n)]
for _ in range(m):
i,j ... | a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:15:9: error: expected unqualified-id before 'for'
15 | F = [{} for i in range(n)]
| ^~~
|
s521367493 | p02240 | 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
| |
s249921432 | p02240 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | a.cc: In function 'int main()':
a.cc:370:9: error: 'Q' was not declared in this scope
370 | SCAND(Q);
| ^
a.cc:120:31: note: in definition of macro 'SCAND'
120 | #define SCAND(x) scanf("%d",&(x))
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.