submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s283121827 | p02238 | C++ | #include <stdio.h>
int A[101][101];
int ans[101][3];
int an = 1;
int serch(int a[][], int ni, int n){
int j;
for(j=0; j<n; j++){
if(A[ni][j] == 1){
judge(j, 1);
serch(A, j, n);
}
}
judge(ni, 2);
}
int judge(int i, int j){
ans[i][j] = an;
an++;
}
int main(){
int i, j, k, n, x,... | a.cc:7:15: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first
7 | int serch(int a[][], int ni, int n){
| ^
a.cc:7:20: error: expected ')' before ',' token
7 | int serch(int a[][], int ni, int n){
| ~ ^
| ... |
s346269473 | p02238 | C++ | #include <stdio.h>
int A[101][101];
int ans[101][3];
int an = 1;
int serch(int a[][], int ni, int n){
int j;
for(j=0; j<n; j++){
if(A[ni][j] == 1){
judge(j, 1);
serch(A, j, n);
}
}
judge(ni, 2);
}
int judge(int i, int j){
ans[i][j] = an;
an++;
}
int main(){
int i, j, k, n, x,... | a.cc:7:15: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first
7 | int serch(int a[][], int ni, int n){
| ^
a.cc:7:20: error: expected ')' before ',' token
7 | int serch(int a[][], int ni, int n){
| ~ ^
| ... |
s671395576 | p02238 | C++ | #include <stdio.h>
int A[101][101];
int ans[101][3];
int an = 1;
int serch(int a[][], int ni, int n){
int j;
for(j=0; j<n; j++){
if(A[ni][j] == 1){
judge(j, 1);
serch(A, j, n);
}
}
judge(ni, 2);
}
int judge(int i, int j){
if(ans[i][j] == 0){
ans[i][j] = an;
an++;
}
}
int... | a.cc:7:15: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first
7 | int serch(int a[][], int ni, int n){
| ^
a.cc:7:20: error: expected ')' before ',' token
7 | int serch(int a[][], int ni, int n){
| ~ ^
| ... |
s035855439 | p02238 | C++ | #include <stdio.h>
int A[101][101];
int ans[101][3];
int an = 1;
int serch(int a[101][101], int ni, int n){
int j;
for(j=0; j<n; j++){
if(A[ni][j] == 1){
judge(j, 1);
serch(A, j, n);
}
}
judge(ni, 2);
}
int judge(int i, int j){
if(ans[i][j] == 0){
ans[i][j] = an;
an++;
}
... | a.cc: In function 'int serch(int (*)[101], int, int)':
a.cc:12:7: error: 'judge' was not declared in this scope
12 | judge(j, 1);
| ^~~~~
a.cc:16:3: error: 'judge' was not declared in this scope
16 | judge(ni, 2);
| ^~~~~
a.cc:17:1: warning: no return statement in function returning no... |
s416855484 | p02238 | C++ | #include <iostream>
using namespace std;
int n,u,k,v,**M,flag[100],s_time[100],f_time[100];
void creat()
{
cin>>n;
M=new int*[n];
for(int i=0;i<n;i++)
{
M[i]=new int[n];
flag[i]=0;
for(int j=0;j<n;j++)
M[i][j]=0;
}
int count=0;
while(count<n)
{
count++;
cin>>u>>k;... | a.cc:33:5: error: 'int time' redeclared as different kind of entity
33 | int time = 0;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s002404634 | p02238 | C++ | #include <iostream>
using namespace std;
int n,u,k,v,**M,flag[100],s_time[100],f_time[100];
void creat()
{
cin>>n;
M=new int*[n];
for(int i=0;i<n;i++)
{
M[i]=new int[n];
flag[i]=0;
for(int j=0;j<n;j++)
M[i][j]=0;
}
int count=0;
while(count<n)
{
count++;
cin>>u>>k;... | a.cc:33:5: error: 'int time' redeclared as different kind of entity
33 | int time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s608869730 | p02238 | C++ | #include <iostream>
using namespace std;
int n,u,k,v,**M,flag[100],s_time[100],f_time[100];
void creat()
{
cin>>n;
M=new int*[n];
for(int i=0;i<n;i++)
{
M[i]=new int[n];
flag[i]=0;
for(int j=0;j<n;j++)
M[i][j]=0;
}
int count=0;
while(count<n)
{
count++;
cin>>u>>k;... | a.cc: In function 'void dfs(int)':
a.cc:45:17: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
45 | f_time[cur]=time;
| ^~~~
| |
| time_t (*)(time_t*) noexcept {aka lon... |
s154983893 | p02238 | C++ | 6
1 2 2 4
2 1 5
3 2 5 6
4 0
5 1 4
6 1 6 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 6
| ^
|
s311413945 | p02238 | C++ | #include <iostream>
#include <vector>
#define N 2000
using namespace std;
vector<vector<int> > pa;
vector<vector<int> > ch;
int first[N] = {0};
int second[N] = {0};
int timestamp = 0;
void dfs(int x) {
if (ch[x].empty()) {
return;
} else {
for (int i = 0; i < ch[x].size(); i++) {
if... | a.cc: In function 'int main()':
a.cc:47:13: error: 'sort' was not declared in this scope; did you mean 'short'?
47 | sort(pa[i].begin(), pa[i].end(), less<int>());
| ^~~~
| short
a.cc:52:13: error: 'sort' was not declared in this scope; did you mean 'short'?
52 | ... |
s469545039 | p02238 | C++ | #include <iostream>
#include <fstream>
#include <cassert>
#include <string.h>
#include <vector>
#include <map>
#include <stack>
enum Color
{
kWhite,
kGray,
kBlack,
};
// 頂点数.
int n;
// 各頂点の隣接リスト表現.
std::map< int, std::vector<int> > adj_list;
// 各頂点の訪問状態を管理する.
std::vector<Color> c;
// 初回訪問時.
std::vector... | a.cc: In function 'int nextVertex(int)':
a.cc:67:12: error: 'INT_MAX' was not declared in this scope
67 | return INT_MAX;
| ^~~~~~~
a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
7 | #include <stack>
+++ |+#include <climi... |
s927200879 | p02238 | C++ | // Ref : https://book.mynavi.jp/ec/products/detail/id=35408
#include <iostream>
using namespace std;
static const int N = 100;
int G[N][N] = { {} };
int n, time = 0;
int detected_t[N] = {};
int finished_t[N] = {};
void depthFirstSearch(int ix) {
if (!detected_t[ix - 1]) {
detected_t[ix - 1] = ++time;
for (int ... | a.cc:8:8: error: 'int time' redeclared as different kind of entity
8 | int n, time = 0;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s819931136 | p02238 | C++ | #include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <list>
#include <stdio.h>
#include <algorithm>
#define MAX 100000
using namespace std;
typedef long long ll;
int map[255][255];
int f[255],d[255],time;
bool vis[255];
void dfs(int n,int u)
{
if(vis[u... | a.cc:14:19: error: 'int time' redeclared as different kind of entity
14 | int f[255],d[255],time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/... |
s475488112 | p02238 | C++ | #include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <list>
#include <stdio.h>
#include <algorithm>
#define MAX 100000
using namespace std;
typedef long long ll;
int map[255][255];
int f[255],d[255],time;
bool vis[255];
void dfs(int n,int u)
{
if(vis[u... | a.cc:14:19: error: 'int time' redeclared as different kind of entity
14 | int f[255],d[255],time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/... |
s940335059 | p02238 | C++ | #include <iostream>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <stack>
#include <queue>
#include <list>
#include <stdio.h>
#include <algorithm>
#define MAX 100000
using namespace std;
typedef long long ll;
int map[255][255];
int f[255],d[255],time=0;
bool vis[255];
void dfs(int n,int u)
{
if(vis... | a.cc:14:19: error: 'int time' redeclared as different kind of entity
14 | int f[255],d[255],time=0;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c+... |
s158470320 | p02238 | C++ | #include <stdio.h>
#include <stdint.h>
#include <iostream>
#include <fstream>
#include <cassert>
#include <climits>
#include <vector>
using namespace std;
#define DEBUG (0)
#if DEBUG
#define DPRINTF(...) do { \
printf("D(L%d) %s: ", __LINE__, __func__); \
printf(__VA_ARGS__); \
} while (false)
#else
#defin... | a.cc:60:3: error: 'unique_ptr' does not name a type
60 | unique_ptr<int[]> adjacentIds_;
| ^~~~~~~~~~
a.cc: In constructor 'Vertex::Vertex()':
a.cc:31:5: error: class 'Vertex' does not have any field named 'adjacentIds_'
31 | adjacentIds_(nullptr),
| ^~~~~~~~~~~~
a.cc: In member function '... |
s322067855 | p02238 | C++ | #include <stdio.h>
#include <stdint.h>
#include <iostream>
#include <fstream>
#include <cassert>
#include <climits>
#include <vector>
using namespace std;
#define DEBUG (0)
#if DEBUG
#define DPRINTF(...) do { \
printf("D(L%d) %s: ", __LINE__, __func__); \
printf(__VA_ARGS__); \
} while (false)
#else
#defin... | a.cc:60:3: error: 'unique_ptr' does not name a type
60 | unique_ptr<int[]> adjacentIds_;
| ^~~~~~~~~~
a.cc: In constructor 'Vertex::Vertex()':
a.cc:31:5: error: class 'Vertex' does not have any field named 'adjacentIds_'
31 | adjacentIds_(nullptr),
| ^~~~~~~~~~~~
a.cc: In member function '... |
s269461961 | p02238 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Competitive
{
internal class Node
{
public List <Edge> Edges;
public int Dist;
public int No;
public bool Visited;
public int Start;
public int End;
public Nod... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.L... |
s693899883 | p02238 | C++ | /*
* ALDS1_11_B.cpp
*
* Created on: May 5, 2018
* Author: 13743
*/
#include<iostream>
#include<vector>
using namespace std;
int d[101];
int f[101];
int time;
void dfsRec(vector<int>* a, int n, int v) {
if(d[v] > 0) return;
time++;
d[v] = time;
for(int &x:a[v]) {
dfsRec(a, n, x);
}
time++;
f[v] =... | a.cc:15:5: error: 'int time' redeclared as different kind of entity
15 | int time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s729387008 | p02238 | C++ | /*
* ALDS1_11_B.cpp
*
* Created on: May 5, 2018
* Author: 13743
*/
#include<iostream>
#include<vector>
using namespace std;
int d[101];
int f[101];
int time;
void dfsRec(vector<int>* a, int n, int v) {
if(d[v] > 0) return;
time++;
d[v] = time;
for(int &x:a[v]) {
dfsRec(a, n, x);
}
time++;
f[v] =... | a.cc:15:5: error: 'int time' redeclared as different kind of entity
15 | int time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s888814166 | p02238 | C++ | /*
* ALDS1_11_B.cpp
*
* Created on: May 5, 2018
* Author: 13743
*/
#include<iostream>
#include<vector>
using namespace std;
int d[101];
int f[101];
int time;
void dfsRec(vector<int>* a, int n, int v) {
if(d[v] > 0) return;
time++;
d[v] = time;
for(int &x:a[v]) {
dfsRec(a, n, x);
}
time++;
f[v] =... | a.cc:15:5: error: 'int time' redeclared as different kind of entity
15 | int time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s998244467 | p02238 | C++ | #include<iostream>
using namespace std;
#define MAX 100
int mat[MAX][MAX] = {};
int n, time = 0, d[MAX] = {}, f[MAX] = {};
bool c[MAX];
void dfs_visit(int u){
c[u] = true;
d[u] = ++time;
for(int i = 0; i < n; i++){
if(mat[u][i] == 0) continue;
if(!c[i]) dfs_visit(i);
}
f[u] = ++... | a.cc:6:8: error: 'int time' redeclared as different kind of entity
6 | int n, time = 0, d[MAX] = {}, f[MAX] = {};
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gn... |
s631417345 | p02238 | C++ | #include<iostream>
using namespace std;
#define MAX 100
int mat[MAX][MAX] = {};
int n;
int time = 0;
int d[MAX] = {}, f[MAX] = {};
bool c[MAX];
void dfs_visit(int u){
c[u] = true;
d[u] = ++time;
for(int i = 0; i < n; i++){
if(mat[u][i] == 0) continue;
if(!c[i]) dfs_visit(i);
}
f... | a.cc:7:5: error: 'int time' redeclared as different kind of entity
7 | int time = 0;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s869740731 | p02238 | C++ | #include<iostream>
#include<stack>
using namespace std;
static const int N = 100;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[N][N];
int color[N], d[N], f[N], tt;
int nt[N];
int next(int u) {
for (int v = nt[u]; v < n; v++) {
nt[u] = v + 1;
if (M[u][v]) {
... | a.cc: In function 'void dfs_visit(int)':
a.cc:31:3: error: 's' was not declared in this scope
31 | s.push(r);
| ^
|
s619147578 | p02238 | C++ | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
static const int N = 100; // 1 <= n <= 100
static const int WHITE = 0; // 未訪問は0
static const int GRAY = 1; // 訪問中は1
static const int BLACK = 2; // 訪問完了は2
int n; // 頂点数n
vector<vector<int>> M(N, vector<int>(N,0)); // M[u][v]:uからvに出ているか否か
vect... | a.cc:98:1: error: expected declaration before '}' token
98 | }
| ^
|
s412510550 | p02238 | C++ | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
static const int N = 100; // 1 <= n <= 100
static const int WHITE = 0; // 未訪問は0
static const int GRAY = 1; // 訪問中は1
static const int BLACK = 2; // 訪問完了は2
int n; // 頂点数n
vector<vector<int>> M(N, vector<int>(N,0)); // M[u][v]:uからvに出ているか否か
vect... | a.cc:98:1: error: expected declaration before '}' token
98 | }
| ^
|
s450200259 | p02238 | C++ | #include <iostream>
#include <string>
#include <map>
#include <stack>
#include <algorithm>
using namespace std;
#define MAX 100000
static const int N=100;
static const int WHITE=0;
static const int GRAY=1;
static const int BLACK=2;
int n, M[N][N];
int color[N],d[N],f[N],tt;
int nt[N];
int next(int u){
for(int v=nt... | a.cc: In function 'void dfs()':
a.cc:52:14: error: 'white' was not declared in this scope; did you mean 'fwrite'?
52 | color[i]=white;
| ^~~~~
| fwrite
|
s665379386 | p02238 | C++ | #include<iostream>
#include<stack>
using namespace std;
static const int N = 100;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n, M[N][N];
int color[N], d[N], f[N], tt;
int nt[N];
int next(int u){
for ( int v = nt[u]; v < n; v++ ) {
nt[u] = v + 1;
if ( M[u][v] ) ret... | a.cc: In function 'int main()':
a.cc:64:3: error: 'cint' was not declared in this scope; did you mean 'uint'?
64 | cint >> n;
| ^~~~
| uint
|
s620489597 | p02238 | C++ | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
using namespace std;
const int maxn = 100 + 5;
int a[maxn][maxn];
bool vis[maxn];
int d[maxn];
int f[maxn];
int time = 0;
int n;
void dfs(int u)
{
vis[u] = true;
d[u] = ++time;
for (int i = 1; i <= n; i++)
... | a.cc:13:5: error: 'int time' redeclared as different kind of entity
13 | int time = 0;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s148547707 | p02238 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s422893189 | p02238 | C++ | n=int(input())
l=[[0 for i in range(n)] for j in range(n)]##静的確保 隣接行列
d=[0 for i in range(n)]##発見
f=[0 for i in range(n)]##完了
stack=[]##スタック
check=[]
for i in range(n):
p=[int(x) for x in input().split()]
for j in range(n):
if j+1 in p[2:]:
l[i][j]=1
##print("---隣接行列---")
##print(l)
... | a.cc:3:44: error: stray '##' in program
3 | l=[[0 for i in range(n)] for j in range(n)]##静的確保 隣接行列
| ^~
a.cc:4:24: error: stray '##' in program
4 | d=[0 for i in range(n)]##発見
| ^~
a.cc:5:24: error: stray '##' in program
5 | f=[0 ... |
s413722760 | p02238 | C++ | n=int(input())
l=[[0 for i in range(n)] for j in range(n)]##静的確保 隣接行列
d=[0 for i in range(n)]##発見
f=[0 for i in range(n)]##完了
stack=[]##スタック
check=[]
for i in range(n):
p=[int(x) for x in input().split()]
for j in range(n):
if j+1 in p[2:]:
l[i][j]=1
##print("---隣接行列---")
##print(l)
... | a.cc:3:44: error: stray '##' in program
3 | l=[[0 for i in range(n)] for j in range(n)]##静的確保 隣接行列
| ^~
a.cc:4:24: error: stray '##' in program
4 | d=[0 for i in range(n)]##発見
| ^~
a.cc:5:24: error: stray '##' in program
5 | f=[0 ... |
s416332098 | p02238 | C++ | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> adjlist;
int time=1;
vector<int> d;
vector<int> f;
void input(int n){
vector<int> f={0,0};
adjlist.push_back(f);
for(int i=0;i<n;i++){
vector<int> list;
int ln;
cin>>ln;
list.push_back(ln);
cin>>ln;
list.push_back... | a.cc:5:5: error: 'int time' redeclared as different kind of entity
5 | int time=1;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s572352032 | p02238 | C++ | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> adjlist;
int time=1;
vector<int> d;
vector<int> f;
void input(int n){
vector<int> f={0,0};
adjlist.push_back(f);
for(int i=0;i<n;i++){
vector<int> list;
int ln;
cin>>ln;
list.push_back(ln);
cin>>ln;
list.push_back... | a.cc:5:5: error: 'int time' redeclared as different kind of entity
5 | int time=1;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s438010909 | p02238 | C++ | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int n, u, k, v, d[110], f[110], time=0;
bool vis[110];
vector<int> adj[110];
void dfs (int p)
{
time++;
vis[p]=true;
d[p]=time;
for (auto u : adj[p])
{
if (!vis[u]) dfs(u);
}
time++;
f[p]=time;
}
in... | a.cc:7:33: error: 'int time' redeclared as different kind of entity
7 | int n, u, k, v, d[110], f[110], time=0;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/... |
s861147915 | p02238 | C++ | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int n, u, k, v, d[110], f[110], time=0;
bool vis[110];
vector<int> adj[110];
void dfs (int p)
{
time++;
vis[p]=true;
d[p]=time;
for (auto u : adj[p])
{
if (!vis[u]) dfs(u);
}
time++;
f[p]=time;
}
in... | a.cc:7:33: error: 'int time' redeclared as different kind of entity
7 | int n, u, k, v, d[110], f[110], time=0;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/... |
s993522176 | p02238 | C++ | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int n, u, k, v, d[110], f[110], time=0;
bool vis[110];
vector<int> adj[110];
void dfs (int p)
{
time++;
vis[p]=true;
d[p]=time;
for (auto u : adj[p])
{
if (!vis[u]) dfs(u);
}
time++;
f[p]=time;
}
in... | a.cc:7:33: error: 'int time' redeclared as different kind of entity
7 | int n, u, k, v, d[110], f[110], time=0;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/... |
s869256864 | p02238 | C++ | #include <stdio.h>
int time, n;
int d[100], f[100], color[100];
void dfs_init(){
for (int i=0; i<100; i++) color[i] = 0;
dfs();
}
void dfs(int u) {
color[u] = 1
d[u] = ++time;
for (int i=0; i<n; i++) {
if(M[u][i] && color[i] == 0) {
dfs(i);
}
}
color[u] = 2;
... | a.cc: In function 'void dfs_init()':
a.cc:8:5: error: 'dfs' was not declared in this scope
8 | dfs();
| ^~~
a.cc: In function 'void dfs(int)':
a.cc:12:17: error: expected ';' before 'd'
12 | color[u] = 1
| ^
| ;
13 | d[u] = ++time;
| ... |
s326414451 | p02238 | C++ | #include <stdio.h>
int time, n;
int d[100], f[100], color[100];
void dfs(int u) {
color[u] = 1
d[u] = ++time;
for (int i=0; i<n; i++) {
if(M[u][i] && color[i] == 0) {
dfs(i);
}
}
color[u] = 2;
f[u] = ++time;
}
void dfs_init(){
for (int i=0; i<100; i++) color[i]... | a.cc: In function 'void dfs(int)':
a.cc:7:17: error: expected ';' before 'd'
7 | color[u] = 1
| ^
| ;
8 | d[u] = ++time;
| ~
a.cc:10:12: error: 'M' was not declared in this scope
10 | if(M[u][i] && color[i] == 0) {
| ... |
s637751992 | p02238 | C++ | a
| a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s986722246 | p02238 | C++ | #include<iostream>
using namespace std;
int main(){
int n,k,v,u;
cin>>n;
int V[100][100]; //隣接リスト
int cnt[100]; //各点においてどこまでみたかの把握
int d[100];
int f[100];
int time=1;
int l=0;
int come[100]; //その点はどこからきたかの把握
//初期化
for(int i=0;i<100;i++){
for(int j=0;j<100;j++){
V[i][j]=0;
cnt[j]=... | a.cc:9:16: error: extended character is not valid in an identifier
9 | int cnt[100]; //各点においてどこまでみたかの把握
| ^
a.cc: In function 'int main()':
a.cc:9:16: error: '\U00003000' was not declared in this scope
9 | int cnt[100]; //各点においてどこまでみたかの把握
| ^~
a.cc:21:7: error: 'd... |
s352399106 | p02238 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s510268541 | p02238 | C++ | #include <iostream>
using namespace std;
int cnt = 1;
void DepthFirstSearch(int now,int n,int a[][],int b[],int c[],int d[]){
b[now]=1;
c[now]=cnt;
cnt++;
for(int i=0;i<n;i++){
if(a[now][i] && b[i]!=1){
DepthFirstSearch(i,n,a,b,c,d);
cnt++;
}
}
d[now]=cnt;
}
int m... | a.cc:4:41: error: declaration of 'a' as multidimensional array must have bounds for all dimensions except the first
4 | void DepthFirstSearch(int now,int n,int a[][],int b[],int c[],int d[]){
| ^
a.cc:4:46: error: expected ')' before ',' token
4 | void DepthFirstSea... |
s537839074 | p02238 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s397552470 | p02238 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s813327978 | p02239 | Java |
import java.util.*;
public class ALDS1_11_C2 {
public static void main(String[] args){
Scanner stdIn = new Scanner(System.in);
int V = stdIn.nextInt();
boolean[][] judg = new boolean[V+1][V+1];
for(int i=0;i<V+1;i++){
Arrays.fill(judg[i], false);
}
for(int i=1;i<V+1;i++){
int id = stdIn.nextInt();
... | Main.java:4: error: class ALDS1_11_C2 is public, should be declared in a file named ALDS1_11_C2.java
public class ALDS1_11_C2 {
^
1 error
|
s803223563 | p02239 | Java | import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;
public class Main_breadth_first_search_Bellman_Ford {
public static class edge {
int from;
int to;
int cost;
edge (int _from, int _to, int _cost) {
fr... | Main.java:7: error: class Main_breadth_first_search_Bellman_Ford is public, should be declared in a file named Main_breadth_first_search_Bellman_Ford.java
public class Main_breadth_first_search_Bellman_Ford {
^
1 error
|
s795367193 | p02239 | Java | import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
static Map<Integer, int[]> map = new HashMap<Integer, int[]>();
static Map<Integer, Boolean> visited = new HashMap<Integer, Boolean>();
static List<Integer> que = new ArrayLi... | Main.java:48: error: not a statement
}else{ (map.get(v) != null){
^
Main.java:48: error: ';' expected
}else{ (map.get(v) != null){
^
Main.java:68: error: 'catch' without 'try'
}catch (NullPointerException e){
... |
s450933303 | p02239 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
class Main{
public static void main(String[] args)throws NumberFormatException, IOException{
InputStreamReader input = new InputStreamReader (System. in);
BufferedReader buffer = new Buff... | Main.java:36: error: cannot find symbol
for(int i=0; i<list.size(); i++){
^
symbol: variable list
location: class Main
Main.java:37: error: cannot find symbol
foundPosition[list.get(i) -1 ] = nowDepth;
^
symbol: variable list
location: class Main
Main.j... |
s932697630 | p02239 | 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
| |
s878419745 | p02239 | C | 6
1 2 2 4
2 1 5
3 2 5 6
4 0
5 1 4
6 1 6
| main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 6
| ^
|
s059385552 | p02239 | C | #include<stdio.h>
#define WHITE 0 //non-visited
#define GRAY 1 //visited
#define BLACK 2 //finished
#define N 101
typedef struct{
int id;
int k;
int v[N];
int color;
}V;
//void DFS_Visit(int);
int n=0, head=0, tail=0;
int d[N],Q[N];
V S[N];
void BFS(int s){
int i,u;
for(i=1 ; i<=n ; i++) {
... | main.c: In function 'BFS':
main.c:23:5: error: 'color' undeclared (first use in this function)
23 | color[i] = WHITE;
| ^~~~~
main.c:23:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:12: error: 'NIL' undeclared (first use in this function)
24 | ... |
s086766517 | p02239 | C | int *queue;
int head;
int tail;
void enqueue(int);
int dequeue(void);
void bfs(void);
int main(){
int i,j,u,k,v;
scanf("%d",&n);
queue = malloc(n * sizeof(int));
color = malloc((n+1) * sizeof(int));
dist = malloc((n+1) * sizeof(int));
matrix = malloc((n+1) * sizeof(int *));
for(i=0;i<n+1;i++) ma... | main.c: In function 'main':
main.c:13:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
13 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int *queue;
main.c:13:3: warning: incompatible... |
s855487556 | p02239 | C | #include <stdio.h>
#include <stdlib.h>
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define MAX_N 100
int n,time,head,tail;
int *queue;
int *dist;
int *color;
int* matrix[MAX_N];
void enqueue(int);
int dequeue(void);
void bfs(void);
int main(){
int i,j,u,k,v;
scanf("%d",&n);
queue = malloc(n * sizeof(int)... | main.c: In function 'enqueue':
main.c:86:32: error: 'cout' undeclared (first use in this function)
86 | if(++tail == n+1){ tail = 0; cout<<'a'<<endl;}
| ^~~~
main.c:86:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:86:43: error... |
s577513687 | p02239 | C | #include <stdio.h>
#include <stdlib.h>
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define MAX_N 100
int n,time,head,tail;
int *queue;
int *dist;
int *color;
int **matrix;
void enqueue(int);
int dequeue(void);
void bfs(void);
int main(){
int i,j,u,k,v;
scanf("%d",&n);
queue = malloc(n * sizeof(int)... | main.c: In function 'enqueue':
main.c:88:30: error: 'cout' undeclared (first use in this function)
88 | if(++tail == n+1) tail = 0,cout<<'a'<<endl;
| ^~~~
main.c:88:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:88:41: error: 'en... |
s085680404 | p02239 | C | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define WHITE 0
#define GRAY 1
#define BLACK 2
char a[100][100]; //??£??\??????
int n; //??????????????????
short d[100]; //??????1??????????????¢
char color[100]; //??¢?´¢??¶???
short q[100]; //?????\???
short h, t; //?????\????????... | main.c: In function 'bfs':
main.c:54:12: warning: overflow in conversion from 'long int' to 'short int' changes value from '9223372036854775807' to '-1' [-Woverflow]
54 | d[u] = LONG_MAX;
| ^~~~~~~~
main.c:62:11: error: assignment to 'short int' from 'short int (*)()' makes integer from pointer ... |
s246664477 | p02239 | C | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define WHITE 0
#define GRAY 1
#define BLACK 2
void enqueue(short);
short dequeue();
void bfs();
char a[100][100]; //??£??\??????
int n; //??????????????????
short d[100]; //??????1??????????????¢
char color[100]; //??¢?´¢??¶???
short q[100];... | main.c: In function 'bfs':
main.c:58:12: warning: overflow in conversion from 'long int' to 'short int' changes value from '9223372036854775807' to '-1' [-Woverflow]
58 | d[u] = LONG_MAX;
| ^~~~~~~~
main.c:84:15: error: redeclaration of 'i' with no linkage
84 | short i;
| ... |
s940224692 | p02239 | C | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define WHITE 0
#define GRAY 1
#define BLACK 2
void enqueue(short);
short dequeue();
void bfs();
char a[100][100]; //??£??\??????
int n; //??????????????????
short d[100]; //??????1??????????????¢
char color[100]; //??¢?´¢??¶???
short q[100];... | main.c: In function 'bfs':
main.c:58:12: warning: overflow in conversion from 'long int' to 'short int' changes value from '9223372036854775807' to '-1' [-Woverflow]
58 | d[u] = LONG_MAX;
| ^~~~~~~~
main.c:84:15: error: redeclaration of 'i' with no linkage
84 | short i;
| ... |
s553479038 | p02239 | C | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define WHITE 0
#define GRAY 1
#define BLACK 2
void enqueue(short);
short dequeue();
void bfs();
char a[100][100]; //??£??\??????
int n; //??????????????????
short d[100]; //??????1??????????????¢
char color[100]; //??¢?´¢??¶???
short q[100];... | main.c: In function 'bfs':
main.c:58:12: warning: overflow in conversion from 'long int' to 'short int' changes value from '9223372036854775807' to '-1' [-Woverflow]
58 | d[u] = LONG_MAX;
| ^~~~~~~~
main.c:84:15: error: redeclaration of 'i' with no linkage
84 | short i;
| ... |
s010588979 | p02239 | C | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define WHITE 0
#define GRAY 1
#define BLACK 2
char a[100][100]; //??£??\??????
int n; //??????????????????
short d[100]; //??????1??????????????¢
char color[100]; //??¢?´¢??¶???
short q[100]; //?????\???
short h, t; //?????\????????... | main.c: In function 'bfs':
main.c:54:12: warning: overflow in conversion from 'long int' to 'short int' changes value from '9223372036854775807' to '-1' [-Woverflow]
54 | d[u] = LONG_MAX;
| ^~~~~~~~
main.c:80:15: error: redeclaration of 'i' with no linkage
80 | short i;
| ... |
s386425771 | p02239 | C | import java.util.*;
public class Main {
public static void main(String[] args){
final Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
boolean[][] ju = new boolean[n+1][n+1];
for(int i=0;i<n+1;i++){
Arrays.fill(ju[i],false);
}
... | main.c:1:1: error: unknown type name 'import'
1 | import java.util.*;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.util.*;
| ^
main.c:3:1: error: unknown type name 'public'
3 | public class Main {
| ^~~~~~
main.c:... |
s427278017 | p02239 | C | #include<stdio.h>
int g[101][101];
int Q1[101];
int Q2[101];
int n
void f(int x, int y){
int i;
Q1[x] = y;
for(i = 1; i <= Q2[x]; i++)if(b + 1 < g[x][i]]) f(g[x][i], y + 1);
}
int main(){
int i, j, m;
scanf("%d", &n);
for(i = 1; i <= n; i++){
A[i] = 100000000;
scanf("%d", &m);
scanf... | main.c:7:6: error: expected ';' before 'void'
7 | int n
| ^
| ;
8 |
9 | void f(int x, int y){
| ~~~~
main.c: In function 'f':
main.c:12:33: error: 'b' undeclared (first use in this function)
12 | for(i = 1; i <= Q2[x]; i++)if(b + 1 < g[x][i]]) f(g[x][i], y + 1);
| ... |
s023717549 | p02239 | C | #include<stdio.h>
int g[101][101];
int Q1[101];
int Q2[101];
int n
void f(int x, int y){
int i;
Q1[x] = y;
for(i = 1; i <= Q2[x]; i++)if(b + 1 < g[x][i]]) f(g[x][i], y + 1);
}
int main(){
int i, j, m;
scanf("%d", &n);
for(i = 1; i <= n; i++){
Q1[i] = 100000000;
scanf("%d", &m);
scan... | main.c:7:6: error: expected ';' before 'void'
7 | int n
| ^
| ;
8 |
9 | void f(int x, int y){
| ~~~~
main.c: In function 'f':
main.c:12:33: error: 'b' undeclared (first use in this function)
12 | for(i = 1; i <= Q2[x]; i++)if(b + 1 < g[x][i]]) f(g[x][i], y + 1);
| ... |
s779259621 | p02239 | C | #include<stdio.h>
int g[101][101];
int Q1[101];
int Q2[101];
int n
void f(int x, int y){
int i;
Q1[x] = y;
for(i = 1; i <= Q2[x]; i++)if(y + 1 < g[x][i]]) f(g[x][i], y + 1);
}
int main(){
int i, j, m;
scanf("%d", &n);
for(i = 1; i <= n; i++){
Q1[i] = 100000000;
scanf("%d", &m);
scan... | main.c:7:6: error: expected ';' before 'void'
7 | int n
| ^
| ;
8 |
9 | void f(int x, int y){
| ~~~~
main.c: In function 'f':
main.c:12:48: error: expected ')' before ']' token
12 | for(i = 1; i <= Q2[x]; i++)if(y + 1 < g[x][i]]) f(g[x][i], y + 1);
| ... |
s903884482 | p02239 | C | #include<stdio.h>
int g[101][101];
int Q1[101];
int Q2[101];
int n
void f(int x, int y){
int i;
Q1[x] = y;
for(i = 1; i <= Q2[x]; i++)if(y + 1 < g[x][i]]) f(g[x][i], y + 1);
}
int main(){
int i, j, m;
scanf("%d", &n);
for(i = 1; i <= n; i++){
Q1[i] = 100000000;
scanf("%d", &m);
scan... | main.c:7:6: error: expected ';' before 'void'
7 | int n
| ^
| ;
8 |
9 | void f(int x, int y){
| ~~~~
main.c: In function 'f':
main.c:12:48: error: expected ')' before ']' token
12 | for(i = 1; i <= Q2[x]; i++)if(y + 1 < g[x][i]]) f(g[x][i], y + 1);
| ... |
s472330355 | p02239 | C | #include<stdio.h>
int g[101][101];
int Q1[101];
int Q2[101];
int n
void f(int x, int y){
int i;
Q1[x] = y;
for(i = 1; i <= Q2[x]; i++)if(y + 1 < g[x][i]]) f(g[x][i], y + 1);
}
int main(){
int i, j, m;
scanf("%d", &n);
for(i = 1; i <= n; i++){
Q1[i] = 100000000;
scanf("%d", &m);
scan... | main.c:7:6: error: expected ';' before 'void'
7 | int n
| ^
| ;
8 |
9 | void f(int x, int y){
| ~~~~
main.c: In function 'f':
main.c:12:48: error: expected ')' before ']' token
12 | for(i = 1; i <= Q2[x]; i++)if(y + 1 < g[x][i]]) f(g[x][i], y + 1);
| ... |
s401942389 | p02239 | C | #include<stdio.h>
#define g -3
#define w -2
#define b -1
int temp[101];
int time;
int d[101];javascript:void(0)
int f[101];
int N;
int A[101][101];
int Q[101];
main (){
int i,j,k,v,u;
for(i=1;i<101;i++){
for(j=1;j<101;j++){
A[i][j] = 0;
}
}
scanf("%d",&N);
for(i=1;i<=N;i++){
scanf... | main.c:10:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
10 | int d[101];javascript:void(0)
| ^
main.c:17:1: error: return type defaults to 'int' [-Wimplicit-int]
17 | main (){
| ^~~~
main.c: In function 'main':
main.c:39:3: error: implicit declaratio... |
s051610327 | p02239 | C | #define N 101
int G[N][N],way[N],chi[N],n;
void Fsearch(int x, int y){
int i;
way[x] = y;
for(i = 1; i <= chi[x]; i++)
if(y + 1 < way[G[x][i]]) find(G[x][i], y + 1);
}
int main(){
int i,j,m;
scanf("%d",&n);
for(i=1;i<=n;i++){
way[i]=N;
scanf("%d",&m);
scanf("%d",&chi[m]);
for... | main.c: In function 'Fsearch':
main.c:9:30: error: implicit declaration of function 'find' [-Wimplicit-function-declaration]
9 | if(y + 1 < way[G[x][i]]) find(G[x][i], y + 1);
| ^~~~
main.c: In function 'main':
main.c:15:3: error: implicit declaration of function 'scanf' [-Wim... |
s186112700 | p02239 | C | #define N 101
int G[N][N],way[N],chi[N],n;
void Fsearch(int x, int y){
int i;
way[x] = y;
for(i=1;i<=chi[x];i++)
if(y+1<way[G[x][i]]) FSearch(G[x][i], y + 1);
}
int main(){
int i,j,m;
scanf("%d",&n);
for(i=1;i<=n;i++){
way[i]=N;
scanf("%d",&m);
scanf("%d",&chi[m]);
for(j=1;j<... | main.c: In function 'Fsearch':
main.c:9:26: error: implicit declaration of function 'FSearch'; did you mean 'Fsearch'? [-Wimplicit-function-declaration]
9 | if(y+1<way[G[x][i]]) FSearch(G[x][i], y + 1);
| ^~~~~~~
| Fsearch
main.c: In function 'main':... |
s851313529 | p02239 | C | #include<stdio.h>
#include<stdlib.h>
typedef struct list{
int u, k, *v;
}T_list;
typedef struct graph{
int d, f;
}T_graph;
int n;
T_list *lst;
T_graph *grp;
int que[100];
int p, q;
void bfs(int);
int main(){
scanf("%d", &n);
lst = (T_list *)malloc(sizeof(T_list) * n);
grp = (T_graph *)malloc(sizeof(T_graph) *... | main.c: In function 'bfs':
main.c:57:3: error: expected declaration or statement at end of input
57 | }
| ^
|
s826101570 | p02239 | C | #include<stdio.h>
#define N 100
#define L 100000000
#define white 0
#define gray 1
#define black 2
typedef struct{
int data[N];
int head;
int tail;
}queue;
queue Q;
int n,d[N] = {L};
int g[N][N] = {0};
int color[N] = {white};
void bfs(int);
void enqueue(int);
int dequeue(void);
int main(){
int i,j,u,k,v;
... | main.c: In function 'bfs':
main.c:49:6: error: type of 's' defaults to 'int' [-Wimplicit-int]
49 | void bfs(s){
| ^~~
main.c:59:13: error: 'INF' undeclared (first use in this function)
59 | if(u == INF)break;
| ^~~
main.c:59:13: note: each undeclared identifier is reported only on... |
s273018855 | p02239 | C | #include<stdio.h>
#define Max 101
#define WHITE 0
#define GRAY 1
#define BRACK 2
int n, head, tail,;
int d[Max], m[Max][Max], p[Max], color[Max];
void bfc(int s){
int i,j;
for(i = 0 ; i < n ; i++){
color[i] = WHITE;
d[i] = -1;
}
color[s] = GRAY;
d[s] = 0;
enqueue(s);
while(head !=... | main.c:8:19: error: expected identifier or '(' before ';' token
8 | int n, head, tail,;
| ^
main.c: In function 'bfc':
main.c:21:4: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
21 | enqueue(s);
| ^~~~~~~
main.c:24:10: error: implicit decl... |
s693454219 | p02239 | C | #include<stdio.h>
#define Max 101
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, head, tail,;
int d[Max], m[Max][Max], p[Max], color[Max];
void bfc(int s){
int i, j;
for(i = 0 ; i < n ; i++){
color[i] = WHITE;
d[i] = -1;
}
color[s] = GRAY;
d[s] = 0;
enqueue(s);
while(head ... | main.c:8:19: error: expected identifier or '(' before ';' token
8 | int n, head, tail,;
| ^
main.c: In function 'bfc':
main.c:22:4: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
22 | enqueue(s);
| ^~~~~~~
main.c:25:10: error: implicit decl... |
s014557714 | p02239 | C | #include<stdio.h>
#define Max 101
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, head, tail;
int d[Max], m[Max][Max], p[Max], color[Max];
void bfc(int s){
int i, j;
for(i = 0 ; i < n ; i++){
color[i] = WHITE;
d[i] = -1;
}
color[s] = GRAY;
d[s] = 0;
enqueue(s);
while(head !... | main.c: In function 'bfc':
main.c:22:4: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
22 | enqueue(s);
| ^~~~~~~
main.c:25:10: error: implicit declaration of function 'dequeue' [-Wimplicit-function-declaration]
25 | i = dequeue();
| ^~~~~~~
mai... |
s359277334 | p02239 | C | #include<stdio.h>
#define Max 101
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, head, tail;
int d[N], m[Max], p[Max], color[Max];
void bfc(int s){
int i,j;
for(i = 0;i < n;i++){
color[i] = WHITE;
d[i] = -1;
}
color[s] = GRAY;
d[s] = 0;
enqueue(s);
while(head != tail){
i = dequeu... | main.c:9:7: error: 'N' undeclared here (not in a function)
9 | int d[N], m[Max], p[Max], color[Max];
| ^
main.c: In function 'bfc':
main.c:20:3: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
20 | enqueue(s);
| ^~~~~~~
main.c:22:9: error: implicit declar... |
s179655134 | p02239 | C | #include<stdio.h>
#define Max 101
#define WHITE 0
#define GRAY 1
#define BLACK 2
int n, head, tail;
int d[N], M[Max], p[Max], color[Max];
void bfc(int s){
int i,j;
for(i = 0;i < n;i++){
color[i] = WHITE;
d[i] = -1;
}
color[s] = GRAY;
d[s] = 0;
enqueue(s);
while(head != tail){
i = dequeu... | main.c:9:7: error: 'N' undeclared here (not in a function)
9 | int d[N], M[Max], p[Max], color[Max];
| ^
main.c: In function 'bfc':
main.c:20:3: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
20 | enqueue(s);
| ^~~~~~~
main.c:22:9: error: implicit declar... |
s588347268 | p02239 | C | #include<stdio.h>
typedef struct{
int num;
int depth;
}node;
int head=0;
int tail=0;
node queue[100];
int graph[100][100]={0};
int isEmpty(void){
if(head==tail){
return 1;
}else{
return 0;
}
}
void e(node n){
queue[(head++)%100]=n;
}
node d(void){
return queue[(ta... | main.c: In function 'main':
main.c:57:5: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
57 | enqueue(tmp);
| ^~~~~~~
main.c:59:13: error: implicit declaration of function 'dequeue' [-Wimplicit-function-declaration]
59 | tmp=dequeue();
| ... |
s789809854 | p02239 | C | #include<stdio.h>
typedef struct{
int num;
int depth;
}node;
int head=0;
int tail=0;
node queue[100];
int graph[100][100]={0};
int isEmpty(void){
if(head==tail){
return 1;
}else{
return 0;
}
}
void e(node n){
queue[(head++)%100]=n;
}
node d(void){
return queue[(ta... | main.c: In function 'main':
main.c:59:13: error: called object 'd' is not a function or function pointer
59 | tmp=d();
| ^
main.c:43:9: note: declared here
43 | int d[100];
| ^
|
s653455370 | p02239 | C | #include<stdio.h>
#define N 101
int v[N][N], d[N], k[N]
int n;
void Distance(int a, int b)
{
int i;
d[a] = b;
for (i = 0; i < k[a]; i++){
if (b + 1 < d[v[a][i]])
Distance(v[a][i], b + 1);
}
}
int main()
{
int i, j, p;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
A[i] = 100000000;
... | main.c:5:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
5 | int n;
| ^~~
main.c: In function 'Distance':
main.c:11:19: error: 'k' undeclared (first use in this function)
11 | for (i = 0; i < k[a]; i++){
| ^
main.c:11:19: note: each undeclared identifier is... |
s857554268 | p02239 | C | #iclude <stdio.h>
int main() {
int n, i, b, c, a[1000][1000], h[1000][2];
scanf ("%d",&n);
for (i = 0; i < n; i++) {
for (b = 0; b < n; b++) {
scanf ("%d" &a[i][b]);
}
}
for (i = 0; i < n; i++) {
h[i][0] = i + 1;
}
for (i = 0; i < n; i++)
printf ( "%d %d\n",h[i][1], h[i][2])
return 0;
} | main.c:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
1 | #iclude <stdio.h>
| ^~~~~~
| include
main.c: In function 'main':
main.c:6:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | scanf ("%d",&n);
| ^~~~~
main.c:1:1: note:... |
s199254756 | p02239 | C | #include<stdio.h>
int main(void) {
int n, a[100][100] = {0}, kyori[100] = {0}, homon1[100] = {0}, homon2[100] = {0}, u, k, v, i, j, m;
scanf("%d", &n);
for (i = 0; i < n; i++)
{
scanf("%d", &u);
scanf("%d", &k);
for (j = 0; j < k; j++)
{
scanf("%d", &v);
a[u - 1][v - 1] = 1;
}
}
kyori[0] = 0;... | main.c: In function 'main':
main.c:19:9: error: 'kyo' undeclared (first use in this function)
19 | kyo = 0
| ^~~
main.c:19:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:16: error: expected ';' before 'homon1'
19 | kyo = 0
| ... |
s165434150 | p02239 | C | #include<stdio.h>
int main()
{
int n, h, i, j, k, l, m, z, flag, Q[100], Z[100];
int G[100][100];
scanf("%d", &n);
for(i = 0; i < 100; i++ ) {
Z[i] = -1;
Q[[i] = 0;
}
for( i = 0; i < n; i++){
scanf("%d", &G[i][0]);
scanf("%d", &G[i][1]);
for( j = 2; j < 2 + G[i][1]; j++){
sc... | main.c: In function 'main':
main.c:11:7: error: expected expression before '[' token
11 | Q[[i] = 0;
| ^
main.c:11:15: error: expected ';' before '}' token
11 | Q[[i] = 0;
| ^
| ;
12 | }
| ~
|
s065735005 | p02239 | C | #include <stdio.h>
#define N 101
??
int G[N][N], X[N], Y[N], n;
??
void find(int x, int y){
????????int i;
????????X[x] = y;
????????for(i=1; i<=Y[x]; i++)
????????if(y+1 < X[G[x][i]]) find(G[x][i], y+1);
}
??
int main(){
????????int i, j, m;
??????????
????????scanf("%d", &n);
??????????
????????for(i=1; i<=n; i++){
?... | main.c:3:1: error: expected identifier or '(' before '?' token
3 | ??
| ^
main.c:5:1: error: expected identifier or '(' before '?' token
5 | ??
| ^
main.c:12:1: error: expected identifier or '(' before '?' token
12 | ??
| ^
|
s118430903 | p02239 | C | #include<iostream>
#include<queue>
using namespace std;
static const int INFTY = (1<<29);
int M[100][100];
int d[100];
int n;
void dfs(int s){
int u;
queue<int> q;
q.push(s);
for(int i=0;i<n;i++) d[i]=INFTY;
d[s]=0;
while( !q.empty() ){
u=q.front(); q.pop();
for(int v=0;v<n;v++){
if(M... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s967537256 | p02239 | C | #include <stdio.h>
#define INF 2147483647
void bfs(int);
void enqueue(int);
int dequeue();
int n,head,tail,Q[100],color[100],d[100],A[100][100];
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=0;j<k... | main.c: In function 'main':
main.c:30:5: error: implicit declaration of function 'rintf' [-Wimplicit-function-declaration]
30 | rintf("%d %d\n",i+1,d[i]);
| ^~~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'rintf'
1 | #include <stdio.h>
+++ |+#include <math.h>
2 | #defin... |
s273436173 | p02239 | C | #include <stdio.h>
#define N 101
#define WHITE 0
#define GRAY 1
#define BLACK 2
int A[N][N], color[N];
int d[N], Q[N+1];
int n, q1 = 0, q2 = 0;
void bfs(void);
int main() {
int u, v, k, i, j;
scanf("%d", &n);
for(i = 1; i <= n; i++) {
Q[i] = -1;
for(j = 1; j <= n; j++) {
A[i][j] = 0;
}
}
... | main.c: In function 'bfs':
main.c:60:27: error: unknown type name 'a'
60 | color[i] = GRAY;a
| ^
main.c:61:18: error: variable-sized object may not be initialized except with an empty initializer
61 | d[i] = d[u] + 1;
| ^
|
s604103441 | p02239 | C | #include<stdio.h>
#define N 100
#define INFTY 10000000;
int n;
int M[N][N];
int color[N], d[N], f[N];
int tt;
int Q[N*2];
int head, tail;
void init();
void enqueue(int);
int empty();
int dequeue();
void bfs(int);
int main(){
int u, k, v;
int i, j;
scanf("%d", &n);
for ( i = 0; i <n; i++ ){
for ( ... | main.c: In function 'bfs':
main.c:3:23: error: expected ')' before ';' token
3 | #define INFTY 10000000;
| ^
main.c:90:20: note: in expansion of macro 'INFTY'
90 | if ( d[v] != INFTY ) continue;
| ^~~~~
main.c:90:10: note: to match this '('
90 | ... |
s056832406 | p02239 | C | #include <stdio.h>
#define WHITE 1
#define GRAY 0
#define BLACK -1
#define INF 100000000
#define N 100
void bfs(int);
void enqueue(int);
int dequeue(void);
int Q[N+1],d[N+1],c[N+1],ts,n,S[N+1][N+1],k[N+1];
int head, tail;
int main()
{
int i,j,u,min;
scanf("%d",&n);
head = 0;
tail = 1;
for(i=0;i<n;i++){... | main.c: In function 'bfs':
main.c:46:5: error: 'color' undeclared (first use in this function)
46 | color[u] = WHITE;
| ^~~~~
main.c:46:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:57:9: error: 'vv' undeclared (first use in this function); did you mea... |
s766072971 | p02239 | C | #include<stdio.h>
#define MAX 100000
#define NIL -1
typedef int data_t;
data_t S[MAX];
int stack_num;
int n;
int G[MAX][MAX];
int color[MAX];
int push(data_t push_data)
{
if (stack_num < MAX) {
S[stack_num] = push_data;
stack_num ++;
return 1;
} else {
return 0;
}
}
v... | main.c: In function 'bfs':
main.c:31:4: error: request for member 'push' in something not a structure or union
31 | S.push(r);
| ^
main.c:34:10: error: request for member 'pop' in something not a structure or union
34 | u = S.pop();
| ^
main.c:35:19: error: request for member 'size' ... |
s389805476 | p02239 | C | include <stdio.h>
#define WHITE 1
#define GRAY 0
#define BLACK -1
#define INF 100000000
#define N 100
void bfs(int);
void enqueue(int);
int dequeue(void);
int Q[N+1],d[N+1],c[N+1],ts,n,S[N+1][N+1],K[N+1];
int head, tail;
int main()
{
int i,j,u,min;
scanf("%d",&n);
head = 0;
tail = 1;
for(i=0;i<n;i++){
... | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
20 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include ... |
s065266855 | p02239 | C | #include<stdio.h>
int G[101][101];
int d[101];
int n;
int Que[1000];
int head=0, tail=0;
void enqueue(int q){
Que[head]=q;
head++;
}
int dequeue(){
tail++;
return Que[tail-1];
}
int size(){
return head-tail;
}
void bfs(int i){
int j;
for(j=0;j<n;j++){
if(G[i][j]==1 && d[j]==-1){
d[j]=d[i]+1;... | main.c: In function 'main':
main.c:31:13: error: 'MAX' undeclared (first use in this function)
31 | for(i=0;i<MAX;i++) d[i]=-1;
| ^~~
main.c:31:13: note: each undeclared identifier is reported only once for each function it appears in
|
s731206528 | p02239 | C | #include<stdio.h>
#define MAX 1000
#define N 10000
int graph[MAX][MAX];
int d[MAX];
int n;
int Q[N];
int max=0,min=0;
void enQ(int q){
Q[max]=q;
max++;
}
void deQ(){
min++;
return Q[min-1];
}
int size(){
return max-min;
}
void bfs(int i){
int j;
for(j=0;j<n;j++){
if(graph[i][j]==1&&d[j]=NULL){
... | main.c: In function 'deQ':
main.c:20:11: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
20 | return Q[min-1];
| ~^~~~~~~
main.c:18:6: note: declared here
18 | void deQ(){
| ^~~
main.c: In function 'bfs':
main.c:30:28: error: lvalue required as left operand... |
s625209918 | p02239 | C | #define INF (1<<21)
#define MAXSIZE 100
int n,A[N][N];
int dis[N];
int Q[MAXSIZE];
int head = 0;
int tail = 1;
void enqueue(int x)
{
Q[tail++] = x;
printf("%d\n",Q[tail-1]);
}
int deq() {
int s;
s = Q[head++];
return s;
}
int empty()
{
return (head == tail);
}
void bfs(int t)
{
int i,j;
enqueue(t);... | main.c:3:9: error: 'N' undeclared here (not in a function)
3 | int n,A[N][N];
| ^
main.c: In function 'enqueue':
main.c:12:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
12 | printf("%d\n",Q[tail-1]);
| ^~~~~~
main.c:1:1: note: include '<stdio.h>' or... |
s673358485 | p02239 | C | #include<stdio.h>
#define MAX 1000
#define N 100
int G[MAX][MAX];
int d[MAX],Q[N];
int n;
int max=0,
int min=0;
void en(int q){
Q[max] = q;
max++;
}
int de(){
min++;
return Q[min-1];
}
int size(){
return max-min;
}
void bfs(int i){
int a;
for(a = 0; a < n; a++){
if(G[i][a] == 1 && d[a] == ... | main.c:10:1: error: expected identifier or '(' before 'int'
10 | int min=0;
| ^~~
main.c: In function 'de':
main.c:18:3: error: 'min' undeclared (first use in this function)
18 | min++;
| ^~~
main.c:18:3: note: each undeclared identifier is reported only once for each function it appears in
main.c... |
s109990620 | p02239 | C | #include <stdio.h>
??
#define WHITE 1
#define GRAY 0
#define BLACK -1
#define INF 100000000
#define N 100
??
void bfs(int);
void enqueue(int);
int dequeue(void);
??
int Q[N+1],d[N+1],c[N+1],ts,n,S[N+1][N+1],k[N+1];
int head, tail;
??
int main()
{
????int i,j,u,min;
??
????scanf("%d",&n);
??
????head = 0;
????tail = 1;
... | main.c:2:1: error: expected identifier or '(' before '?' token
2 | ??
| ^
main.c:12:1: error: expected identifier or '(' before '?' token
12 | ??
| ^
main.c:15:1: error: expected identifier or '(' before '?' token
15 | ??
| ^
main.c:42:1: error: expected identifier or '(' before '?' token
... |
s397560119 | p02239 | C | #include <stdio.h>
#define INF 100000001
#define N 100
??
void matrixChainOrder(int);
int min(int, int);
??
int n,k,i,j,q,l;
int p[N],m[N][N];
??
int main(){
??
????scanf("%d",&n);
??
????for(i=1;i<=n;i++){
????????scanf("%d%d",&p[i-1],&p[i]);
????}
??
????matrixChainOrder(n);
??
????printf("%d\n",m[1][n]);
??
????retu... | main.c:4:1: error: expected identifier or '(' before '?' token
4 | ??
| ^
main.c:7:1: error: expected identifier or '(' before '?' token
7 | ??
| ^
main.c:10:1: error: expected identifier or '(' before '?' token
10 | ??
| ^
main.c:25:1: error: expected identifier or '(' before '?' token
... |
s426238857 | p02239 | C | #include<stdio.h>
#include<math.h>
??????????
typedef struct
{
????double x;
????double y;
}koch;
??????
void fractal(int, koch, koch);
????????
int main()
{??????
????koch p1, p2;
????int n;
??????????
????p1.x = 0;
????p2.x = 100;
????p1.y = 0;
????p2.y = 0;
??????????
????scanf("%d", &n);
??????????
????printf("%f ... | main.c:3:1: error: expected identifier or '(' before '?' token
3 | ??????????
| ^
main.c:8:2: warning: data definition has no type or storage class
8 | }koch;
| ^~~~
main.c:8:2: error: type defaults to 'int' in declaration of 'koch' [-Wimplicit-int]
main.c:9:1: error: expected identifier or '(' bef... |
s486668267 | p02239 | C | int adj[101][101];
int d[101];
int used[101];
void push(int x){
queue[head]=x;
head++;
}
int pop(){
int x;
x=queue[tail];
tail++;
return x;
}
void bfs(int x){
int i;
int v;
push(x);
used[x]=1;
while(head!=tail){
v=pop();
for(i=1;i<=n;i++){
if(adj[v][i]==1 && used[i]==0){
push(i);... | main.c: In function 'push':
main.c:5:3: error: 'queue' undeclared (first use in this function)
5 | queue[head]=x;
| ^~~~~
main.c:5:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:9: error: 'head' undeclared (first use in this function)
5 | queue[hea... |
s988922571 | p02239 | C | #include <stdio.h>
#define SIZE 100
#define INF 100000000
typedef struct pp{ //queue???????£?
char name[SIZE];
int t;
}P_t;
P_t q[SIZE];
int head,tail,n,M[SIZE][SIZE];
int d[SIZE]; //?????¢??§????¨??????¶?????????????????????
void enqueue(P_t x){
q[tail]=x;
tail=(tail+1)%SIZE;
}
P_t dequeue(){
P_t x=q[he... | main.c: In function 'bfs':
main.c:39:11: error: incompatible type for argument 1 of 'enqueue'
39 | enqueue(s); //?????\????????¶?????????(push)
| ^
| |
| int
main.c:14:18: note: expected 'P_t' {aka 'struct pp'} but argument is of type 'int'
14 | void enqueue(P_t x... |
s528329347 | p02239 | C | #include <stdio.h>
#define SIZE 100
#define INF 100000000
int q[SIZE];
int head,tail,n,M[SIZE][SIZE];
int d[SIZE]; //?????¢??§????¨??????¶?????????????????????
void enqueue(int x){
q[tail]=x;
tail=(tail+1)%SIZE;
}
int dequeue(){
int x=q[head];
head=(head+1)%SIZE;
return x;
}
int isEmpty(){
return head==... | main.c: In function 'bfs':
main.c:32:3: error: unknown type name 'P_t'
32 | P_t deq;
| ^~~
|
s919461911 | p02239 | C | #include<iostream>
#include<queue>
using namespace std;
static const int INFTY=(1<<21);
static const int N=100;
int n,M[N][N],d[N];
void bfs(int s){
queue<int> q;
int i,u,v;
q.push(s);
for(i=0;i<n;i++)d[i]=INFTY;
d[s]=0;
while(!q.empty()){
u=q.front();
q.pop();
for(v=0;v<n;v++){
if(M[u][v... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.