submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s123281006 | p02241 | C++ | #include<bits/stdc++.h>
using namespace std;
class UnionFind{
int N;
vector<int> par;
vector<int> rank;
public:
UnionFind(int N):N(N),par(N),rank(N,0){iota(par.begin(),par.end(),0);}
int find(int x);
void unite(int x,int y);
bool same(int x,int y){return find(x)==find(y);}
};
int Unio... | a.cc: In function 'int main()':
a.cc:73:16: error: 'a' was not declared in this scope
73 | if(a[i][j]==-1) continue;
| ^
|
s130597105 | p02241 | C++ |
class UnionFind{
int N;
vector<int> par;
vector<int> rank;
public:
UnionFind(int N):N(N),par(N),rank(N,0){iota(par.begin(),par.end(),0);}
int find(int x);
void unite(int x,int y);
bool same(int x,int y){return find(x)==find(y);}
};
int UnionFind::find(int x){
if(par[x]==x) return x... | a.cc:31:9: fatal error: UnionFind.hpp: No such file or directory
31 | #include"UnionFind.hpp"
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s696590872 | p02241 | C++ | #include <iostream>
#include <vector>
#include <queue>
#define rep(i,n) for(int i=0; i<(n); ++i)
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
int N;
int G[101][101];
bool used[101];
int prim()
{
int sum = 0;
priority_queue< pii, vector<pii>, greater<pii> > pq;
pq.push( ... | a.cc: In function 'int prim()':
a.cc:22:40: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
22 | if( tmp.fi == -1 || used[ tmp.se ]++ )continue;
| ~~~~~~~~~~~~~^
|
s034761028 | p02241 | C++ | #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int n;
int A[110][110];
int P[10010] = {0};
void init(int N){
for(int i=0;i<=N;++i) P[i] = i;
}
int root(int a){
if(P[a] == a) return a;
return (P[a] = root(P[a]));
}
bool is_same_set(int a,int b){
return root(a) ==... | a.cc:64:1: error: extended character 。 is not valid in an identifier
64 | 所要時間は45分程度。クラスカル法を回す部分の実装に少し苦戦した。
| ^
a.cc:64:1: error: extended character 。 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:40:46: error: 'M' was not declared in this scope
40 | ... |
s945917482 | p02241 | C++ | #include <iostream>
using namespace std;
#define MAX 100
static const int WHITE=0;
static const int GRAY=1;
static const int BLACK=2;
int n,d[MAX+10],p[MAX+10],color[MAX+10];
int W[MAX+10][MAX+10];
int prim()
{
int v,k,mini,flag,u=0;
for(int i=0;i<n;i++)
{
d[i]=INT_MAX;
p[i]=-1;
}
d[0]=0;
whil... | a.cc: In function 'int prim()':
a.cc:16:12: error: 'INT_MAX' was not declared in this scope
16 | d[i]=INT_MAX;
| ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include <iostream>
+++ |+#include <climits>
... |
s417718495 | p02241 | C++ | #include <iostream>
#include <limits>
using namespace std;
#define MAX 100
static const int WHITE=0;
static const int GRAY=1;
static const int BLACK=2;
int n,d[MAX+10],p[MAX+10],color[MAX+10];
int W[MAX+10][MAX+10];
int prim()
{
int v,k,mini,flag,u=0;
for(int i=0;i<n;i++)
{
d[i]=INT_MAX;
p[i]=-1;
... | a.cc: In function 'int prim()':
a.cc:17:12: error: 'INT_MAX' was not declared in this scope
17 | d[i]=INT_MAX;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <limits>
+++ |+#include <climits>
... |
s469157444 | p02241 | C++ | #include<iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1<<21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];
int prim() {
int u, minv;
int d[MAX], p[MAX], color[MAX];
for ( int i = 0; i < n; i++ ) {
d[i] = INFTY... | a.cc: In function 'int prim()':
a.cc:16:17: error: expected ';' before 'p'
16 | d[i] = INFTY
| ^
| ;
17 | p[i] = -1
| ~
|
s082215255 | p02241 | C++ | #include <stdio.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
int main(void) {
int n, i, j, ans = 0;
scanf("%d", &n);
int a[n][n];
char f[n];
rep(i, n) rep(j, n) scanf("%d", &a[i][j]);
rep(i, n) f[i] = 0;
f[0] = 1;
rep(i, n - 1) {
int min = 10000, minx, miny;
rep(j, n) {
rep(k, n) {
... | a.cc: In function 'int main()':
a.cc:16:38: error: expected primary-expression before '>' token
16 | if(f[j] && !f[k] && a[j][k] => 0 && a[j][k] < min) min = a[j][k], minx = j, miny = k;
| ^
|
s595038372 | p02241 | 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
| |
s355264147 | p02241 | 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
| |
s782480640 | p02241 | 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
| |
s183810482 | p02241 | C++ | #include <iostream>
#include <queue>
using namespace std;
using pii = pair<int, int>;
struct Graph{
int v_size;
vector<vector<pii>> adj;
Graph(const int v_size):v_size(v_size){
this->adj.resize(v_size);
}
void add_edge(const int s, const int t, const int w){
this->adj[s].emplace_back(pii(t, w... | a.cc: In function 'int mst(const Graph&)':
a.cc:22:21: error: 'INT_MAX' was not declared in this scope
22 | constexpr int INF{INT_MAX};
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <queue>
... |
s022170365 | p02241 | C++ | #include <iostream>
#include <queue>
using namespace std;
using pii = pair<int, int>;
struct Graph{
int v_size;
vector<vector<pii>> adj;
Graph(const int v_size):v_size(v_size){
this->adj.resize(v_size);
}
void add_edge(const int s, const int t, const int w){
this->adj[s].emplace_back(pii(t, w... | a.cc: In function 'int mst(const Graph&)':
a.cc:22:21: error: 'INT_MAX' was not declared in this scope
22 | constexpr int INF{INT_MAX};
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <queue>
... |
s907416222 | p02241 | C++ | #include <iostream>
#include <queue>
using namespace std;
using pii = pair<int, int>;
struct Graph{
int v_size;
vector<vector<pii>> adj;
Graph(const int v_size):v_size(v_size){
this->adj.resize(v_size);
}
void add_edge(const int s, const int t, const int w){
this->adj[s].emplace_back(pii(t, w... | a.cc: In function 'int mst(const Graph&)':
a.cc:22:21: error: 'INT_MAX' was not declared in this scope
22 | constexpr int INF{INT_MAX};
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <queue>
... |
s266706378 | p02241 | C++ | #include <stdio.h>
#include <stdint.h>
#include <iostream>
#include <fstream>
#include <cassert>
#include <climits>
#include <vector>
#include <string>
using namespace std;
#define DEBUG (0)
#if DEBUG
#define DPRINTF(...) do { \
printf("D(L%d) %s: ", __LINE__, __func__); \
printf(__VA_ARGS__); \
} while (f... | a.cc: In constructor 'VisitData::VisitData(int)':
a.cc:47:7: error: 'memset' was not declared in this scope
47 | memset(visited_, 0, kMaxN);
| ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
8 | #include <vector>
+++ |+... |
s854661632 | p02241 | C++ | import java.util.ArrayList;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;
@SuppressWarnings("unchecked")
class MinCostTree{
int N;
class Edge{
int from,to;
long w;
Edge(int from,int to,long w){this.from=from;this.to=to;this.w=w;}
}
List<Edge> ... | a.cc:6:1: error: stray '@' in program
6 | @SuppressWarnings("unchecked")
| ^
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.ArrayList;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.ut... |
s823875687 | p02241 | C++ | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int root(int i,vector<int> &parent){
if(parent[i]==-1){
//親がいない時
return i;
}else{
int result=root(parent[i],parent);
parent[i]=result; //パス圧縮
return result;
}
}
void unite(int x,int y,vecto... | a.cc: In function 'int main()':
a.cc:44:5: error: 'sort' was not declared in this scope; did you mean 'short'?
44 | sort(bridges.begin(),bridges.end());
| ^~~~
| short
|
s428122020 | p02241 | C++ | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int root(int i,vector<int> &parent){
if(parent[i]==-1){
//親がいない時
return i;
}else{
int result=root(parent[i],parent);
parent[i]=result; //パス圧縮
return result;
}
}
void unite(int x,int y,vecto... | a.cc: In function 'int main()':
a.cc:44:5: error: 'sort' was not declared in this scope; did you mean 'short'?
44 | sort(bridges.begin(),bridges.end());
| ^~~~
| short
|
s149879563 | p02241 | C++ | #include<iostream>
using namespace std;
static const int MAX=100;
static const int INFTY=(1<<21);
static const int white=0;
static const int gray=1;
static const int black=2;
int n,M[MAX][MAX];
int prim(){
int n,minv;
int d[MAX],p[MAX],color[MAX];
for(int i=0;i<n;i++){
d[i]=INFTY;
p[i]=-1;
color[i]=whi... | a.cc: In function 'int prim()':
a.cc:22:9: error: 'u' was not declared in this scope
22 | u=-1;
| ^
a.cc:32:26: error: 'balck' was not declared in this scope; did you mean 'black'?
32 | if(color[v]!=balck&&M[u][v]!=INFTY){
| ^~~~~
| ... |
s949723060 | p02241 | C++ | #include<iostream>
using namespace std;
static const int MAX = 100;
static const int NIL = (1 << 21);
static const int WHITE = 0;
static const int GREY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];;
int prim() {
int u; minv;
int d[MAX], p[MAX], color [MAX]
for (int i = 0; i < n; i++) {
d[i] = INF... | a.cc: In function 'int prim()':
a.cc:15:10: error: 'minv' was not declared in this scope
15 | int u; minv;
| ^~~~
a.cc:18:3: error: expected initializer before 'for'
18 | for (int i = 0; i < n; i++) {
| ^~~
a.cc:18:19: error: 'i' was not declared in this scope
18 | for (int i = 0; ... |
s041854663 | p02241 | C++ | #include<iostream>
using namespace std;
static const int MAX = 100;
static const int NIL = (1 << 21);
static const int WHITE = 0;
static const int GREY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];;
int prim() {
int u; minv;
int d[MAX], p[MAX], color [MAX]
for (int i = 0; i < n; i++) {
d[i] = INF... | a.cc: In function 'int prim()':
a.cc:15:10: error: 'minv' was not declared in this scope
15 | int u; minv;
| ^~~~
a.cc:18:3: error: expected initializer before 'for'
18 | for (int i = 0; i < n; i++) {
| ^~~
a.cc:18:19: error: 'i' was not declared in this scope
18 | for (int i = 0; ... |
s810716102 | p02241 | C++ | #include<iostream>
using namespace std;
static const int MAX = 100;
static const int NIL = (1 << 21);
static const int WHITE = 0;
static const int GREY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];;
int prim() {
int u, minv;
int d[MAX], p[MAX], color [MAX]
for (int i = 0; i < n; i++) {
d[i] = INF... | a.cc: In function 'int prim()':
a.cc:18:3: error: expected initializer before 'for'
18 | for (int i = 0; i < n; i++) {
| ^~~
a.cc:18:19: error: 'i' was not declared in this scope
18 | for (int i = 0; i < n; i++) {
| ^
a.cc:27:12: error: 'INFTY' was not declared in this scope
... |
s263940283 | p02241 | C++ | #include<iostream>
using namespace std;
static const int MAX = 100;
static const int NIL = (1 << 21);
static const int WHITE = 0;
static const int GREY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];;
int prim() {
int u, minv;
int d[MAX], p[MAX], color [MAX];
for (int i = 0; i < n; i++) {
d[i] = IN... | a.cc: In function 'int prim()':
a.cc:19:12: error: 'INFY' was not declared in this scope
19 | d[i] = INFY;
| ^~~~
a.cc:27:12: error: 'INFTY' was not declared in this scope
27 | minv = INFTY;
| ^~~~~
a.cc:39:21: error: 'i' was not declared in this scope
39 | for (in... |
s780942128 | p02241 | C++ | #include<iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GREY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];;
int prim() {
int u, minv;
int d[MAX], p[MAX], color [MAX];
for (int i = 0; i < n; i++) {
d[i] = ... | a.cc: In function 'int prim()':
a.cc:39:21: error: 'i' was not declared in this scope
39 | for (int v = 0; i < n; i++) {
| ^
a.cc:44:22: error: 'GRAY' was not declared in this scope; did you mean 'GREY'?
44 | color[v] = GRAY;
| ^~~~
| ... |
s186297416 | p02241 | C++ | #include<iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GREY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];;
int prim() {
int u, minv;
int d[MAX], p[MAX], color [MAX];
for (int i = 0; i < n; i++) {
d[i] = ... | a.cc: In function 'int prim()':
a.cc:39:28: error: 'i' was not declared in this scope
39 | for (int v = 0; v < n; i++) {
| ^
a.cc:44:22: error: 'GRAY' was not declared in this scope; did you mean 'GREY'?
44 | color[v] = GRAY;
| ^~~~
|... |
s010484494 | p02241 | C++ |
#include<iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GREY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];;
int prim() {
int u, minv;
int d[MAX], p[MAX], color [MAX];
for (int i = 0; i < n; i++) {
d[i] =... | a.cc: In function 'int prim()':
a.cc:45:22: error: 'GRAY' was not declared in this scope; did you mean 'GREY'?
45 | color[v] = GRAY;
| ^~~~
| GREY
a.cc:53:24: error: expected ';' before '}' token
53 | sum += M[i][p[i]]
| ... |
s747919219 | p02241 | C++ | #include<iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[MAX][MAX];;
int prim() {
int u, minv;
int d[MAX], p[MAX], color [MAX];
for (int i = 0; i < n; i++) {
d[i] = ... | a.cc: In function 'int prim()':
a.cc:52:24: error: expected ';' before '}' token
52 | sum += M[i][p[i]]
| ^
| ;
53 | }
| ~
|
s500336802 | p02241 | C++ | #include <iostream>
using namespace std;
static const int MAX =100;
static const int INFTY =(1<<21);
static const int WHITE =0;
static const int GRAY =1;
static const int BLACK =2;
int n, M[MAX][MAX];
int prim(){
int u,minv;
int d[MAX],p[MAX],color[MAX];
for(int i=0;i<n;i++){
d[i]=INFTY;
p[i]=-1;
c... | a.cc: In function 'int prim()':
a.cc:34:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
34 | if(color != BLACK && M[u][v]!=INFTY){
| ~~~~~~^~~~~~~~
|
s577887260 | p02241 | C++ | #include <iostream>
using namespace std;
static const int MAX = 100;
static const int INFTY = (1<<21);
static const int WHITE = 0;
static const int GRAY = 0;
static const int BLACK = 0;
int n, M[MAX][MAX];
int prim() {
int d[n], p[n];
for(int i=0; i<n; i++) {
color[i] = WHITE;
d[u] = INFT... | a.cc: In function 'int prim()':
a.cc:15:9: error: 'color' was not declared in this scope; did you mean 'tolower'?
15 | color[i] = WHITE;
| ^~~~~
| tolower
a.cc:16:11: error: 'u' was not declared in this scope
16 | d[u] = INFTY;
| ^
a.cc:22:23: error: 'IN... |
s238911688 | p02242 | Java | test
| Main.java:1: error: reached end of file while parsing
test
^
1 error
|
s619613121 | p02242 | Java | int main | Main.java:1: error: class, interface, enum, or record expected
int main
^
1 error
|
s814472094 | p02242 | Java | import java.util.ArrayList;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;
public class Dijkstra {
int[] distTo = null;
int[] parentOf = null;
public Dijkstra(ArrayList<ArrayList<Edge>> G){
distTo = new int[G.size()];
Arrays.fill(distTo, Integer.MAX_VALU... | Main.java:6: error: class Dijkstra is public, should be declared in a file named Dijkstra.java
public class Dijkstra {
^
1 error
|
s103714705 | p02242 | C | #include<stdio.h>
#define MAX 100
#define INFTY (1<<21)
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n,M[MAX][MAX];
void dijkstra(){
int i,v,minv;
int d[MAX],color[MAX];
for(i = 0; i< n ; i++;){
d[i] = INFTY;
color[i] = WHITE;
}
d[0] = 0;
color[0] = GRAY;
while(1){
minv = INFTY;
... | main.c: In function 'dijkstra':
main.c:14:24: error: expected ')' before ';' token
14 | for(i = 0; i< n ; i++;){
| ~ ^
| )
main.c:42:5: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
42 | print... |
s972621329 | p02242 | C | #include<stdio.h>
#define MAX 100
#define INFTY (1<<21)
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n,M[MAX][MAX];
void dijkstra(){
int i,v,minv;
int d[MAX],color[MAX];
for(i = 0; i< n ; i++){
d[i] = INFTY;
color[i] = WHITE;
}
d[0] = 0;
color[0] = GRAY;
while(1){
minv = INFTY;
i... | main.c: In function 'dijkstra':
main.c:42:5: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
42 | print("%d %d\n",i,d[i] == INFTY?-1:d[i]);
| ^~~~~
| printf
|
s961469527 | p02242 | C | #include<stdio.h>
#define MAX 100
#define INFTY (1<<21)
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n,M[MAX][MAX];
void dijkstra(){
int i,v,minv;
int d[MAX],color[MAX];
for(i = 0; i< n ; i++){
d[i] = INFTY;
color[i] = WHITE;
}
d[0] = 0;
color[0] = GRAY;
while(1){
minv = INFTY;
i... | main.c: In function 'dijkstra':
main.c:42:5: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
42 | print("%d %d\n",i,(d[i] == INFTY?-1:d[i]));
| ^~~~~
| printf
|
s548214199 | p02242 | C | #include<cstdio>
#include<queue>
#include<utility>
#include<vector>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 250;
const int MAXM = 1000;
int n, m;
int vis[MAXN];
struct Edge{
int to, weight, next;
}edge[MAXM];
int head[MAXN];
int cnt;
int d[MAXN];
void addEdge(int from, int to, int weight){
e... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s259743531 | p02242 | C | #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int inf=0x3f3f3f3f;
int map1[109][109];
int flag[109];
int result[109];
int main(){
int n;
int u,v,w,k;
while(scanf("%d",&n)!=EOF){
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s309262455 | p02242 | C | #include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
#define maxn 0x3f3f3f3f
int e[1005][1005],vis[1005][1005];
int k,i,j,n,m;
int a,b,x;
int X,Y;
int main() {
while(~scanf("%d%d",&n,&m)&&n&&m) {
//初始化
for(i=0; i<n; i++) {
for(j=0; j<n; j++) {
if(i==j) e[i][j]=0;
else e[i][j]=max... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s192669163 | p02242 | C | #include <stdio.h>
#define INF 100000000
#define N 100
int n;
int size[N];
int to[N][N];
int cost[N][N];
int dist[N];
void DFS(int,int);
void DFS(int p, int c){
int i;
dist[p] = c;
for(i=0;i<size[p];i++){
if(dist[to[p][i]] > c + cost[p][i]) dfs(to[p][i], c + cost[p][i]);
}
}
main(int argc,char *argv[... | main.c: In function 'DFS':
main.c:17:41: error: implicit declaration of function 'dfs' [-Wimplicit-function-declaration]
17 | if(dist[to[p][i]] > c + cost[p][i]) dfs(to[p][i], c + cost[p][i]);
| ^~~
main.c: At top level:
main.c:21:1: error: return type defaults to 'i... |
s617286050 | p02242 | C | #include <stdio.h>
#define INF 100000000
#define N 100
int n;
int size[N];
int to[N][N];
int cost[N][N];
int dist[N];
void DFS(int,int);
main(int argc,char *argv[]){
int i, j;
scanf("%d", &n);
for(i=0;i<n;i++){
int u;
scanf("%d", &u);
scanf("%d", &size[u]);
for(j=0;j<size[u];j++){
scan... | main.c:13:1: error: return type defaults to 'int' [-Wimplicit-int]
13 | main(int argc,char *argv[]){
| ^~~~
main.c: In function 'main':
main.c:26:3: error: implicit declaration of function 'dfs' [-Wimplicit-function-declaration]
26 | dfs(0, 0);
| ^~~
|
s447654475 | p02242 | C | gggggg | main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
1 | gggggg
| ^~~~~~
|
s868640519 | p02242 | C | #include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#define WHITE 0
#define BRACK 1
#define GRAY 2
#define NILL -1
static const int N = 500;
static const int INFTY = (1<<21);
int check(int x,int A[],int c){
int i;
for(i=0;i<c;i++){
if(A[i]==x)return 0;
}
return 1;
}
main(){
int d[N];
int e1[N];... | main.c:22:1: error: return type defaults to 'int' [-Wimplicit-int]
22 | main(){
| ^~~~
main.c: In function 'main':
main.c:40:7: error: 'A' undeclared (first use in this function)
40 | A[i][j]=WHITE;
| ^
main.c:40:7: note: each undeclared identifier is reported only once for each function i... |
s585747522 | p02242 | C | #include<stdio.h>
return 0; | main.c:3:1: error: expected identifier or '(' before 'return'
3 | return 0;
| ^~~~~~
|
s262161619 | p02242 | C | #include<stdio.h>
static const int MAX = 500;
static const int INFTY = (1<<21);
main(){
int n, i, j;
int u,v,c,k,l;
int M[MAX][MAX],N[MAX],O[MAX];
scanf("%d", &n);
for ( i = 0; i< n; i++ ){
for ( j = 0; j < n; j++ ){
M[i][j] = INFTY;
}
}
for ( i = 0; i < n; i++ ){
scanf("%d %d", &u, ... | main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
6 | main(){
| ^~~~
main.c: In function 'main':
main.c:60:27: error: 'd' undeclared (first use in this function)
60 | printf("%d %d\n", i, (d[i]==INFTY?-1:d[i]));
| ^
main.c:60:27: note: each undeclared ide... |
s879901067 | p02242 | C | #include<stdio.h>
static const int MAX = 500;
static const int INFTY = (1<<21);
main(){
int n, i, j, e, sum;
int u;
int M[100][100];
int key[100];
scanf("%d", &n);
for ( i = 0; i< n; i++ ){
for ( j = 0; j < n; j++ ){
scanf("%d", &e);
M[i][j] = (e==-1)?INFTY:e;
}
}
for(u... | main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
6 | main(){
| ^~~~
main.c: In function 'main':
main.c:29:5: error: 'pi' undeclared (first use in this function); did you mean 'i'?
29 | pi[u] =NIL;
| ^~
| i
main.c:29:5: note: each undeclared identifier is reported on... |
s654164379 | p02242 | C | #include<stdio.h>
#define N 100
static const int MAX = 500;
static const int INFTY = (1<<21);
main(){
int l, i, j, x, v,c=0,k=0;
int u = 0,mincost = 0;
int cost[N];
int d[N];
int p[N],M[N][N];
scanf("%d", &l);
for ( i = 0; i< l; i++ ){
for ( j = 0; j < l; j++ ){
M[i][j] = INFTY;
... | main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int]
8 | main(){
| ^~~~
main.c: In function 'main':
main.c:31:15: error: 'n' undeclared (first use in this function)
31 | for(i=0;i < n;i++){
| ^
main.c:31:15: note: each undeclared identifier is reported only once for each ... |
s594920923 | p02242 | C | #include<stdio.h>
static const int MAX = 500;
static const int INFTY = (1<<21);
main(){
int n, i, j,u,v,k,c;
/**/
int M[MAX][MAX],d[MAX],k[MAX],p[MAX];
/**/
scanf("%d", &n);
for ( i = 0; i< n; i++ ){
for ( j = 0; j < n; j++ ){
M[i][j] = INFTY;
}
}
for ( i = 0; i < n; i++ ){
scanf("%... | main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
6 | main(){
| ^~~~
main.c: In function 'main':
main.c:9:26: error: conflicting types for 'k'; have 'int[MAX]'
9 | int M[MAX][MAX],d[MAX],k[MAX],p[MAX];
| ^
main.c:7:19: note: previous declaration of 'k' with... |
s615055782 | p02242 | C | #include<stdio.h>
void koria(int,int);
void koria(int i, int c){
printf("%d %d\n", i, c);
}
static const int MAX = 500;
static const int INY = (1<<21);
int main(){
int n;
int i;
int j;
int u;
int v;
int c;
int k;
int min = INY;
int M[MAX][MAX];
int cost[MAX];
int vis[MAX];
int p[MAX];
... | main.c: In function 'main':
main.c:71:3: error: expected expression before ')' token
71 | + )
| ^
main.c:71:3: error: expected statement before ')' token
main.c:81:1: error: expected declaration or statement at end of input
81 | }
| ^
main.c:81:1: error: expected declaration or statement at end of i... |
s788702158 | p02242 | C | #include<stdio.h>
static const int MAX = 500;
static const int INY = (1<<21);
int main(){
int n;
int i;
int j;
int u;
int v;
int c;
int k;
int min = INY;
int M[MAX][MAX];
int cost[MAX];
int vis[MAX];
int p[MAX];
scanf("%d", &n);
for ( i = 0; i< n; i++ ){
for ( j = 0; j < n; j++... | main.c: In function 'main':
main.c:77:6: error: implicit declaration of function 'koria' [-Wimplicit-function-declaration]
77 | koria(i,c);
| ^~~~~
|
s156789512 | p02242 | C | #include<stdio.h>
void koria(int,int);
void koria(int i, int c){
printf("%d \n, c);
}
static const int MAX = 500;
static const int INY = (1<<21);
int main(){
int n;
int i;
int j;
int u;
int v;
int c;
int k;
int min = INY;
int M[MAX][MAX];
int cost[MAX];
int vis[MAX];
int p[MAX];
sca... | main.c: In function 'koria':
main.c:6:9: warning: missing terminating " character
6 | printf("%d \n, c);
| ^
main.c:6:9: error: missing terminating " character
6 | printf("%d \n, c);
| ^~~~~~~~~~~
main.c:7:1: error: expected expression before '}' token
7 | }
| ^
main.c:6:... |
s442234825 | p02242 | C | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define WHITE 0
#define BRACK 1
int **matrix;
int *d;
int *parent;
int *color;
void dijkstra(int);
int main()
{
int n,i,j,k,u,v;
scanf("%d",&n);
color = malloc(n * sizeof(int ));
d = malloc(n * sizeof(int ));
parent = malloc(n * sizeof(int... | main.c: In function 'dijkstra':
main.c:77:26: error: 'BLACK' undeclared (first use in this function); did you mean 'BRACK'?
77 | if(color[i] != BLACK && d[i] < mincost)
| ^~~~~
| BRACK
main.c:77:26: note: each undeclared identifier is reported o... |
s166211588 | p02242 | C | typedef struct{
int u;
int k;
int v[100];
int c[100];
int used;
int cost;
} WeightedGraph;
WeightedGraph G[100];
void SSSP(int);
main(){
int i, j, n, u, k;
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d %d", &G[i].u, &G[i].k);
for(j = 0; j < G[i].k; j++){
scanf("%d %d", &G[i].v[j],... | main.c:12:1: error: return type defaults to 'int' [-Wimplicit-int]
12 | main(){
| ^~~~
main.c: In function 'main':
main.c:14:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
14 | scanf("%d", &n);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declara... |
s137714427 | p02242 | C | #include<stdio.h> | /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
|
s238292404 | p02242 | C | #include <stdio.h>
#define N 101
#define INF 150000
int main(){
int i, j, min, x, y, z;
int M[N][N];
int color[N], d[N];
scanf("%d", &n);
for(i = 0; i < n; i++){
color[i] = 0;
d[i] = INF;
for(j = 0; j < n; j++){
M[i][j] = -1;
}
}
for(i = 0; i < n; i++){
scanf("%d %d", &x, &y... | main.c: In function 'main':
main.c:11:16: error: 'n' undeclared (first use in this function)
11 | scanf("%d", &n);
| ^
main.c:11:16: note: each undeclared identifier is reported only once for each function it appears in
|
s706302139 | p02242 | C |
#include <stdio.h>
#include <stdlib.h>
#define INFTY (1 << 21)
#define N 100
#define BLACK 1
#define WHITE 0
int main(){
int i,j,n,v,c,v1,c1;
int G[N][N],color[N],d[N],p[N];
int mincost,u;
for(i = 0;i < N;i++){
for(j = 0;j < N;j++){
G[i][j] = -1;
}
}
scanf("%d",&n);
for(i = 0;i < n;i++){
... | main.c: In function 'main':
main.c:57:1: error: expected declaration or statement at end of input
57 | }
| ^
|
s199530161 | p02242 | C | #include <stdio.h>
#include <limits.h>
#define WHITE 0
#define BLACK 1
#define NILL -1
#define N 1000
int d[N], w[N][N], int color[N], v;
int main(){
int n, i, j, u, k, s = 0, mincost;
scanf("%d",&n);
for(i = 0;i < n; i++){
for(j = 0;j < n; j++){
w[i][j] = INT_MAX;
}
}
for(i = 0; i < n; ... | main.c:8:20: error: expected identifier or '(' before 'int'
8 | int d[N], w[N][N], int color[N], v;
| ^~~
main.c: In function 'main':
main.c:23:5: error: 'color' undeclared (first use in this function)
23 | color[i] = 0;
| ^~~~~
main.c:23:5: note: each undeclared identifier... |
s961603818 | p02242 | C | #include<stdio.h>
static const int INFTY = (1<<21);
main(){
int n, i, j,u,v,t,k,m;
int M[501][501],a[501],t[501];
scanf("%d", &n);
for ( i = 0; i< n; i++ ){
for ( j = 0; j < n; j++ ){
M[i][j] = INFTY;
}
}
for (i = 0; i<n; i++){
scanf("%d %d", &u, &k);
for (j = 0; j<k; j++){
... | main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
4 | main(){
| ^~~~
main.c: In function 'main':
main.c:6:26: error: conflicting types for 't'; have 'int[501]'
6 | int M[501][501],a[501],t[501];
| ^
main.c:5:19: note: previous declaration of 't' with type '... |
s828630148 | p02242 | C | #include<stdio.h>
static const int INFTY = (1<<21);
main(){
int n, i, j,u,v,t,k,m;
int M[501][501],a[501],t[501];
scanf("%d", &n);
for ( i = 0; i< n; i++ ){
for ( j = 0; j < n; j++ ){
M[i][j] = INFTY;
}
}
for (i = 0; i<n; i++){
scanf("%d %d", &u, &k);
for (j = 0; j<k; j++){
... | main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
4 | main(){
| ^~~~
main.c: In function 'main':
main.c:6:26: error: conflicting types for 't'; have 'int[501]'
6 | int M[501][501],a[501],t[501];
| ^
main.c:5:19: note: previous declaration of 't' with type '... |
s691877801 | p02242 | C | #include<stdio.h>
#define WHITE 1
#define BLACK 0
int main(){
int d[100], color[100], w[100][100],i, j, v, c,n, u, k,min;
scanf("%d",&n);
for(i = 0; i < n; i++){
for(j = 0; j < n; j++){
w[i][j] = -1;
}
}
for(i = 0; i < n; i++){
scanf("%d %d",&u, &k);
for(j = 0; j < k; j++){
... | main.c: In function 'main':
main.c:45:17: error: expected expression before '>' token
45 | if(d[v]+1=> d[u] + w[u][v]) d[v] = d[u] + w[u][v];
| ^
|
s887382271 | p02242 | C | #define N 2000
void MSTPrim();
static const int MAX=500;
static const int INFTY=(1<<21);
int key[A], M[A][A], p[A], S[A], d[A], n, sum;
int main(){
int i, j, u, k, v, c;
scanf("%d", &n);
for (i=0; i<n; i++){
for (j=0; j<n; j++){
M[i][j]=INFTY;
}
}
for (i=0; i<n; i++){
scanf("%d %d", &u, ... | main.c:8:9: error: 'A' undeclared here (not in a function)
8 | int key[A], M[A][A], p[A], S[A], d[A], n, sum;
| ^
main.c: In function 'main':
main.c:12:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
12 | scanf("%d", &n);
| ^~~~~
main.c:1:1: note: incl... |
s542285443 | p02242 | C | include<stdio.h>
#define NIL -1
#define A 101
#define N 2000
void MSTPrim();
static const int MAX=500;
static const int INFTY=(1<<21);
int key[A], M[A][A], p[A], S[A], d[A], n, sum;
int main(){
int i, j, u, k, v, c;
scanf("%d", &n);
for (i=0; i<n; i++){
for (j=0; j<n; j++){
M[i][j]=INFTY;
}
}... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'main':
main.c:16:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
16 | scanf("%d", &n);
| ^~~~~
main.c:1:1: note: include '... |
s615883147 | p02242 | C | #include <stdio.h>
#define MAX 100
int main(){
int n,i,j,sum=0,tmp=0,u[MAX],k[MAX],v[MAX],c[MAX];
scanf("%d",&n);
for (i =0 ;i < n ;i++){
scanf("%d%d",&u[i],&k[i]);
for ( j = 0 ;j < k; j++){
scanf("%d%%d",u[j],c[j]);
}
}
for (i = 0; i < n;i++){
if(u[i] == 0){
printf("%d %d",&u[i],&u[i])... | main.c: In function 'main':
main.c:9:20: warning: comparison between pointer and integer
9 | for ( j = 0 ;j < k; j++){
| ^
main.c:20:3: error: expected declaration or statement at end of input
20 | }
| ^
|
s494008190 | p02242 | C | #include<stdio.h>
int n,size[101],t[101][101],cost[101][101],distance[101];
void spp(int x,int y){
int i;
distance[x]=y;
for(i=0;i<size[x];i++){
if(distance[t[x][i]]>y+cost[x][i]) spp(t[x][i],y+cost[x][i]);
}
}
int main(){
int i,j;
scanf("%d",&n);
for(i=0;i<n;i++){
int a;
scanf("%d",&a);
... | main.c: In function 'main':
main.c:32:22: error: request for member 'distance' in something not a structure or union
32 | printf("%d%d\n",i.distance[i]);
| ^
|
s512312099 | p02242 | C | #include<stdio.h>
#define MAX 100
#define INFTY 100000000000
#define WHITE 0
#define GAY 1
#define BLACK 2
int n,M[MAX][MAX];
void dijkstra(){
int minv,i,v;
int d[MAX],clor[MAX];
for(i=0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
}
int u;
d[0]=0;
color[0]=GRAY;
while(1){
minv=INFTY;
u=-1;
for(i=0;i<n;i... | main.c: In function 'dijkstra':
main.c:4:15: warning: overflow in conversion from 'long int' to 'int' changes value from '100000000000' to '1215752192' [-Woverflow]
4 | #define INFTY 100000000000
| ^~~~~~~~~~~~
main.c:16:22: note: in expansion of macro 'INFTY'
16 | d[i]=INFTY;... |
s415194989 | p02242 | C | #include<stdio.h>
#define MAX 100
#define INFTY 10000000
int n,M[MAX][MAX];
void kbtit(){
int minv,i,v,u;
int d[MAX],color[MAX];
for(i = 0;i < n;i++){
d[i] = INFTY;
color[i] = 0;
}
d[0] = 0;
color[0] = 1;
while(1){
minv = INFTY;
u = -1;
for(i = 0;i < n;i++){
if(minv > d[i] && color[i] != 2){
u =i;
minv = d[i];
}
}... | main.c: In function 'main':
main.c:43:9: error: 'j' undeclared (first use in this function)
43 | for(j=0;j<n;j++){
| ^
main.c:43:9: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'kbtit':
main.c:60:1: error: expected declaration or stateme... |
s449829447 | p02242 | C | #include<stdio.h>
#include<stdlib.h>
#define N 100001
#define nil -1
#define WHITE 0
#define BLACK 1
#define INF 9999999
typedef struct{
int prev,next,cost;
}Edge;
int n,d[N];
Edge e[500000];
void dijkstra(int);
void initializeSingleSource(int);
int main(){
int i,j,u,k,c,ed=0,v,w=INF,r;
scanf("%d",&n);
... | main.c: In function 'dijkstra':
main.c:48:4: error: expected declaration or statement at end of input
48 | d[i]=INF;
| ^
main.c:48:4: error: expected declaration or statement at end of input
|
s906302924 | p02242 | C | #include<stdio.h>
static const int N=500;
static const int INFTY=(1<<21);
main(){
int k,i,j,a,b,sum;
int M[100][100];
int key[100];
scanf("%d",&k);
for(i=0;i<k;i++){
for(j=0;j<k;j++){
scanf("%d",&a);
M[i][j]=(a==-1)?INFTY:a;
}
}
for(b=0;b<k;b++){
key[b]=1000;
pi[b]=NIL;
... | main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
6 | main(){
| ^~~~
main.c: In function 'main':
main.c:22:5: error: 'pi' undeclared (first use in this function); did you mean 'i'?
22 | pi[b]=NIL;
| ^~
| i
main.c:22:5: note: each undeclared identifier is reported onl... |
s908564737 | p02242 | C | #include <stdio.h>
#define N 100
#define INF 10000000
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, A[N][N];
void dijkstra();
int main(){
int i, j, u, t, v, c;
scanf("%d",&n);
for(i=0; i<n; i++){
for(j=0; j<n; j++){
A[i][j] = INF;
}
}
for(i=0; i<n; i++){
scanf("%d%d",&u,&t);
... | main.c: In function 'dijkstra':
main.c:48:34: error: 'minc' undeclared (first use in this function)
48 | if(c[i] != BLACK && d[i] < minc){
| ^~~~
main.c:48:34: note: each undeclared identifier is reported only once for each function it appears in
|
s617874591 | p02242 | C | #include <stdio.h>
#define N 100
#define INF 10000000
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, A[N][N];
void dijkstra();
int main(){
int i, j, u, t, v, c;
scanf("%d",&n);
for(i=0; i<n; i++){
for(j=0; j<n; j++){
A[i][j] = INF;
}
}
for(i=0; i<n; i++){
scanf("%d%d",&u,&t);
... | main.c: In function 'dijkstra':
main.c:49:9: error: 'minc' undeclared (first use in this function)
49 | minc = d[i];
| ^~~~
main.c:49:9: note: each undeclared identifier is reported only once for each function it appears in
|
s023851119 | p02242 | C | include<stdio.h>
#define INF 1000000
#define NIL -1
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n;
int M[100][100];
void dkr(){
int d[100];
int color[100];
int min,u;
int i,v;
for(i=0;i<n;i++){
d[i] = INF;
color[i] = WHITE;
}
d[0] = 0;
color[0] = GRAY;
while(1){
min = INF;
... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'dkr':
main.c:18:13: error: 'n' undeclared (first use in this function)
18 | for(i=0;i<n;i++){
| ^
main.c:18:13: note: each undeclared identifier is r... |
s536909553 | p02242 | C | #include<stdio.h>
#define NIL -1
#define FALSE 0
static const int MAX = 500;
static const int INF = (1<<21);
int main(){
int n, i, j, c, sum;
int M[MAX][MAX];
int a, b, c, d=0;
int minv;
int data[MAX];
int pi[MAX];
int vis[MAX];
int S[MAX];
scanf("%data", &n);
for ( i = 0; i< n; i++ ){
... | main.c: In function 'main':
main.c:12:13: error: redeclaration of 'c' with no linkage
12 | int a, b, c, d=0;
| ^
main.c:10:16: note: previous declaration of 'c' with type 'int'
10 | int n, i, j, c, sum;
| ^
main.c:37:15: error: 'INFTY' undeclared (first use in this funct... |
s433363322 | p02242 | C | #include<stdio.h>
#define NIL -1
#define FALSE 0
static const int MAX = 500;
static const int INF = (1<<21);
int main(){
int n, i, j, c, sum;
int M[MAX][MAX];
int a, b, c, d=0;
int minv;
int data[MAX];
int pi[MAX];
int vis[MAX];
int S[MAX];
scanf("%data", &n);
for ( i = 0; i< n; i++ ){
... | main.c: In function 'main':
main.c:12:13: error: redeclaration of 'c' with no linkage
12 | int a, b, c, d=0;
| ^
main.c:10:16: note: previous declaration of 'c' with type 'int'
10 | int n, i, j, c, sum;
| ^
main.c:47:12: error: 'INFTY' undeclared (first use in this funct... |
s157387357 | p02242 | C | #include <stdio.h>
#define MAX 100
#define MaxVal 2000000
#define WHITE 0
#define GRAY 1
#define BLACK 2
int main(){
int n, i, j, u, k, v, c, min;
int color[MAX], arr[MAX];
scanf("%d", &n);
int d[n];
int matrix[n][n];
for( i=0; i<n; i++){
d[i] = 0;
arr[i] = MaxVal;
color[i] = WHITE;
... | main.c: In function 'main':
main.c:28:3: error: 'col' undeclared (first use in this function); did you mean 'color'?
28 | col[0] = GRAY;
| ^~~
| color
main.c:28:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:55:28: error: 'g' undeclared (first use i... |
s163303084 | p02242 | C | #include <stdio.h>
#define MAX 100
#define MaxVal 2000000
#define WHITE 0
#define GRAY 1
#define BLACK 2
int main(){
int n, i, j, u, k, v, c, min;
int color[MAX], arr[MAX];
scanf("%d", &n);
int d[n];
int matrix[n][n];
for( i=0; i<n; i++){
d[i] = 0;
arr[i] = MaxVal;
color[i] = WHITE;
... | main.c: In function 'main':
main.c:28:3: error: 'col' undeclared (first use in this function); did you mean 'color'?
28 | col[0] = GRAY;
| ^~~
| color
main.c:28:3: note: each undeclared identifier is reported only once for each function it appears in
|
s864210529 | p02242 | C | #include <stdio.h>
#define N 1000
#define MAX 100000
int main(){
int n, i, j, u, k, v, m;
int d[N], c[N], g[N][N];
scanf("%d", &n);
for( i = 0; i < n; i++){
for( j = 0; j < n; j++){
g[i][j]=MAX;
}
}
for( i = 0; i < n; i++){
d[i] = MAX;
... | main.c: In function 'main':
main.c:32:11: error: 'min' undeclared (first use in this function); did you mean 'main'?
32 | min=MAX;
| ^~~
| main
main.c:32:11: note: each undeclared identifier is reported only once for each function it appears in
|
s700058170 | p02242 | C |
#include<stdio.h>
static const int N = 500;
static const int INFTY = (1<<21);
main(){
int n,i,j,a,b,sum;
int M[100][100];
int key[100];
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
scanf("%d",&a);
M[i][j]=(a==-1)?INFTY:a;
}
}
for(b=0;b<n;b++){
key[b]=1000;
pi[... | main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int]
8 | main(){
| ^~~~
main.c: In function 'main':
main.c:26:5: error: 'pi' undeclared (first use in this function); did you mean 'i'?
26 | pi[b]=NIL;
| ^~
| i
main.c:26:5: note: each undeclared identifier is reported onl... |
s509676694 | p02242 | C | #include<stdio.h>
#define MAX 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INFTY 3000
int n,M[MAX][MAX];
void dijkstra();
int main(){
int i,j,k,c,u,v;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
M[i][j]=INFTY;
}
}
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
for(j=0;j<k;j+... | main.c: In function 'dijkstra':
main.c:60:28: error: expected expression before ')' token
60 | printf("%d %d\n",i,);
| ^
|
s097106466 | p02242 | C | #include<stdio.h>
#define MAX 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INFTY 3000
int n,M[MAX][MAX];
void dijkstra();
int main(){
int i,j,k,c,u,v;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
M[i][j]=INFTY;
}
}
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
for(j=0;j<k;j+... | main.c: In function 'dijkstra':
main.c:60:28: error: expected expression before ')' token
60 | printf("%d %d\n",i,);
| ^
|
s752425093 | p02242 | C | #include<stdio.h>
#define MAX 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INFTY 3000
int n,M[MAX][MAX];
void dijkstra();
int main(){
int i,j,k,c,u,v;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
M[i][j]=INFTY;
}
}
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
for(j=0;j<k;j+... | main.c: In function 'dijkstra':
main.c:60:28: error: expected expression before ')' token
60 | printf("%d %d\n",i,);
| ^
|
s180742924 | p02242 | C | #include<stdio.h>
#define MAX 100
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INFTY 1000000
int n,M[MAX][MAX];
void dijkstra();
int main(){
int i,j,k,c,u,v;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
M[i][j]=INFTY;
}
}
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
for(j=0;j<k... | main.c: In function 'dijkstra':
main.c:60:28: error: expected expression before ')' token
60 | printf("%d -1\n",i,);
| ^
|
s967429439 | p02242 | C | #include <stdio.h>
static const int MAX=100;
static const int INFTY=(1<<30);
static const int WHITE=0;
static const int GRAY=1;
static const int BLACK=2;
int n,M[MAX][MAX];
void dijkstra(){
int minv,i,o;
int d[MAX],color[MAX];
for(i=0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
}
d[0]=0;
... | main.c:7:7: error: variably modified 'M' at file scope
7 | int n,M[MAX][MAX];
| ^
main.c:7:7: error: variably modified 'M' at file scope
|
s403164717 | p02242 | C | #include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef enum {
WHITE,
GRAY,
BLACK,
} color_t;
#define MINIMUM_SPANNING_TREE_GRAPH_SIZE 100
static int32_t weights[MINIMUM_SPANNING_TREE_GRAPH_SIZE];
static color_t colors[MINIMUM_SPANNING_TREE_GRAPH_SIZE];
bool single_source_shortest_path(int32_t gr... | main.c:17:34: error: unknown type name 'single_source_shortest_path_callback_t'
17 | single_source_shortest_path_callback_t callback)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c: In function 'main':
main.c:87:3: error: implicit declaration o... |
s590723960 | p02242 | C | #include<stdio.h>
#define N 101
int main(){
int G[N][N],a[N],f[N];
int n,i,j,k=1,m=0,num,sum=0;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
scanf("%d",&G[i][j]);
}
}
a[0]=0;
f[0]=1;
for(i=1;i<n;i++) f[i]=0;
for(k=1;k<n;k++){
//while(1){
num=2001;
for(i=0... | main.c: In function 'main':
main.c:38:5: error: 'else' without a previous 'if'
38 | else break;
| ^~~~
|
s547934260 | p02242 | C | #include<stdio.h>
#define N 2000
#define A 101
#define NIL -1
void Prim();
static const int MAX=500;
static const int INFTY=(1<<21);
int M[A][A], p[A], S[A], d[A], n;
main(){
int i, j, u, k, v, c;
scanf("%d", &n);
for (i=0; i<n; i++)
for (j=0; j<n; j++){
M[i][j]=INFTY;
}
for (i=0; i<n; i++... | main.c:14:1: error: return type defaults to 'int' [-Wimplicit-int]
14 | main(){
| ^~~~
|
s883530252 | p02242 | C | #include <stdio.h>
#define INF 100000000
void dijkstra();
void initializeSingleSource();
int n,h[100],d[100],dis[100],pi[100],G[100][100];
int main(){
int i,j,c,u,k,v;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++) w[i][j]=-1;
}
for(i=0;i<n;i++){
scanf("%d%d",&u,&k);
for(j... | main.c: In function 'main':
main.c:15:24: error: 'w' undeclared (first use in this function)
15 | for(j=0;j<n;j++) w[i][j]=-1;
| ^
main.c:15:24: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dijkstra':
main.c:51:10: erro... |
s055633211 | p02242 | C | #include <stdio.h>
#define N 101
#define INF 100000
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n,mat[N][N];
void dijkstra(){
int minv,i,v;
int d[N],color[N];
for(i=0;i<n;i++){
d[i]=INF;
color[i]=WHITE;
}
d[0]=0;
color[0]=GRAY;
while(1){
minv=INF;
int u=-1;
for(i=0;i<n;i++){
... | main.c: In function 'dijkstra':
main.c:42:33: error: expected ';' before '}' token
42 | printf("%d",d[i]==INF?-1:d[i])
| ^
| ;
43 | }
| ~
|
s021388480 | p02242 | C | #include<stdio.h>
#define MAX 101
int n,
int size[MAX],t[MAX][MAX],cost[MAX][MAX],distance[MAX];
void spp(int,int);
int main(){
int i,j;
scanf("%d",&n);
for(i=0;i<n;i++){
int a;
scanf("%d",&a);
scanf("%d",&size[a]);
for(j=0;j<size[a];j++){
scanf("%d",&t[a][j]);
scanf("%d",&cos... | main.c:5:1: error: expected identifier or '(' before 'int'
5 | int size[MAX],t[MAX][MAX],cost[MAX][MAX],distance[MAX];
| ^~~
main.c: In function 'main':
main.c:15:17: error: 'size' undeclared (first use in this function); did you mean 'size_t'?
15 | scanf("%d",&size[a]);
| ^~~~
... |
s232147255 | p02242 | C | #include<stdio.h>
#define MAX 100;
int u[MAX],k[MAX],d[MAX],v[MAX][MAX],c[MAX][MAX];
void dks();
int main(){
int n,i,j;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d",&u[i],&k[i]);
d[i]=-1;
for(j=0;j<k[i];j++){
scanf("%d %d",&v[u[i]][j],&c[u[i]][j]);
}
}
dks();
for(i=0;i<n;i++){
printf("%d %d",u[i],d[i]);... | main.c:2:16: error: expected ']' before ';' token
2 | #define MAX 100;
| ^
main.c:3:7: note: in expansion of macro 'MAX'
3 | int u[MAX],k[MAX],d[MAX],v[MAX][MAX],c[MAX][MAX];
| ^~~
main.c:3:17: error: expected identifier or '(' before ']' token
3 | int u[MAX],k[MAX],d[MAX],v... |
s693198044 | p02242 | C | #include <stdio.h>
void saitan(int,int);
int n,v[100][100],d[100],u,k[100],c[100][100];
int main(){
int i,j,u;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&u);
scanf("%d",&k[u]);
for(j=0;j<k[u];j++){
scanf("%d %d",&v[u][j],&c[u][j]);
}
}
for(i=0;i<n;i++){
d[i] = 1000000;
... | main.c: In function 'saitan':
main.c:37:7: error: implicit declaration of function 'MST' [-Wimplicit-function-declaration]
37 | MST(v[p][i],x+c[p][i]);
| ^~~
|
s587737017 | p02242 | C | #include<stdio.h>
#define MAX 100
#define INF 100000
#define W 0
#define G 1
#define B 2
int n,M[MAX][MAX];
void dijkstra()
{
int i,u,v,minv,d[MAX],color[MAX];
for(i=0;i<n;i++)
{
d[i]=INF;
color[i]=W;
}
d[0]=0;
color[0]=G;
while(1){
minv=INF;
u=-1;
for(i=0;i<n;i++)
{... | main.c: In function 'main':
main.c:79:3: error: implicit declaration of function 'dijksta'; did you mean 'dijkstra'? [-Wimplicit-function-declaration]
79 | dijksta();
| ^~~~~~~
| dijkstra
|
s524526685 | p02242 | C |
Policy: public Reviewed: 0
20.00 sec 556 KB 84 lines 978 bytes 2017-07-25 18:29
?
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
65
66
67
68
69
70
71
72
73
74... | main.c:2:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
2 | Policy: public Reviewed: 0
| ^
In file included from /usr/include/stdio.h:47,
from main.c:88:
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type... |
s575807452 | p02242 | C | include<stdio.h>
#define MAX 100
#define INFTY 100000
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n,M[MAX][MAX];
void dij(){
int minv,i,v;
int d[MAX],color[MAX];
for(i=0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
}
d[0]=0;
color[0]=GRAY;
while(1){
minv=INFTY;
int u=-1;
for(i=0;i<n;... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'dij':
main.c:13:13: error: 'n' undeclared (first use in this function)
13 | for(i=0;i<n;i++){
| ^
main.c:13:13: note: each undeclared identifier is r... |
s661688201 | p02242 | C | include<stdio.h>
#define MAX 100
#define INFTY 100000
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n,M[MAX][MAX];
void dij(){
int minv,i,v;
int d[MAX],color[MAX];
for(i=0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
}
d[0]=0;
color[0]=GRAY;
while(1){
minv=INFTY;
int u=-1;
for(i=0;i<n;... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'dij':
main.c:13:13: error: 'n' undeclared (first use in this function)
13 | for(i=0;i<n;i++){
| ^
main.c:13:13: note: each undeclared identifier is r... |
s950074555 | p02242 | C | #include<stdio.h>
#define MAX 100
#define INFTY = (1<<21)
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n,M[MAX][MAX];
void dig(){
int minv,d[MAX],iro[MAX];
int i,j,u,v;
for(i=0;i<n;i++){
d[i]=INFTY;
iro[i]=WHITE;
}
d[0]=0;
iro[0]=GRAY;
while(1){
minv=INFTY;
u=-1;
for(i=0;i<n;i+... | main.c: In function 'dig':
main.c:3:15: error: expected expression before '=' token
3 | #define INFTY = (1<<21)
| ^
main.c:14:10: note: in expansion of macro 'INFTY'
14 | d[i]=INFTY;
| ^~~~~
main.c:3:15: error: expected expression before '=' token
3 | #define INFTY = (1... |
s211471201 | p02242 | C | #include <stdio.h>
#define MAX 1000
#define INF 10000000
int G[MAX][MAX];
int d[MAX];
char color[MAX];
int n;
void initializeSingleSource(void){
int v;
for(v=0;v<MAX;v++){
d[v]=INF;
color[v]='W';
}
d[0]=0;
color[0]='G';
}
void dijkstra(void){
int mincost,i,u,v;
initializeSingleSource();... | main.c: In function 'dijkstra':
main.c:38:20: error: expected expression before '=' token
38 | if(color[v]!=='B' && G[u][v]!=INF){
| ^
|
s249163070 | p02242 | C | int main | main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
1 | int main
| ^~~
|
s695199819 | p02242 | C | #include<stdio.h>
int WHITE = 0;
int GRAY = 1;
int BLACK = 2;
int INFTY = 100000000;
int i, v, n, M[100][100];
void dijkstra(){
int minv;
int d[100], color[100];
for(i=0;i<n;i++){
d[i] = INFTY;
color[i] = WHITE;
}
d[0] = 0;
color[0] = GRAY;
while( 1 ){
minv = INF... | main.c: In function 'dijkstra':
main.c:43:33: error: expected ';' before ')' token
43 | d[i] = INFTY ? -1 : d[i]);
| ^
| ;
main.c:43:33: error: expected statement before ')' token
main.c: In function 'main':
main.c:53:13: error: 'j' ... |
s331603495 | p02242 | C | #include<stdio.h>
int WHITE = 0;
int GRAY = 1;
int BLACK = 2;
int INFTY = 100000000;
int i, v, n, M[100][100];
void dijkstra(){
int minv;
int d[100], color[100];
for(i=0;i<n;i++){
d[i] = INFTY;
color[i] = WHITE;
}
d[0] = 0;
color[0] = GRAY;
while( 1 ){
minv = INF... | main.c: In function 'dijkstra':
main.c:43:33: error: expected ';' before ')' token
43 | d[i] = INFTY ? -1 : d[i]);
| ^
| ;
main.c:43:33: error: expected statement before ')' token
main.c: In function 'main':
main.c:53:13: error: 'j' ... |
s433020872 | p02242 | C | #include <stdio.h>
#define INF (1<<21)
int main(void)
{
int i,j,n,m,u,k,l,v,c,a[10000],b[10000],d[10000][10000];
scanf("%d",&n);
for(i=0;i<n;i++){
a[i]=INF;
b[i]=0;
}
a[0]=0;
for(i=0;i<n;i++){
scanf("%d %d",&u,&k);
for(j=0;j<k;j++){
scanf("%d %d",&v,&c);
d[u][v]=c;
}
}
while(1){
l=-... | main.c:48:2: error: expected identifier or '(' before 'return'
48 | return 0;
| ^~~~~~
main.c:49:1: error: expected identifier or '(' before '}' token
49 | }
| ^
|
s071517272 | p02242 | C | #include <stdio.h>
int main(){
int i, j, k;
int a, b, c, n;
int num, N[100][100],color[100],d[100];
scanf("%d", &n);
for(i=0; i<n; i++){
for(j=0; j<n; j++){
N[i][j]=100000;
}
}
for(i=0; i<n; i++){
scanf("%d%d",&a, &c);
for(j=0; j<c; j++){
sc... | main.c: In function 'main':
main.c:41:21: error: expected ')' before '{' token
41 | for(i=0; i<n; i++{
| ~ ^
| )
main.c:46:4: error: expected expression before '}' token
46 | }
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.