submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s157625585 | 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:42:29: error: 'u' undeclared (first use in this function)
42 | if(color[i] != 1 && d[u]+N[num][i] < d[i]){
| ^
main.c:42:29: note: each undeclared identifier is reported only once for each function it appears in
|
s491765246 | p02242 | C | #include<stdio.h>
#define MAX 100
#define INFTY 5000000
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, M[MAX][MAX];
void dijkstra()
{
int minv;
int d[MAX], color[MAX];
int i, v, u = -1;
for (i=0; i<n; i++){
d[i] = INFTY;
color[i] = WHITE;
}
d[0] = 0;
color[0] = GRAY... | main.c: In function 'dijkstra':
main.c:24:4: error: implicit declaration of function 'white'; did you mean 'fwrite'? [-Wimplicit-function-declaration]
24 | white (1){
| ^~~~~
| fwrite
main.c:24:13: error: expected ';' before '{' token
24 | white (1){
| ^
| ... |
s481135348 | p02242 | C | #include<stdio.h>
#define MAX 100
#define INFTY 5000000
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, M[MAX][MAX];
void dijkstra()
{
int minv;
int d[MAX], color[MAX];
int i, v, u = -1;
for (i=0; i<n; i++){
d[i] = INFTY;
color[i] = WHITE;
}
d[0] = 0;
color[0] = GRAY... | main.c: In function 'dijkstra':
main.c:46:7: error: 'cout' undeclared (first use in this function)
46 | cout << i << " " << (d[i] == INFTY ? -1 : d[i]) << endl;
| ^~~~
main.c:46:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:46:58: error: 'endl' und... |
s834344327 | p02242 | C | #include<stdio.h>
#define???? MAX 100
#define???? INFTY 5000000
#define???? WHITE 0
#define???? GRAY 1
#define???? BLACK 2
int n, M[MAX][MAX];
void dijkstra()
{
int minv;
int d[MAX], color[MAX];
int i, v, u = -1;
for (i=0; i<n; i++){
d[i] = INFTY;
color[i] = WHITE;
}
d[0] = 0;
color... | main.c:2:8: error: macro names must be identifiers
2 | #define???? MAX 100
| ^
main.c:3:8: error: macro names must be identifiers
3 | #define???? INFTY 5000000
| ^
main.c:4:8: error: macro names must be identifiers
4 | #define???? WHITE 0
| ^
main.c:5:8: error: macro n... |
s646738646 | p02242 | C | #include<stdio.h>
#define???? MAX 100
#define???? INFTY 5000000
#define???? WHITE 0
#define???? GRAY 1
#define???? BLACK 2
int n, M[MAX][MAX];
void dijkstra()
{
int minv;
int d[MAX], color[MAX];
int i, v, u = -1;
for (i=0; i<n; i++){
d[i] = INFTY;
color[i] = WHITE;
}
d[0] = 0;
color... | main.c:2:8: error: macro names must be identifiers
2 | #define???? MAX 100
| ^
main.c:3:8: error: macro names must be identifiers
3 | #define???? INFTY 5000000
| ^
main.c:4:8: error: macro names must be identifiers
4 | #define???? WHITE 0
| ^
main.c:5:8: error: macro n... |
s430355022 | p02242 | C |
int A[1000][1000], n, k, s, u, v;
void saitan(){
int i,j,a[2000],minv,b[2000],c[2000];
for(u=0;u <n;u++){
b[u]=1000;
c[u]=-1;
a[u]=0;
}
d[0]=0;
while(1){
minv=1000;
for(i=0;i<n;i++){
if(a[i]!=1&&b[i]<minv){
minv=b[i];
u=i;
}
}
if(minv==1000){
b... | main.c: In function 'saitan':
main.c:11:3: error: 'd' undeclared (first use in this function)
11 | d[0]=0;
| ^
main.c:11:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:36:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
... |
s092719503 | p02242 | C | #include <stdio.h>
#define N_MAX 100
#difine INF 1000000
int n;
int k[N_MAX];
int direction[N_MAX][N_MAX];
int cost[N_MAX][N_MAX];
int distance[N_MAX];
void Dijkstra(){
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]);
}
}
int main(){
i... | main.c:4:2: error: invalid preprocessing directive #difine; did you mean #define?
4 | #difine INF 1000000
| ^~~~~~
| define
main.c: In function 'Dijkstra':
main.c:14:3: error: 'dist' undeclared (first use in this function)
14 | dist[p] = c;
| ^~~~
main.c:14:3: note: each undeclared iden... |
s057421269 | p02242 | C | #include <stdio.h>
#define N_MAX 100
#difine INF 1000000
int n;
int k[N_MAX];
int direction[N_MAX][N_MAX];
int cost[N_MAX][N_MAX];
int distance[N_MAX];
void Dijkstra(int p,int c){
int i;
dist[p] = c;
for( i=0; i<size[p]; i++){
if(distance[to[p][i]] > c + cost[p][i]) dfs(to[p][i], c + cost[p][i]);
}
}
... | main.c:4:2: error: invalid preprocessing directive #difine; did you mean #define?
4 | #difine INF 1000000
| ^~~~~~
| define
main.c: In function 'Dijkstra':
main.c:14:3: error: 'dist' undeclared (first use in this function)
14 | dist[p] = c;
| ^~~~
main.c:14:3: note: each undeclared iden... |
s817427049 | p02242 | C | #include<stdio.h>
#include<stdlib.h>
#define rep( i ,end ) for( int i = 0 ; i < end ; ++i )
#define Nmax 100
#define INF ( INT_MAX / 10 )
int Node[ Nmax ][ Nmax ] ;
int min( int a ,int b )
{
return a > b ? b : a ;
}
void Init( int ( *NODE )[ Nmax ] ,int N )
{
rep( i ,N )
{
rep( j ,N )
{
NODE[ i ][ j ] = (... | main.c: In function 'Init':
main.c:6:15: error: 'INT_MAX' undeclared (first use in this function)
6 | #define INF ( INT_MAX / 10 )
| ^~~~~~~
main.c:21:59: note: in expansion of macro 'INF'
21 | NODE[ i ][ j ] = ( i == j ) ? 0 : INF ;
| ... |
s029711583 | p02242 | C | #include <stdio.h>
static const int MAX = 10;
static const int INFINITY = 1 << 21;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
static int n;
static int M[MAX][MAX];
static void dijkstra()
{
int minv;
int d[MAX];
int color[MAX];
for (int i = 0; i < n; i++) {
... | main.c:10:12: error: variably modified 'M' at file scope
10 | static int M[MAX][MAX];
| ^
main.c:10:12: error: variably modified 'M' at file scope
|
s852989710 | p02242 | C | #include <stdio.h>
#define MAX = 10;
static const int INFINITY = 1 << 21;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
static int n;
static int M[MAX][MAX];
static void dijkstra()
{
int minv;
int d[MAX];
int color[MAX];
for (int i = 0; i < n; i++) {
d[i... | main.c:3:13: error: expected expression before '=' token
3 | #define MAX = 10;
| ^
main.c:10:14: note: in expansion of macro 'MAX'
10 | static int M[MAX][MAX];
| ^~~
main.c:10:22: error: expected identifier or '(' before ']' token
10 | static int M[MAX][MAX];
| ... |
s213271897 | p02242 | C | #include<iostream>
#include<cstdio>
#include<climits>
using namespace std;
#define N 1000000
int n;
int g[N][N];
int weight[N];
bool us[N];
//prim
void prim(){
int v;
weight[0]=0;
while(true){
v=-1;
for(int i=0;i<n;i++){
if(us[i]!=true && (v==-1 ||weight[i]<weight[v]))v=i;
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s584275384 | p02242 | C | import java.util.Scanner;
class Main{
final static int LEN = 105;
public static void main(String args[]){
int[][] graph = new int[LEN][LEN];
int[] minCost = new int[LEN];
int count=0;
int v;
boolean[] used = new boolean[LEN];
Scanner in = new Scanner(System.in);
//read
int n = in.nextInt();
int node... | main.c:1:1: error: unknown type name 'import'
1 | import java.util.Scanner;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.util.Scanner;
| ^
main.c:3:1: error: unknown type name 'class'
3 | class Main{
| ^~~~~
main.... |
s894544205 | p02242 | C | #include<iostream>
#include<climits>
using namespace std;
typedef struct{
int A[1000];
int ans;
bool c;
}node;
node T[1000];
int Q[10000000];
int head=0;
int tail=1;
int n;
void function(int num){
while(true){
if(head==tail)break;
num=Q[head++];
T[num].c=true;
for(int i=0;i<n;i++){
if(T[... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s659782810 | 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... | a.cc: In function 'void SPFA(int)':
a.cc:25:9: error: 'memset' was not declared in this scope
25 | memset(d, INF, sizeof(d));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<utility>
+++ |+#include <c... |
s194001044 | p02242 | C++ | #include"iostream"
#include"algorithm"
#include"cstdio"
#include"cstring"
#include"string"
#include"vector"
#include"queue"
#include"map"
#include"set"
#include"stack"
#include"cmath"
using namespace std;
#define INF 0xfffffff
#define maxn 10002
struct Node
{
int e;
int w;
friend bool operator < (Node A, No... | a.cc: In function 'int main()':
a.cc:75:29: error: 'inti' was not declared in this scope; did you mean 'int'?
75 | for(inti=0;i<m;i++)
| ^~~~
| int
a.cc:75:36: error: 'i' was not declared in this scope
75 | ... |
s074530067 | p02242 | C++ | import java.util.Arrays;
import java.util.Scanner;
public class Main {
static int N;
static int W[][], distance[], state[];
static final int INF = 1000000000;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
N = sc.nextInt();
W = new int[N][N];
distance = new int[N];
state ... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Arrays;
| ^~~~~~
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.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-t... |
s246492193 | p02242 | C++ | /**
* @brief 最短経路問題(shortest paths problem)におけるDijkstraのアルゴリズム(Dijkstra's algorithm)を扱う
* @date 作成日 : 2016/02/20
* @date 最終更新日 : 2016/02/20
*/
//****************************************
// 必要なヘッダファイルのインクルード
//****************************************
#include <iostream>
#include <utility>
#include <algo... | a.cc:44:25: error: 'int32_t' in namespace 'std' does not name a type
44 | using weight_t = std::int32_t; /**< 辺(u, v)への重みwを表す型 */
| ^~~~~~~
a.cc:45:25: error: 'int32_t' in namespace 'std' does not name a type
45 | using index_t = std::int32_t; /**< 頂点vの添字を表す型 */
| ... |
s393043537 | p02242 | C++ | /**
* @brief 最短経路問題(shortest paths problem)におけるDijkstraのアルゴリズム(Dijkstra's algorithm)を扱う
* @date 2016/02/20 ~ 2016/03/13
*/
//****************************************
// 必要なヘッダファイルのインクルード
//****************************************
#include <iostream>
#include <utility>
#include <algorithm>
#include <vector>
#i... | a.cc:42:25: error: 'int32_t' in namespace 'std' does not name a type
42 | using weight_t = std::int32_t; /**< 辺(u, v)への重みwを表す型 */
| ^~~~~~~
a.cc:43:25: error: 'int32_t' in namespace 'std' does not name a type
43 | using index_t = std::int32_t; /**< 頂点vの添字を表す型 */
| ... |
s621917183 | p02242 | C++ | #include <queue>
#include <cstdio>
#include <vector>
int V, E, s, t, p, q, d[100]; vector<int> G[100];
int main() {
scanf("%d%d", &V, &E);
for(int i = 0; i < V; i++) {
scanf("%d%d", &s, &t);
for(int j = 0; j < t; j++) {
scanf("%d%d", &p, &q);
G[i].push_back(make_pair(p, q));
}
}
for(int i = 1; i < V; i+... | a.cc:4:31: error: 'vector' does not name a type
4 | int V, E, s, t, p, q, d[100]; vector<int> G[100];
| ^~~~~~
a.cc: In function 'int main()':
a.cc:11:25: error: 'G' was not declared in this scope
11 | G[i].push_back(make_pair(p, q));
| ... |
s778145068 | p02242 | C++ | #include <queue>
#include <cstdio>
#include <vector>
using namespace std;
int V, E, s, t, p, q, d[100]; vector<int> G[100];
int main() {
scanf("%d%d", &V, &E);
for(int i = 0; i < V; i++) {
scanf("%d%d", &s, &t);
for(int j = 0; j < t; j++) {
scanf("%d%d", &p, &q);
G[i].push_back(make_pair(p, q));
}
}
for... | a.cc: In function 'int main()':
a.cc:12:39: error: no matching function for call to 'std::vector<int>::push_back(std::pair<int, int>)'
12 | G[i].push_back(make_pair(p, q));
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
... |
s914752096 | p02242 | C++ | /**
* @brief 最短経路問題(shortest paths problem)におけるDijkstraのアルゴリズム(Dijkstra's algorithm)を扱う
* @note 関連URL: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_12_B
* @date 2016/02/20 ~ 2016/03/13
*/
//****************************************
// 必要なヘッダファイルのインクルード
//************************************... | a.cc:43:25: error: 'int32_t' in namespace 'std' does not name a type
43 | using weight_t = std::int32_t; /**< 辺(u, v)への重みwを表す型 */
| ^~~~~~~
a.cc:44:25: error: 'int32_t' in namespace 'std' does not name a type
44 | using index_t = std::int32_t; /**< 頂点vの添字を表す型 */
| ... |
s863895183 | p02242 | C++ | // ref: p302
using System;
public class SingleSourceShortestPath
{
const int MAX = 100;
const int INFTY = Int32.MaxValue;
const int WHITE = 0;
const int GRAY = 1;
const int BLACK = 2;
static int vertexNum; // ????????° = V
static int[,] M = new int[MAX,MAX]; // ????????????????¨????????????£??\??????
static... | a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System;
| ^~~~~~
a.cc:5:1: error: expected unqualified-id before 'public'
5 | public class SingleSourceShortestPath
| ^~~~~~
|
s642035519 | p02242 | C++ | a | a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s750653506 | p02242 | C++ | aa | a.cc:1:1: error: 'aa' does not name a type
1 | aa
| ^~
|
s117543804 | p02242 | 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, N[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;
... | a.cc: In function 'int prim()':
a.cc:33:26: error: 'M' was not declared in this scope
33 | if(color[v]!=BLACK&& M[u][v]!=INFTY){
| ^
a.cc:44:23: error: 'M' was not declared in this scope
44 | if(p[i]!=-1) sum+=M[i][p[i]];
| ^
a.cc: In function 'in... |
s167648083 | p02242 | 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];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i = 0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE... | a.cc: In function 'void dijkstra()':
a.cc:37:16: error: invalid types 'int[int]' for array subscript
37 | d[v]=d[u][v]+M[u][v];
| ^
a.cc: In function 'int main()':
a.cc:61:5: error: 'xin' was not declared in this scope
61 | xin >> u >> k;
| ^~~
|
s948586477 | p02242 | 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];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i = 0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
... | a.cc: In function 'void dijkstra()':
a.cc:35:16: error: invalid types 'int[int]' for array subscript
35 | d[v]=d[u][v]+M[u][v];
| ^
a.cc: In function 'int main()':
a.cc:59:5: error: 'xin' was not declared in this scope
59 | xin >> u >> k;
| ^~~
|
s521502628 | p02242 | 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];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i = 0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
... | a.cc: In function 'void dijkstra()':
a.cc:35:16: error: invalid types 'int[int]' for array subscript
35 | d[v]=d[u][v]+M[u][v];
| ^
|
s061350027 | p02242 | 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];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i = 0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
... | a.cc: In function 'void dijkstra()':
a.cc:35:16: error: invalid types 'int[int]' for array subscript
35 | d[v]=d[u][v]+M[u][v];
| ^
|
s723510974 | p02242 | 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];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i = 0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
... | a.cc: In function 'void dijkstra()':
a.cc:35:16: error: invalid types 'int[int]' for array subscript
35 | d[v]=d[u][v]+M[u][v];
| ^
|
s376922513 | p02242 | 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];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i = 0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
... | a.cc: In function 'void dijkstra()':
a.cc:35:16: error: invalid types 'int[int]' for array subscript
35 | d[v]=d[u][v]+M[u][v];
| ^
|
s714290989 | p02242 | C++ | #include <iostream>
using namespace std;
#include <algorithm>
#define INF 1000000
int flg[100];
bool check(int p){
if (flg[p] == 1) return false;
return true;
}
int main(void){
int n;
cin >> n;
int u, k;
int date[100][100]; //date[??????????????????][?????´?????????]
int dis[100]; //0??????????????????????... | a.cc: In function 'int main()':
a.cc:23:9: error: 'memset' was not declared in this scope
23 | memset(date, INF, sizeof(date));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <algorithm>
+++ |+#inclu... |
s326017362 | p02242 | C++ | #include <iostream>
using namespace std;
#include <algorithm>
#include <string>
#define INF 1000000
int flg[100];
bool check(int p){
if (flg[p] == 1) return false;
return true;
}
int main(void){
int n;
cin >> n;
int u, k;
int date[100][100]; //date[??????????????????][?????´?????????]
int dis[100]; //0????... | a.cc: In function 'int main()':
a.cc:24:9: error: 'memset' was not declared in this scope
24 | memset(date, INF, sizeof(date));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <algorithm>
+++ |+#inclu... |
s377115899 | p02242 | C++ | #include <iostream>
#include <limits>
#define N 100
#define INF INT_MAX
using namespace std;
int n,M[N][N],d[N];
void dijkstra(int s){
bool visited[n];
for(int i=0;i<n;i++){
visited[i]=false;
d[i]=INF;
}
d[s]=0;
while(1){
int mincost=INF;
int u;
//find minimum d from non-visited nodes
... | a.cc: In function 'void dijkstra(int)':
a.cc:4:13: error: 'INT_MAX' was not declared in this scope
4 | #define INF INT_MAX
| ^~~~~~~
a.cc:14:10: note: in expansion of macro 'INF'
14 | d[i]=INF;
| ^~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably... |
s107361502 | p02242 | C++ | #include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
typedef pair<int, int> P;
typedef int long long
struct edge {int to, cost;};
/*
[input]
const vector<vector<edge>> &graph : ??\?????°??????
int s : ?§????
int g : ??????
n*/
int dijkstra(const vector<vector<edge>> &graph, int s, int g ) {
// ??... | a.cc:6:9: error: multiple types in one declaration
6 | typedef int long long
| ^~~
a.cc:8:27: error: declaration does not declare anything [-fpermissive]
8 | struct edge {int to, cost;};
| ^
cc1plus: error: '::main' must return 'int'
|
s279200596 | p02242 | C++ | #include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
typedef pair<int, int> P;
typedef int long long
struct edge {int to, cost;};
/*
[input]
const vector<vector<edge>> &graph : ??\?????°??????
int s : ?§????
int g : ??????
n*/
int dijkstra(const vector<vector<edge>> &graph, int s, int g ) {
// ??... | a.cc:6:9: error: multiple types in one declaration
6 | typedef int long long
| ^~~
a.cc:8:27: error: declaration does not declare anything [-fpermissive]
8 | struct edge {int to, cost;};
| ^
|
s405676154 | p02242 | 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];
void dijkstra() {
int minv;
int color[MAX], d[MAX];
for(int i = 0; i < n; i++) {
d[i] = INFT... | a.cc: In function 'void dijkstra()':
a.cc:35:20: error: 'v' was not declared in this scope
35 | if(color[v] != BLACK && M[u][v] != INFTY) {
| ^
a.cc: In function 'int main()':
a.cc:61:32: error: 'v' was not declared in this scope
61 | cin >> v >> c;
... |
s785460496 | p02242 | 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];
void dijkstra() {
int minv;
int color[MAX], d[MAX];
for(int i = 0; i < n; i++) {
d[i] = INFT... | a.cc: In function 'void dijkstra()':
a.cc:34:30: error: 'i' was not declared in this scope
34 | for(int v = 0; v < n; i++) {
| ^
a.cc: In function 'int main()':
a.cc:51:18: error: expected initializer before 'c'
51 | int u, k c;
| ^
a.cc:59:... |
s114647866 | p02242 | 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];
void dijkstra() {
int minv;
int color[MAX], d[MAX];
for(int i = 0; i < n; i++) {
d[i] = INFT... | a.cc: In function 'void dijkstra()':
a.cc:25:13: error: expected initializer before '==' token
25 | int u == -1;
| ^~
a.cc:29:19: error: 'u' was not declared in this scope
29 | u = i;
| ^
a.cc:32:10: error: 'u' was not declared in this scope
32 ... |
s967421342 | p02242 | C++ | #pragma once
#include <bits/stdc++.h>
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wconversion"
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define RFOR(i, a, b) for (ll i = (b)-1; i >= (a); i--)
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define re... | a.cc:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
a.cc: In function 'int main()':
a.cc:148:5: error: 'Dijkstra' was not declared in this scope
148 | Dijkstra(g, r, d);
| ^~~~~~~~
|
s674252095 | p02242 | C++ | #include <iostream>
#include <utility>
#include <vector>
using namespace std;
static const int MAX_N = 100;
void dijkstra(vector<vector<pair<int, int> > > way)
{
int d[way.size()];
bool on[way.size()];
for (int i = 0; i < way.size(); i++) {
d[i] = INT_MAX;
on[i] = false;
}
d[0] = 0... | a.cc: In function 'void dijkstra(std::vector<std::vector<std::pair<int, int> > >)':
a.cc:13:16: error: 'INT_MAX' was not declared in this scope
13 | d[i] = INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits... |
s117974545 | p02242 | 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];
void dik(){
int min;
int d[MAX],color[MAX];
for(int i=0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
}
d[0]=0;
color[0]=GRAY;
whi... | a.cc: In function 'void dik()':
a.cc:35:18: error: expected ';' before ')' token
35 | d[v]=d[u]+M[u][v]){
| ^
| ;
a.cc:42:25: error: 'INTY' was not declared in this scope; did you mean 'INFTY'?
42 | cout << i <<" "<<(d[i]==INTY ? -1 : d[i])<<endl;
| ... |
s031622257 | p02242 | 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];
void dik(){
int min;
int d[MAX],color[MAX];
for(int i=0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
}
d[0]=0;
color[0]=GRAY;
whi... | a.cc: In function 'void dik()':
a.cc:35:18: error: expected ';' before ')' token
35 | d[v]=d[u]+M[u][v]){
| ^
| ;
|
s883435632 | p02242 | C++ | #include <stdio.h>
#include <iostream>
#include <queue>
using namespace std;
class Vertice;
class Edge;
class Vertice{
private:
int id;
int edge_num;
int *vertice_id_list;
Edge **edges;
bool flag_fixed;
int distance_min;
public:
Vertice(int id, int edge_num_max);
~Vertice(){ delete[] edges, vertice_id_list; }... | a.cc: In constructor 'Vertice::Vertice(int, int)':
a.cc:54:24: error: 'INT_MAX' was not declared in this scope
54 | distance_min = INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #inclu... |
s735940324 | p02242 | C++ | #include <stdio.h>
#include <iostream>
#include <queue>
using namespace std;
class Vertice;
class Edge;
class Vertice{
private:
int id;
int edge_num;
int *vertice_id_list;
Edge **edges;
bool flag_fixed;
int distance_min;
public:
Vertice(int id, int edge_num_max);
~Vertice(){ delete[] edges, vertice_id_list; }... | a.cc: In constructor 'Vertice::Vertice(int, int)':
a.cc:54:24: error: 'INT_MAX' was not declared in this scope
54 | distance_min = INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #inclu... |
s096241224 | p02242 | C++ | #include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
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 ... | a.cc: In function 'int dijkstra()':
a.cc:44:11: error: 'p' was not declared in this scope
44 | p[v] = u;
| ^
a.cc:53:1: warning: no return statement in function returning non-void [-Wreturn-type]
53 | }
| ^
|
s687944693 | p02242 | 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];
void dijkstra() {
int minv;
int d[MAX], color[MAX];
for (int i = 0; i < n; i++) {
d[i] = INFTY;... | a.cc: In function 'void dijkstra()':
a.cc:26:38: error: 'BALCK' was not declared in this scope; did you mean 'BLACK'?
26 | if (minv > d[i] && color[i] != BALCK ) {
| ^~~~~
| BLACK
a.cc:43:8: error: 'inti' was not declared in... |
s745797938 | p02242 | 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];
void dijkstra() {
int min;
int d[MAX], color[MAX];
for ( int i = 0; i < n; i++ ) {
d[i] = IN... | a.cc: In function 'int main()':
a.cc:65:1: error: expected primary-expression before '?' token
65 | ?????????for ( int j = 0; j < n; j++ ) {
| ^
a.cc:65:2: error: expected primary-expression before '?' token
65 | ?????????for ( int j = 0; j < n; j++ ) {
| ^
a.cc:65:3: error: expected primary-expressi... |
s757149097 | 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];
scand("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d",&u,&k);
a[i]=INF;
b[i]=0;
for(j=0;j<k;j++){
scanf("%d %d",&v,&c);
d[u][v]=c;
}
}
a[0]=0;
while(1){
l=-1;
m=INF;
for(i=0... | a.cc: In function 'int main()':
a.cc:8:2: error: 'scand' was not declared in this scope; did you mean 'scanf'?
8 | scand("%d",&n);
| ^~~~~
| scanf
a.cc:27:27: error: lvalue required as left operand of assignment
27 | if(a[i]<m && b[i]=0){
| ~~~~~~~^~~~~~~
a... |
s858629924 | 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];
scand("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d",&u,&k);
a[i]=INF;
b[i]=0;
for(j=0;j<k;j++){
scanf("%d %d",&v,&c);
d[u][v]=c;
}
}
a[0]=0;
while(1){
l=-1;
m=INF;
for(i=0... | a.cc: In function 'int main()':
a.cc:8:2: error: 'scand' was not declared in this scope; did you mean 'scanf'?
8 | scand("%d",&n);
| ^~~~~
| scanf
a.cc:27:27: error: lvalue required as left operand of assignment
27 | if(a[i]<m && b[i]=0){
| ~~~~~~~^~~~~~~
|
s139499122 | 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++){
scanf("%d %d",&u,&k);
a[i]=INF;
b[i]=0;
for(j=0;j<k;j++){
scanf("%d %d",&v,&c);
d[u][v]=c;
}
}
a[0]=0;
while(1){
l=-1;
m=INF;
for(i=0... | a.cc: In function 'int main()':
a.cc:27:27: error: lvalue required as left operand of assignment
27 | if(a[i]<m && b[i]=0){
| ~~~~~~~^~~~~~~
|
s620720052 | p02242 | 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 BRACK = 2;
int n,M[MAX][MAX];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i = 0;i < n;i++){
d[i] = INFTY;
color[i] = W... | a.cc: In function 'void dijkstra()':
a.cc:26:37: error: 'BLACK' was not declared in this scope; did you mean 'BRACK'?
26 | if(minv > d[i] && color[i] != BLACK){
| ^~~~~
| BRACK
a.cc:32:16: error: 'BLACK' was not declared in thi... |
s959898267 | p02242 | 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];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i = 0;i < n;i++){
d[i] = INFTY;
color[i] = ... | a.cc: In function 'void dijkstra()':
a.cc:42:8: error: 'u' was not declared in this scope
42 | if(u == -1) break;
| ^
a.cc:42:17: error: break statement not within loop or switch
42 | if(u == -1) break;
| ^~~~~
a.cc:43:11: error: 'u' was not declared in this scope
43 ... |
s400117779 | p02242 | 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];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i = 0;i < n;i++){
d[i] = INFTY;
color[i] = ... | a.cc: In function 'void dijkstra()':
a.cc:42:8: error: 'u' was not declared in this scope
42 | if(u == -1) break;
| ^
a.cc:42:17: error: break statement not within loop or switch
42 | if(u == -1) break;
| ^~~~~
a.cc:43:11: error: 'u' was not declared in this scope
43 ... |
s398378225 | p02242 | 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];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i = 0;i < n;i++){
d[i] = INFTY;
color[i] = ... | a.cc:63:13: error: expected constructor, destructor, or type conversion before ';' token
63 | dijkstra();
| ^
a.cc:64:4: error: expected unqualified-id before 'return'
64 | return 0;
| ^~~~~~
a.cc:65:1: error: expected declaration before '}' token
65 | }
| ^
|
s144715639 | p02242 | C++ | /**
* @brief 単一始点最短路問題をDijkstra法で解く
*/
// ********************************************************************************
// Include files
// ********************************************************************************
#include <iostream>
#include <limits>
#include <vector>
#include <queue>
// **************... | a.cc: In function 'int main()':
a.cc:191:5: error: 'matrix_t' was not declared in this scope
191 | matrix_t M;
| ^~~~~~~~
a.cc:194:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
194 | cin >> n; M.resize(n);
| ^~~
| std::cin
In file included from a.cc:9... |
s230434077 | p02242 | C++ | /**
* @brief 単一始点最短路問題をDijkstra法で解く
*/
// ********************************************************************************
// Include files
// ********************************************************************************
#include <iostream>
#include <limits>
#include <vector>
#include <queue>
// **************... | a.cc: In function 'int main()':
a.cc:191:5: error: 'matrix_t' was not declared in this scope
191 | matrix_t M;
| ^~~~~~~~
a.cc:194:20: error: 'M' was not declared in this scope
194 | std::cin >> n; M.resize(n);
| ^
|
s666553729 | p02242 | 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];
void dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i=0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
}
d[0]=0;
color[0]=GRAY;
w... | a.cc: In function 'void dijkstra()':
a.cc:39:22: error: 'INFTY\U0000ff1f' was not declared in this scope; did you mean 'INFTY'?
39 | cout<<i<<" "<<(d[i]==INFTY?-1:d[i])<<endl;
| ^~~~~~~
| INFTY
a.cc:39:31: error: expected ')' before ':' token
39 | cout<<i<<" "... |
s756151524 | p02242 | C++ | #include<stdio.h>
#include<stdlib.h>
#define rep( i ,end ) for( int i = 0 ; i < end ; ++i )
#define Nmax 100
#define INF ( INT_MAX / 10 )
int Node[ Nmax ][ Nmax ] ;
int min( int a ,int b )
{
return a > b ? b : a ;
}
void Init( int ( *NODE )[ Nmax ] ,int N )
{
rep( i ,N )
{
rep( j ,N )
{
NODE[ i ][ j ] = (... | a.cc: In function 'void Init(int (*)[100], int)':
a.cc:6:15: error: 'INT_MAX' was not declared in this scope
6 | #define INF ( INT_MAX / 10 )
| ^~~~~~~
a.cc:21:59: note: in expansion of macro 'INF'
21 | NODE[ i ][ j ] = ( i == j ) ? 0 : INF ;
| ... |
s395043097 | p02242 | C++ | #include<stdio.h>
#include<stdlib.h>
#define rep( i ,end ) for( int i = 0 ; i < end ; ++i )
#define Nmax 100
#define INF ( INT_MAX / 10 )
int Node[ Nmax ][ Nmax ] ;
int min( int a ,int b )
{
return a > b ? b : a ;
}
void Init( int NODE[ Nmax ][ Nmax ] ,int N )
{
rep( i ,N )
{
rep( j ,N )
{
NODE[ i ][ j ] ... | a.cc: In function 'void Init(int (*)[100], int)':
a.cc:6:15: error: 'INT_MAX' was not declared in this scope
6 | #define INF ( INT_MAX / 10 )
| ^~~~~~~
a.cc:21:59: note: in expansion of macro 'INF'
21 | NODE[ i ][ j ] = ( i == j ) ? 0 : INF ;
| ... |
s174620232 | p02242 | C++ | import java.util.ArrayList;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;
public class Main {
int[] distTo = null;
int[] parentOf = null;
public Dijkstra(ArrayList<ArrayList<Edge>> G){
distTo = new int[G.size()];
Arrays.fill(distTo, Integer.MAX_VALUE);
... | a.cc:45:9: error: stray '@' in program
45 | @Override
| ^
a.cc:91:5: error: stray '@' in program
91 | @Override
| ^
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... |
s485144753 | p02242 | C++ | import java.util.ArrayList;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;
public class Main {
int[] distTo = null;
int[] parentOf = null;
public Main(ArrayList<ArrayList<Edge>> G){
distTo = new int[G.size()];
Arrays.fill(distTo, Integer.MAX_VALUE);
... | a.cc:45:9: error: stray '@' in program
45 | @Override
| ^
a.cc:91:5: error: stray '@' in program
91 | @Override
| ^
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... |
s763458332 | p02242 | C++ | #include <stdio.h>
#include <stdint.h>
#include <iostream>
#include <fstream>
#include <cassert>
#include <climits>
#include <queue>
using namespace std;
#define DEBUG (0)
#if DEBUG
#define DPRINTF(...) do { \
printf("D(L%d) %s: ", __LINE__, __func__); \
printf(__VA_ARGS__); \
} while (false)
#else
#define... | a.cc:60:5: error: 'unique_ptr' does not name a type
60 | unique_ptr<int> weight_;
| ^~~~~~~~~~
a.cc: In constructor 'Edge::Edge(int)':
a.cc:39:9: error: 'weight_' was not declared in this scope
39 | weight_ = unique_ptr<int>(new int[size_of_ptr_]);
| ^~~~~~~
a.cc:39:19: error: ... |
s191252076 | p02242 | C++ | #include <cstdio>
#include <cstring>
#include <vector>
#include <map>
using namespace std;
typedef vector<int>::iterator vitr;
typedef map<int, int>::iterator mitr;
map<int, int> w[100];
int d[100];
vector<int> a;
vector<int> b;
void findPath(){
int candiW = INT_MAX;
vitr candiI;
for(vitr i=a.begin();i!... | a.cc: In function 'void findPath()':
a.cc:17:18: error: 'INT_MAX' was not declared in this scope
17 | int candiW = INT_MAX;
| ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
4 | #include <map>
+++ |+#include ... |
s346969303 | p02242 | C++ | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int... | a.cc: In function 'int main()':
a.cc:37:5: error: 'memset' was not declared in this scope
37 | memset(G,-1,sizeof(G));
| ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
8 | #include <cmath>
+++ |+#include <cstring>
9 | ... |
s712638328 | p02242 | C++ | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int... | a.cc: In function 'int main()':
a.cc:37:5: error: 'memset' was not declared in this scope
37 | memset(G,-1,sizeof(G));
| ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
8 | #include <cmath>
+++ |+#include <cstring>
9 | ... |
s827286823 | p02242 | C++ | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int... | a.cc:37:13: error: invalid declarator before 'G'
37 | vector<int> G[110];
| ^
a.cc: In function 'int main()':
a.cc:48:13: error: 'G' was not declared in this scope
48 | G[t].push_back({a,b})
| ^
a.cc:57:19: error: 'G' was not declared in this scope
57 | ... |
s357782466 | p02242 | C++ | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int... | a.cc:37:13: error: invalid declarator before 'G'
37 | vector<int> G[110];
| ^
a.cc: In function 'int main()':
a.cc:48:13: error: 'G' was not declared in this scope
48 | G[t].push_back({a,b})
| ^
a.cc:57:32: error: 'G' was not declared in this scope
57 | ... |
s118620554 | p02242 | 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];;
void dijkstra() {
int minv;
int d[MAX], color [MAX];
for (int i = 0; i < n; i++) {
d[i] = INFTY;... | a.cc: In function 'void dijkstra()':
a.cc:50:60: error: expected ';' before '}' token
50 | cout << i << " " << (d[i] == INFTY ? -1 : d[i]) << endl
| ^
| ;
51 | }
| ~ ... |
s282091708 | p02242 | 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 dijkstra(){
int minv;
int d[MAX],color[MAX];
for(int i=0;i<n;i++){
d[i]=INFTY;
color[i]=WHITE;
}... | a.cc: In function 'int dijkstra()':
a.cc:23:5: error: 'u' was not declared in this scope
23 | u=-1;
| ^
a.cc:44:1: warning: no return statement in function returning non-void [-Wreturn-type]
44 | }
| ^
|
s030814144 | p02242 | C++ | #include <stdio.h>
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 dijkstra(int s) {
int d[n], p[n];
int color[n];
for(int i=0; i<n; i++) {
color[i] = ... | a.cc: In function 'int main()':
a.cc:65:23: error: too few arguments to function 'int dijkstra(int)'
65 | int sum = dijkstra();
| ~~~~~~~~^~
a.cc:11:5: note: declared here
11 | int dijkstra(int s) {
| ^~~~~~~~
|
s306714444 | p02242 | C++ | #include <stdio.h>
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 d[n];
void dijkstra(int s) {
int p[n];
int color[n];
for(int i=0; i<n; i++) {
color[... | a.cc:10:7: error: size of array 'd' is not an integral constant-expression
10 | int d[n];
| ^
|
s866162751 | p02242 | C++ | #include <iostream>
#include <vector>
using namespace std;
int n;
vector<int> g[100];
vector<int> w[100];
int d[100];
char color[100];
void dijkstra() {
d[0] = 0;
color[0] = 'b';
for (int k = 1; k < n; ++k) {
int next;
int mine = INT_MAX;
for (int i = 0; i < n; ++i) {
... | a.cc: In function 'void dijkstra()':
a.cc:18:20: error: 'INT_MAX' was not declared in this scope
18 | int mine = INT_MAX;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <vector>
+++ |+#i... |
s902565414 | p02242 | C++ | #include<iostream>
#include<cstdio>
#include<climits>
#include<cstring>
#define INF INT_MAX
using namespace std;
typedef unsigned long long ull;
void Init(int f){
for(int i=0;i<=f+50;i++){
for(int j=0;j<=f+50;j++)D[i][j] = INF;
}
}
int main(){
int n;
int A[1000][1000];
ull D[1000][1000];
scanf("%d",&n);
... | a.cc: In function 'void Init(int)':
a.cc:12:29: error: 'D' was not declared in this scope
12 | for(int j=0;j<=f+50;j++)D[i][j] = INF;
| ^
|
s520456772 | p02242 | C++ | #include<cstdio>
#include<climits>
#include<cstring>
#define INF 1<<25
using namespace std;
typedef long ull;
int main(){
int n;
int A[1000][1000];
ull D[1000][1000];
scanf("%d",&n);
int u,k,C,V;
for(int i=0;i<=n;i++){
for(int j=0;j<=n;j++)D[i][j] = INF;
}
for(int i=0;i<n;i++){
scanf("%d... | a.cc: In function 'int main()':
a.cc:29:73: error: 'min' was not declared in this scope; did you mean 'main'?
29 | for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j] = min(D[i][j],D[i][k] + D[k][j]);
| ^~~
| ... |
s744425968 | p02242 | C++ | #include<cstdio>
#define INF 200001
int main(){
int u,k,C,V,A[1000][1000],D[1000][1000],n;
scanf("%d",&n);
for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j] = INF;
for(int i=0;i<n;i++){
scanf("%d %d",&u,&k);
for(int j=0;j<k;j++){
scanf("%d %d",&V,&C);
D[u][V] = C;
}
}
for(... | a.cc: In function 'int main()':
a.cc:16:72: error: 'min' was not declared in this scope; did you mean 'main'?
16 | for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j]= min(D[i][j],D[i][k] + D[k][j]);
| ^~~
| ... |
s807639948 | p02242 | C++ | #include<cstdio>
#include<iostream>
#define INF 200001
int main(){
int u,k,C,V,A[1000][1000],D[1000][1000],n;
scanf("%d",&n);
for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j] = INF;
for(int i=0;i<n;i++){
scanf("%d %d",&u,&k);
for(int j=0;j<k;j++){
scanf("%d %d",&V,&C);
D[u][V] = C;
... | a.cc: In function 'int main()':
a.cc:17:72: error: 'min' was not declared in this scope; did you mean 'std::min'?
17 | for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++)D[i][j]= min(D[i][j],D[i][k] + D[k][j]);
| ^~~
| ... |
s425574184 | p02242 | C++ | #include<iostream>
#include<cstdio>
#include<climits>
using namespace std;
#define N 1000000
int n;
int g[N][N];
int weight[N];
bool us[N];
//prim
void prim(){
int v;
weight[0]=0;
while(true){
v=-1;
for(int i=0;i<n;i++){
if(us[i]!=true && (v==-1 ||weight[i]<weight[v]))v=i;
... | /tmp/ccOJc1VN.o: in function `prim()':
a.cc:(.text+0x6): relocation truncated to fit: R_X86_64_PC32 against symbol `weight' defined in .bss section in /tmp/ccOJc1VN.o
a.cc:(.text+0x26): relocation truncated to fit: R_X86_64_PC32 against symbol `us' defined in .bss section in /tmp/ccOJc1VN.o
a.cc:(.text+0x4c): relocatio... |
s646918114 | p02242 | C++ | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
template< typename FirstType, typename SecondType >
struct PairComparator {
bool operator()( const pair<FirstType, SecondType>& p1, const pair<FirstType, SecondType>& p2 ) const
{
return p1.first > p2.first;
}
};
bool inMST(vector< ... | a.cc: In function 'int main()':
a.cc:63:27: error: '::_DEBUG_ERROR' has not been declared
63 | ::_DEBUG_ERROR("invalid");
| ^~~~~~~~~~~~
|
s673577757 | p02243 | Java |
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;
import lombok.Data;
public class Main {
public static void main(String[] args) {
new Main().run();
}
int n;
boolean[] color;
int INF = 1 << 24;
List<List<Edge>> adj = new Ar... | Main.java:8: error: package lombok does not exist
import lombok.Data;
^
Main.java:67: error: cannot find symbol
@Data
^
symbol: class Data
location: class Main
2 errors
|
s263160312 | p02243 | Java |
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;
import lombok.Data;
public class Main {
public static void main(String[] args) {
new Main().run();
}
int n;
boolean[] color;
int INF = 1 << 24;
List<List<Edge>> adj = new Ar... | Main.java:8: error: package lombok does not exist
import lombok.Data;
^
Main.java:67: error: cannot find symbol
@Data
^
symbol: class Data
location: class Main
2 errors
|
s489194758 | p02243 | C | #include<stdio.h>
#include<stdlib.h>
#define N 100000
#define nil -1
#define WHITE 0
#define BLACK 1
#define INF 1<<21
typedef struct{
int prev,next,cost;
}Edge;
int n,d[N];
Edge e[500000];
void dijkstra(int);
int main(){
int i,j,k,c,ed=0,v,w=INF,r;
scan... | main.c: In function 'main':
main.c:23:43: error: 'u' undeclared (first use in this function)
23 | scanf("%d%d",&u,&k);
| ^
main.c:23:43: note: each undeclared identifier is reported only once for each function it appears in
|
s554179326 | p02243 | C | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define M 10000
#define E 500000
typedef struct edge {
int from, to, cost;
} E;
E e[E];
int d[M];
void sp(int,int);
int main(int argc,char* argv[])
{
int vn, en, an;
int i, j, vi;
scanf("%d", &vn);
en=0;
for(i=0; i<vn; i++) {
... | main.c:5:11: error: expected identifier or '(' before numeric constant
5 | #define E 500000
| ^~~~~~
main.c:9:3: note: in expansion of macro 'E'
9 | } E;
| ^
main.c:5:11: error: expected identifier or '(' before numeric constant
5 | #define E 500000
| ^~~~~~
main.c:10... |
s509869650 | p02243 | C |
typedef struct edge {
int from, to, cost;
} Ed;
Ed e[E];
int d[M];
void sp(int,int);
int main(int argc,char* argv[])
{
int vn, en, an;
int i, j, vi;
scanf("%d", &vn);
en=0;
for(i=0; i<vn; i++) {
scanf("%d", &vi);
scanf("%d", &an);
for(j=1; j<=an; j++) {
... | main.c:5:6: error: 'E' undeclared here (not in a function); did you mean 'Ed'?
5 | Ed e[E];
| ^
| Ed
main.c:6:7: error: 'M' undeclared here (not in a function)
6 | int d[M];
| ^
main.c: In function 'main':
main.c:14:5: error: implicit declaration of function 'scanf' [-Wimplicit... |
s379198293 | p02243 | C | #include<stdio.h>
#include<stdlib.h>
static MAX = 10001;
static const int INFTY = (1<<21);
main(){
int n, i, j, e, sum,k,a,v1;
int key,pi[MAX],v[MAX],u,c[MAX],**M;
scanf("%d", &n);
M=(int **)malloc(sizeof(int)*(n+1000);
for ( i = 0; i< n; i++ ){
M[i]=(int *)malloc(sizeof(int)*(n+1000));
}
for ( i... | main.c:4:8: error: type defaults to 'int' in declaration of 'MAX' [-Wimplicit-int]
4 | static MAX = 10001;
| ^~~
main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int]
7 | main(){
| ^~~~
main.c: In function 'main':
main.c:13:40: error: expected ')' before ';' token
13 | M=(int... |
s022714461 | p02243 | C | #include<stdio.h>
#include<stdlib.h>
#define INFTY 2097152//(1<<21)
struct Ver{
int weight;
int key;
struct Ver *next;
};
void Input(int);
void Create(int,int,int);// create vertex
void ShortestPath(void);//find shortest path
int Set(int*);//set test veriable
int Heap(int*);//create heap tree
int n;
i... | main.c: In function 'Input':
main.c:58:9: error: implicit declaration of function 'Create_Vertex' [-Wimplicit-function-declaration]
58 | Create_Vertex(id, u, c);
| ^~~~~~~~~~~~~
main.c: In function 'Create':
main.c:73:48: error: expected ';' before 'work'
73 | while(work->next != NULL) w... |
s147086898 | p02243 | C | #include<stdio.h>
#include<stdlib.h>
#define INFTY 2097152//(1<<21)
struct Ver{
int weight;
int key;
struct Ver *next;
};
void Input(int);
void Create(int,int,int);// create vertex
void ShortestPath(void);//find shortest path
int Set(int*);//set test veriable
int Heap(int*);//create heap tree
int n;
i... | main.c: In function 'Input':
main.c:58:9: error: implicit declaration of function 'Create_Vertex' [-Wimplicit-function-declaration]
58 | Create_Vertex(id, u, c);
| ^~~~~~~~~~~~~
|
s601066131 | p02243 | C | }
}
}
for(i=0 ; i<n ; i++){
printf("%d %d\n",i,d[i]);
}
return 0;
} | main.c:1:7: error: expected identifier or '(' before '}' token
1 | }
| ^
main.c:2:5: error: expected identifier or '(' before '}' token
2 | }
| ^
main.c:3:3: error: expected identifier or '(' before '}' token
3 | }
| ^
main.c:4:3: error: expected identifier or '(' b... |
s449015991 | p02243 | C | #include<stdio.h>
#define N 100
#define MAX 1000000
#define WHITE 0
#define BLACK 1
int main(){
int a[N][N];
int d[N],color[N];
int i,j,n,k,u,v;
int mincost;
scanf("%d",&n);
for( i=0 ; i<n ; i++ ){
for( j=0 ; j<n ; j++ ){
a[i][j] = MAX;
}
}
for( i=0 ; i<n ; i++ ){
d[i] = MAX;
co... | main.c: In function 'main':
main.c:38:6: error: stray '#' in program
38 | }#include<stdio.h>
| ^
main.c:38:7: error: 'include' undeclared (first use in this function)
38 | }#include<stdio.h>
| ^~~~~~~
main.c:38:7: note: each undeclared identifier is reported only once for each funct... |
s570125259 | p02243 | C | #include <stdio.h>
#define INF 10000000
#define NIL -1
void dijkstra(void);
int n,a[10001][5001],w=0,d[10001],color[10001];
int main()
{
int i,j,u,k,v;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
a[i][j]=-1;
}
}
for(i=0;i<n;i++){
scanf("%d",&u); //頂点の番号
scanf("%d",&k); /... | main.c: In function 'dijkstra':
main.c:48:16: error: 'WHITE' undeclared (first use in this function)
48 | color[u] = WHITE;
| ^~~~~
main.c:48:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:56:23: error: 'BLACK' undeclared (first use in this ... |
s904406115 | p02243 | C | #include <stdio.h>
#define INF 200000000
#define NIL -1
#define WHITE 1
#define BLACK 3
int n,a[1000000][1000000],d[1000000],color[1000000],pi[10000000],adj[1000000];
void prim(int r){
int i;
for(i=1;i<=n;i++){
d[i]=INF;
pi[i]=NIL;
color[i]=WHITE;
}
d[r]=0;
}
int main(){
int i,j,min,sum=0, min2... | /tmp/ccwkuCcT.o: in function `prim':
main.c:(.text+0x20): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccwkuCcT.o
main.c:(.text+0x3b): relocation truncated to fit: R_X86_64_PC32 against symbol `pi' defined in .bss section in /tmp/ccwkuCcT.o
main.c:(.text+0x56): relocatio... |
s506838428 | p02243 | C | #include<stdio.h>
#include<limits.h>
#define N 200001
#define nil -1
#define WHITE 0
#define BLACK 1
#define INF 9999999
int n,G[N][N],d[N],pi[N],color[N];
void dijkstra(int , int);
void initializeSingleSource(int);
int main(){
int i,j,u,k,c,v,w=INF,r;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j+... | /tmp/ccexd6Q5.o: in function `main':
main.c:(.text+0x162): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccexd6Q5.o
/tmp/ccexd6Q5.o: in function `dijkstra':
main.c:(.text+0x1c2): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp... |
s855243176 | p02243 | C | #include<stdio.h>
#define MAX 100000
#define inf 1000000000
#define NIL -1000000000
#define WHITE 0
#define BLACK 1
int n;
int d[MAX],pi[MAX],color[MAX],G[MAX][MAX];
dijkstra(){
int v,i,u,mincost;
for(v=0;v<n;v++){
d[v]=inf;
pi[v]=NIL;
color[v]=WHITE;
}
d[0]=0;
while(1){
mincost=inf;
... | main.c:12:1: error: return type defaults to 'int' [-Wimplicit-int]
12 | dijkstra(){
| ^~~~~~~~
|
s888999482 | p02243 | C | #include<stdio.h>
int a[100001][100001];
int d[100001];
int pi[100001];
char color[100001];
int n,mincost,sumcost=0;
void dijkstra(void);
int main(){
int i,j,u,k,v;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d" ,&u,&k);
for(j=1;j<=k;j++){
scanf("%d",&v);
scanf("%d",&a[u][v]);
}
... | main.c: In function 'dijkstra':
main.c:34:10: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000000' to '1410065408' [-Woverflow]
34 | d[i]=10000000000;
| ^~~~~~~~~~~
/tmp/ccjhxPyi.o: in function `main':
main.c:(.text+0xb): relocation truncated to fit: R_X86_64_P... |
s265723759 | p02243 | C | #include<stdio.h>
int a[100001][100001];
int d[100001];
int pi[100001];
char color[100001];
int n,mincost;
void dijkstra(void);
int main(){
int i,j,u,k,v;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
a[i][j]=0;
}
}
for(i=0;i<n;i++){
scanf("%d %d" ,&u,&k);
for(j=1;j<=k;j++)... | /tmp/cctEMm8r.o: in function `main':
main.c:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cctEMm8r.o
main.c:(.text+0x69): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cctEMm8r.o
main.c:(.text+0x78): relocation ... |
s963929352 | p02243 | C | #include<stdio.h>
#define inf 1000000010
int v[10001][10001];
int a[10001][10001];
int d[10001];
char color[10001];
int n,mincost;
int k;
void dijkstra(void);
int main(){
int i,j,u;
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,&... | main.c: In function 'main':
main.c:23:25: error: subscripted value is neither array nor pointer nor vector
23 | scanf("%d %d" ,&u,&k[i]);
| ^
main.c: In function 'dijkstra':
main.c:43:5: error: 'pi' undeclared (first use in this function); did you mean 'i'?
43 | pi[i] = -1;
... |
s821956665 | p02243 | C | #include<stdio.h>
#define inf 1000000010
int v[10001][10001];
int a[10001][10001];
int d[10001];
char color[10001];
int n,mincost;
int k;
void dijkstra(void);
int main(){
int i,j,u;
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,&... | main.c: In function 'main':
main.c:23:25: error: subscripted value is neither array nor pointer nor vector
23 | scanf("%d %d" ,&u,&k[i]);
| ^
|
s124660926 | p02243 | C | #include<stdio.h>
#define inf 1000000010
struct edge{
int start;
int goal;
int a;
};
typedef struct edge Edge;
Edge L[10000];
int v;
int d[10000];
char color[10000];
int n,mincost;
int k;
void dijkstra(void);
int main(){
int i,u;
static int j;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
... | main.c: In function 'main':
main.c:37:17: error: 'start' undeclared (first use in this function)
37 | L[j].start=start;
| ^~~~~
main.c:37:17: note: each undeclared identifier is reported only once for each function it appears in
|
s865614608 | p02243 | C | #include<stdio.h>
#include<stdlib.h>
#define N 1000000
#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 edges){
int i,flag;
for(i=0;i<n;i++){
d[i]=INF;
}
d[0]=0;
flag=1;
while(flag!=0){
... | /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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.