submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s790705630
p02243
C
#include<stdio.h> #include<stdlib.h> #define MAX 10000 struct node{ int key; int cost; struct node *next; }; typedef struct node *adj; adj G[MAX]; adj SuperNode(int key,int cost,adj Node){ adj n; n=(adj)malloc(sizeof(struct node)); n->key=key; n->cost=cost; n->next=Node; return n; } adj Insert(int a...
main.c: In function 'Insert': main.c:24:5: error: 's' undeclared (first use in this function) 24 | G[s]->next=H; | ^ main.c:24:5: note: each undeclared identifier is reported only once for each function it appears in
s261751888
p02243
C
void root(int a){ int i,flag=1; for(i=0;i<n;i++) d[i]=INF; d[0]=0; while(flag!=0){ flag=0; for(i=0;i<a;i++){ if(a[i].cost+d[a[i].back]<d[a[i].next]){ d[a[i].next=a[i].cost+d[a[i].back]; flag=1; } } } }
main.c: In function 'root': main.c:4:15: error: 'n' undeclared (first use in this function) 4 | for(i=0;i<n;i++) d[i]=INF; | ^ main.c:4:15: note: each undeclared identifier is reported only once for each function it appears in main.c:4:22: error: 'd' undeclared (first use in this function) ...
s461601348
p02243
C
#include<iostream> #include<cstdio> #include<set> #include<queue> #include<cstring> #include<algorithm> typedef long long ll; #define inf 1000000000 using namespace std; struct _node { ll v,w; //:v(a),w(b) _node(ll a=0,ll b=0) { v=a; w=b; }; bool operator <(const _node & other) const { return other.w<...
main.c:2:9: fatal error: iostream: No such file or directory 2 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s935484345
p02243
C
#include <stdio.h> #include <stdlib.h> #define MAX 10000 #define INF 1000000 #define true 1 #define false 0 int p[MAX], d[MAX], is_visited[MAX]; int weights[][]; typedef struct _n { int id, weight; struct _n *next; } node; node G[MAX]; void add(int origin, int direction, int weight) { node *p, *new; p = &G[o...
main.c:9:5: error: array type has incomplete element type 'int[]' 9 | int weights[][]; | ^~~~~~~ main.c:9:5: note: declaration of 'weights' as multidimensional array must have bounds for all dimensions except the first main.c: In function 'weight_between': main.c:51:6: error: 'weight' undeclared (first us...
s698453360
p02243
C
#include<stdio.h> #include<limits.h> #define N 9000 #define true 1 #define false 0 int n; int g[N][N]; int weight[N]; int 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; } if...
main.c: In function 'main': main.c:56:3: error: 'cin' undeclared (first use in this function) 56 | cin >>n; | ^~~ main.c:56:3: note: each undeclared identifier is reported only once for each function it appears in main.c:78:5: error: 'cout' undeclared (first use in this function) 78 | cout <<i<<" "<...
s312416449
p02243
C
#include<stdio.h> #include<limits.h> #define N 10001 #define true 1 #define false 0 int n; int g[N][N]; int weight[N]; int us[N]; //prim void prim(){ int v; int i,j; weight[0]=0; while(true){ v=-1; for(i=0;i<n;i++){ if(us[i]!=true && (v==-1 ||weight[i]<weight[v]))v=i; } if(...
main.c: In function 'main': main.c:85:1: error: unknown type name 'delete' 85 | delete g; | ^~~~~~
s306691315
p02243
C
#include<iostream> #include<cstdio> #include<climits> using namespace std; #define N 10001 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.
s273096849
p02243
C
#include <stdio.h> #define MAX 100000 #define INF 1000000 #define NIL -1 int a[MAX][MAX]; int n; int d[MAX]; int pi[MAX]; void R(int, int); void ISS(int); void D(int); main(){ int i, j ,u ,k,v,c; 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+...
main.c:15:1: error: return type defaults to 'int' [-Wimplicit-int] 15 | main(){ | ^~~~
s958768107
p02243
C
#!/usr/bin/env python from __future__ import division, print_function from sys import stdin, maxint def main(): num = int(stdin.readline()) L = [] for _ in xrange(num): it = iter(int(s) for s in stdin.readline().split()[1:]) L.append([(next(it), next(it)) for _ in xrange(next(it))]) ...
main.c:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/env python | ^ main.c:2:1: error: unknown type name 'from' 2 | from __future__ import division, print_function | ^~~~ main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import' 2 | from __future__ imp...
s666466340
p02243
C++
#include<cstdio> #include<queue> #include<vector> #define MA 10005 #define INF (1<<30) using namespace std; struct Node{ short id;//根据题意,id最大在short有效范围内 int weight; }; short n; vector<pair<int, int> >adj[MA];//加权有向图的邻接表 priority_queue<Node> PQ;//优先级队列 bool state[MA];//节点状态,false为未访问 int dis[MA];//节点到0点的权值总和 /...
a.cc:19:1: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive] 19 | operator < (const Node node1, const Node node2){ | ^~~~~~~~
s449669062
p02243
C++
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> node; typedef vector<node> Adj_list; typedef vector<Adj_list> Adj_lists; class less_cost{ public: bool operator()(const pair<int, int> lhs, const pair<int, int> rhs) const{ return lhs.second < rhs.second; } }; int main(){ int n; scanf(...
a.cc: In function 'int main()': a.cc:42:21: error: binding reference of type 'node&' {aka 'std::pair<int, int>&'} to 'const __gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'const std::pair<int, int>'} discards qualifiers 42 | node& u = pq.top(); | ...
s663815633
p02243
C++
#include <iostream> #include <vector> #include <queue> #define INF 1000000000 using namespace std; struct edge { int from; int to; int w; }; struct node { node() : id {-1}, d {INF}, ns {} {}; node(int i, vector<edge>& vec) : id {i}, d {INF}, ns {vec} {}; int id; int d; vector<edge> ns;...
a.cc: In function 'std::vector<int> dijkstra(node*, int, int)': a.cc:34:5: error: expected primary-expression before '/' token 34 | / cout << n->id << ' ' << n->d << endl; | ^
s685185292
p02243
C++
#include <iostream> #include <queue> #include <utility> #include <vector> #define MAX_NODE 10000 #define INF 1000000000 using namespace std; struct Edge {int to, w;}; typedef pair<int, int> PII; vector<Edge> adj[MAX_NODE]; int d[MAX_NODE]; void dijkstra(int n, int start) { priority_queue<PII, vector<PII>, greater...
a.cc: In function 'int main()': a.cc:53:41: error: no matching function for call to 'std::vector<Edge>::push_back(int&, int&)' 53 | adj[u].push_back(v, c); | ~~~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/vector:66, from /usr/in...
s109390460
p02243
C++
#include<iostream> #include<algorithm> #include<queue> static const int MAX = 10000; static const int INFTY = (1 << 20); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; void dijkstra(int n, std::vector<std::pair<int, int> > adj) { std::priority_queue<std::pair<int, int> > PQ; int ...
a.cc: In function 'void dijkstra(int, std::vector<std::pair<int, int> >)': a.cc:32:47: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'size' 32 | for (size_t i = 0; i < adj[u].size(); i+...
s812551886
p02243
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: In member function 'void binheap<T, Compare, Allocator>::build()': a.cc:104:19: error: 'int32_t' is not a member of 'std'; did you mean 'int32_t'? 104 | for (std::int32_t i = length / 2; | ^~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155, ...
s403231567
p02243
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: In member function 'void binheap<T, Compare, Allocator>::build()': a.cc:104:19: error: 'int32_t' is not a member of 'std'; did you mean 'int32_t'? 104 | for (std::int32_t i = length / 2; | ^~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155, ...
s293090928
p02243
C++
#include <stdio.h> #define INF 10000000 typedef struct{ int node; int cost; } List; int dist[10001]; List list[10001][50000]; int kazu[10001]; int n; void walk(int x,int step){ dist[x]=step; //printf("%d %d\n",x,step); for(int i=0;i<kazu[x];i++){ if(dist[list[x][i].node]>step+list[x][i].cost) walk(list[x][i]....
/tmp/ccSLNZjJ.o: in function `walk(int, int)': a.cc:(.text+0x10f): relocation truncated to fit: R_X86_64_PC32 against symbol `kazu' defined in .bss section in /tmp/ccSLNZjJ.o /tmp/ccSLNZjJ.o: in function `main': a.cc:(.text+0x12e): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in...
s560844014
p02243
C++
#include<iostream> #include<algorithm> #include<queue> #include<cmath> #include<vector> using namespace std; static const int MAX=1000; static const int WHITE=0; static const int GRAY=1; static const int BLACK=2; int n; vector<pair<int,int> > adj[MAX]; void dijkstra(){ priority_queue<pair<int,int> > PQ; int colo...
a.cc: In function 'void dijkstra()': a.cc:22:10: error: 'INT_MAX' was not declared in this scope 22 | d[i]=INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include<cmath> +++ |+#include <climits> 5...
s740411463
p02243
C++
#include<iostream> #include<algorithm> #include<queue> #include<cmath> #include<vector> using namespace std; static const int MAX=1000; static const int WHITE=0; static const int GRAY=1; static const int BLACK=2; int n; vector<pair<int,int> > adj[MAX]; void dijkstra(){ priority_queue<pair<int,int> > PQ; int colo...
a.cc: In function 'void dijkstra()': a.cc:22:10: error: 'INT_MAX' was not declared in this scope 22 | d[i]=INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include<cmath> +++ |+#include <climits> 5...
s767686073
p02243
C++
#define RangeFor(i,n) for(int i=0; i<n; ++i) #define RvRngFor(i,n) for(int i=n-1; i>=0; --i) #include <iostream> #include <vector> #include <queue> #include <utility> #include <numeric> using std::vector; using std::cin; using std::priority_queue; using std::pair; using std::make_pair; vector<int> sssp(vector<vecto...
a.cc: In function 'std::vector<int> sssp(std::vector<std::vector<std::pair<int, int> > >, int)': a.cc:20:35: error: 'numeric_limits' is not a member of 'std' 20 | vector<int> temp_dist(n, std::numeric_limits<int>::max()); | ^~~~~~~~~~~~~~ a.cc:20:50: error: expected primar...
s653980043
p02243
C++
#define RangeFor(i,n) for(int i=0; i<n; ++i) #define RvRngFor(i,n) for(int i=n-1; i>=0; --i) #include <iostream> #include <vector> #include <queue> #include <utility> #include <numeric> using std::vector; using std::cin; using std::priority_queue; using std::pair; using std::make_pair; vector<int> sssp(vector<vecto...
a.cc: In function 'std::vector<int> sssp(std::vector<std::vector<std::pair<int, int> > >, int)': a.cc:20:35: error: 'numeric_limits' is not a member of 'std' 20 | vector<int> temp_dist(n, std::numeric_limits<int>::max()); | ^~~~~~~~~~~~~~ a.cc:20:50: error: expected primar...
s750145735
p02243
C++
#include <algorithm> #include <iostream> #include <list> #include <vector> class TNode { std::list<std::pair<TNode*, int> > FNexts; int FDistance; public: TNode() : FDistance(-1) { } int GetDistance()const {return FDistance;} void SetDistance(int Distance){FDistance = Distance;} void Push(TNode* New, int...
a.cc: In member function 'void TNode::Visit()': a.cc:26:65: error: expected ';' before 'for' 26 | std::cout << "Visited" << std::endl for(std::list<std::pair<TNode*, int> >::iterator It = FNexts.begin(); It != FNexts.end(); ++It){ | ...
s388200806
p02243
C++
include <iostream> #include <algorithm> #include <queue> using namespace std; #define MAX 10000 #define INFTY (1 << 20) #define WHITE 0 #define GRAY 1 #define BLACK 2 int n; vector<pair<int, int> > adj[MAX]; void dijkstra() { priority_queue<pair<int, int> > PQ; int color[MAX], d[MAX]; for ( int i = 0; i < n...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __...
s112273536
p02243
C++
#include <queue> #include <stdint.h> #include <vector> typedef void (*single_source_shortest_path_callback_t)(int32_t index, int32_t weight); #define GRAPH_MAX_SIZE 10000 extern bool single_source_shortest_path(vector<pair<int32_t, int32_t>> *graph, size_t size, single_source_s...
a.cc:8:13: warning: 'single_source_shortest_path' initialized and declared 'extern' 8 | extern bool single_source_shortest_path(vector<pair<int32_t, int32_t>> *graph, size_t size, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:8:41: error: 'vector' was not declared in this scope 8 | extern bool single_sou...
s293357616
p02243
C++
#include <queue> #include <stdint.h> #include <vector> typedef void (*single_source_shortest_path_callback_t)(int32_t index, int32_t weight); #define GRAPH_MAX_SIZE 10000 enum color_t { WHITE, GRAY, BLACK }; static int32_t weights[GRAPH_MAX_SIZE]; static color_t colors[GRAPH_MAX_SIZE]; bool single_source_shortest_p...
a.cc:13:34: error: 'vector' was not declared in this scope 13 | bool single_source_shortest_path(vector<pair<int32_t, int32_t>> *graph, size_t size, single_source_shortest_path_callback_t callback) | ^~~~~~ a.cc:13:34: note: suggested alternatives: In file included from /usr/in...
s940734593
p02243
C++
#include <queue> #include <stdint.h> #include <vector> #include <utility> #include <array> typedef void (*single_source_shortest_path_callback_t)(int32_t index, int32_t weight); #define GRAPH_MAX_SIZE 10000 enum color_t { WHITE, GRAY, BLACK }; static int32_t weights[GRAPH_MAX_SIZE]; static color_t colors[GRAPH_MAX_S...
a.cc:15:34: error: 'vector' was not declared in this scope 15 | bool single_source_shortest_path(vector<pair<int32_t, int32_t>> *graph, size_t size, single_source_shortest_path_callback_t callback) | ^~~~~~ a.cc:15:34: note: suggested alternatives: In file included from /usr/in...
s358162035
p02243
C++
#include <iostream> #include <algorithm> #include <vector> #include <queue> using namespace std; const int MAX = 10000; const int INF = 1e9 + 7; int n; vector<pair<int, int> > adj[MAX]; void dijkstra() { int d[MAX], color[MAX]; priority_queue<pair<int, int> > pq; fill(d, d + MAX, INF); fill(color, color + M...
a.cc:46:1: error: expected declaration before '}' token 46 | } | ^
s048467988
p02243
C++
#include <cstdint> #include <queue> #include <vector> #include <criterion/criterion.h> using namespace std; #define GRAPH_SIZE 10000 #define WEIGHT_MAX UINT32_MAX enum state_t { WHITE, GRAY, BLACK }; static state_t state[GRAPH_SIZE]; static priority_queue<pair<uint32_t, uint32_t>, vector<pair<uint32_t, uint32_t>>,...
a.cc:5:10: fatal error: criterion/criterion.h: No such file or directory 5 | #include <criterion/criterion.h> | ^~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s644269546
p02243
C++
#include<iostream> #include<algorithm> #include<queue> using namespace std; static const int MAX = 10000; static const int INFTY = (1<<20) static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n; vector<pair<int, int> > adj[MAX]; void dijkstra(){ priority_queue<pair<int, int> > PQ;...
a.cc:9:1: error: expected ',' or ';' before 'static' 9 | static const int WHITE = 0; | ^~~~~~ a.cc: In function 'void dijkstra()': a.cc:22:12: error: 'WHITE' was not declared in this scope 22 | color[i] = WHITE; | ^~~~~ a.cc:27:12: error: 'GARY' was not declared in this scope; did you mean...
s005785446
p02243
C++
#include<iostream> #include<algorithm> #include<queue> using namespace std; static const int MAX = 10000; static const int INFTY = (1<<20) static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n; vector<pair<int, int> > adj[MAX]; void dijkstra(){ priority_queue<pair<int, int> > PQ;...
a.cc:9:1: error: expected ',' or ';' before 'static' 9 | static const int WHITE = 0; | ^~~~~~ a.cc: In function 'void dijkstra()': a.cc:22:12: error: 'WHITE' was not declared in this scope 22 | color[i] = WHITE; | ^~~~~ a.cc:27:12: error: 'GARY' was not declared in this scope; did you mean...
s132133971
p02243
C++
#include<iostream> #include<algorithm> #include<queue> using namespace std; static const int MAX = 10000; static const int INFTY = (1<<20); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n; vector<pair<int, int> > adj[MAX]; void dijkstra(){ priority_queue<pair<int, int> > PQ...
a.cc: In function 'void dijkstra()': a.cc:27:12: error: 'GARY' was not declared in this scope; did you mean 'GRAY'? 27 | color[0] = GARY; | ^~~~ | GRAY a.cc: In function 'int main()': a.cc:62:30: error: request for member 'c' in 'v', which is of non-class type 'int' 62 | adj[u].p...
s400659727
p02243
C++
#include<iostream> #include<algorithm> #include<queue> using namespace std; static const int MAX = 10000; static const int INFTY = (1<<20); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n; vector<pair<int, int> > adj[MAX]; void dijkstra(){ priority_queue<pair<int, int> > PQ...
a.cc: In function 'void dijkstra()': a.cc:27:12: error: 'GARY' was not declared in this scope; did you mean 'GRAY'? 27 | color[0] = GARY; | ^~~~ | GRAY
s428445939
p02243
C++
include<iostream> #include<algorithm> #include<queue> using namespace std; static const int MAX=10000; static const int INFTY = (1<<20); static const int WHITE=0; static const int GRAY=1; static const int BLACK=2; int n; vector<pair<int,int> > adj[MAX]; void dijkstra(){ priority_queue<pair<int,int> > PQ; int color...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __g...
s424434722
p02243
C++
#include<iostream> #include<algorithm> #include<queue> using namespace std; static const int MAX=10000; static const int INFTY = (1<<20); static const int WHITE=0; static const int GRAY=1; static const int BLACK=2; int n; vector<pair<int,int> > adj[MAX]; void dijkstra(){ priority_queue<pair<int,int> > PQ; int colo...
a.cc: In function 'void dijkstra()': a.cc:23:9: error: 'i' was not declared in this scope 23 | color[i]=GRAY; | ^ a.cc: In function 'int main()': a.cc:49:13: error: 'k' was not declared in this scope 49 | cin>>u>>k; | ^ a.cc:56:11: error: expected ';' before ':' token 56 |...
s157575329
p02243
C++
#include<bits/stdc++.h> using namespace std; shortcost[10000][10000];//cost[a][b] a??????b????§????????????????????????? long long int d[10000];//??????s?????????????°??????¢ bool used[10000]; int arrow;//????????° const int INF = 10000000; void dijkstra(){ fill(d,d+arrow,INF); fill(used,used + arrow,false); d...
a.cc:4:1: error: 'shortcost' does not name a type 4 | shortcost[10000][10000];//cost[a][b] a??????b????§????????????????????????? | ^~~~~~~~~ a.cc: In function 'void dijkstra()': a.cc:28:10: error: 'cost' was not declared in this scope; did you mean 'cosl'? 28 | if(cost[v][u] != INF){ | ...
s894773752
p02243
C++
#include<bits/stdc++.h> using namespace std; shortcost[10000][10000];//cost[a][b] a??????b????§????????????????????????? long long int d[10000];//??????s?????????????°??????¢ bool used[10000]; int arrow;//????????° const int INF = 10000000; void dijkstra(){ fill(d,d+arrow,INF); fill(used,used + arrow,false); d...
a.cc:4:1: error: 'shortcost' does not name a type 4 | shortcost[10000][10000];//cost[a][b] a??????b????§????????????????????????? | ^~~~~~~~~ a.cc: In function 'void dijkstra()': a.cc:28:10: error: 'cost' was not declared in this scope; did you mean 'cosl'? 28 | if(cost[v][u] != INF){ | ...
s867957424
p02243
C++
#include<stdio.h> #include<stdlib.h> #define INF 100000000 typedef struct state{ int pos,cost; } state; state A[2000001]; int N=0; int parent(int i){return i/2;} int left(int i){return i*2;} int right(int i){return i*2+1;} void exchange(state* a, state* b){ state tmp=*a; *a=*b; *b=tmp; } void minHeapify(i...
a.cc: In function 'int main()': a.cc:86:18: error: invalid conversion from 'void*' to 'edge*' [-fpermissive] 86 | G[a] = malloc( sizeof( edge ) *b ); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~ | | | void*
s180206409
p02243
C++
# -*- coding: utf-8 -*- from heapq import heapify, heappop, heappush N = int(input()) INF = float("inf") d = [INF for n in range(N)] d[0] = 0 adj = [[] for _ in range(N)] searched = [False for _ in range(N)] searched[0] = True for n in range(N): inp = tuple(map(int, input().split())) assert n == inp[0] f...
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- coding: utf-8 -*- | ^ a.cc:2:1: error: 'from' does not name a type 2 | from heapq import heapify, heappop, heappush | ^~~~
s855722370
p02243
C++
#include <bits/stdc++.h> using namespace std; static const int INFTY = 2000000000; static const int NIL = -1; static const int MAX = 10000; static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n; vector<pair<int,int> > adj[MAX]; void dijkstra(){ priority_queue<pair<int,int> > PQ;...
a.cc: In function 'int main()': a.cc:61:32: error: 'd' was not declared in this scope 61 | printf("%d %d\n",i,d[i]); | ^
s997058579
p02243
C++
#include<algorithm> #include<iostream> #include<cstdlib> #include<cstring> #include<cstdio> #include<vector> #include<queue> #include<stack> #include<cmath> #include<list> #include<map> #include<set> using namespace std; //typedef vector<int> VI; //typedef vector<VI> VVI; //typedef vector<string> VS; //typedef stack<i...
a.cc: In function 'void dijkstra()': a.cc:57:13: error: 'i' was not declared in this scope 57 | REP(i,n) | ^ a.cc:36:23: note: in definition of macro 'REP' 36 | #define REP(i,n) FOR(i,0,n) | ^ a.cc:36:19: error: 'FOR' was not declared in this scope 36 | #d...
s192883885
p02243
C++
#include<algorithm> #include<iostream> //#include<cstdlib> //#include<cstring> //#include<cstdio> //#include<vector> #include<queue> //#include<stack> //#include<cmath> //#include<list> //#include<map> //#include<set> using namespace std; //typedef vector<int> VI; //typedef vector<VI> VVI; //typedef vector<string> VS;...
a.cc: In function 'void dijkstra()': a.cc:69:17: error: 'PII' was not declared in this scope 69 | PII f=PQ.top(); | ^~~ a.cc:71:23: error: 'f' was not declared in this scope 71 | int u=f.second; | ^ a.cc:76:31: error: 'SZ' was not d...
s448048859
p02243
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) const long long INFF = 1e18; const int MAX_N = 11000; using TYPE = long long; // ?????¢???????????\?????? vector<pair<int, TYPE> > G[MAX_N]; vector<TYPE> dijkstra(int start){ vector<TYPE> dist(MAX_N, INFF); dist[start] = 0;//dist...
a.cc: In function 'int main()': a.cc:42:21: error: 'A_star' was not declared in this scope; did you mean 'va_start'? 42 | auto dist = A_star(0); | ^~~~~~ | va_start
s151436029
p02243
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) const long long INFF = 1e18; const int MAX_N = 11000; using TYPE = long long; // ?????¢???????????\?????? vector<pair<int, TYPE> > G[MAX_N]; vector<TYPE> A_star(int start){ vector<TYPE> dist(MAX_N, INFF); dist[start] = 0;//dist[i...
a.cc: In function 'int main()': a.cc:42:21: error: 'dijkstra' was not declared in this scope 42 | auto dist = dijkstra(0); | ^~~~~~~~
s804136608
p02243
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) const long long INFF = 1e18; const int MAX_N = 11000; using TYPE = long long; // ?????¢???????????\?????? vector<pair<int, TYPE> > G[MAX_N]; vector<TYPE> A_star(int start){ vector<TYPE> dist(MAX_N, INFF); dist[start] = 0;//dist[i...
a.cc: In function 'std::vector<long long int> A_star(int)': a.cc:27:62: error: 'INF' was not declared in this scope; did you mean 'INFF'? 27 | que.push(make_pair(dist[v] + INF, v)); | ^~~ | ...
s022763911
p02243
C++
#define ll long long #define MAX 10000 #include "bits/stdc++.h" #include <vector.h> #include <algorithm.h> #include <queue.h> using namespace std; static const int INF = (1 << 21); int n; priority_queue<pair<int,int>> PQ; vector<pair<int, int>> adj[MAX]; int color[MAX]; int d[MAX]; void dj(int s){ for (int i = 0;i...
a.cc:5:10: fatal error: vector.h: No such file or directory 5 | #include <vector.h> | ^~~~~~~~~~ compilation terminated.
s387950306
p02243
C++
#define ll long long #define MAX 10000 #include <vector.h> #include <algorithm.h> #include <queue.h> using namespace std; static const int INF = (1 << 21); int n; priority_queue<pair<int,int>> PQ; vector<pair<int, int>> adj[MAX]; int color[MAX]; int d[MAX]; void dj(int s){ for (int i = 0;i < n;i++) { d[i]=INF; ...
a.cc:4:10: fatal error: vector.h: No such file or directory 4 | #include <vector.h> | ^~~~~~~~~~ compilation terminated.
s013678608
p02243
C++
#define ll long long #define MAX 10000 #include <vector> #include <algorithm> #include <queue> using namespace std; static const int INF = (1 << 21); int n; priority_queue<pair<int,int>> PQ; vector<pair<int, int>> adj[MAX]; int color[MAX]; int d[MAX]; void dj(int s){ for (int i = 0;i < n;i++) { d[i]=INF; color...
a.cc: In function 'void dj(int)': a.cc:47:17: error: 'cout' was not declared in this scope 47 | cout << i << " " << (d[i] == INF ? -1 : d[i]) << endl; | ^~~~ a.cc:7:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' ...
s595319805
p02243
C++
#define ll long long #define MAX 10000 #inlude <iostream> #include <vector> #include <algorithm> #include <queue> using namespace std; static const int INF = (1 << 21); int n; priority_queue<pair<int,int>> PQ; vector<pair<int, int>> adj[MAX]; int color[MAX]; int d[MAX]; void dj(int s){ for (int i = 0;i < n;i++) { ...
a.cc:4:2: error: invalid preprocessing directive #inlude; did you mean #include? 4 | #inlude <iostream> | ^~~~~~ | include a.cc: In function 'void dj(int)': a.cc:48:17: error: 'cout' was not declared in this scope 48 | cout << i << " " << (d[i] == INF ? -1 : d[i]) << endl; | ...
s010004789
p02243
C++
#include <stdio.h> #include <iostream> #include <queue> #include <list> using namespace std; class Node { private: list<int> next_node_list; list<int> next_weight_list; public: Node(); void AddNextNode(int id, int weight); void SetWeight(long weight); void DistributeWeight(); long weight_from_0; bool check; };...
a.cc:39:6: error: no declaration matches 'void Node::AddNextNode(int, long int)' 39 | void Node::AddNextNode(int id, long weight) | ^~~~ a.cc:14:14: note: candidate is: 'void Node::AddNextNode(int, int)' 14 | void AddNextNode(int id, int weight); | ^~~~~~~~~~~ a.cc:7:7: note:...
s029894554
p02243
C++
/** * @brief 単一始点最短路問題をDijkstra法で解く */ // ******************************************************************************** // Include files // ******************************************************************************** #include <iostream> #include <limits> #include <vector> #include <queue> // **************...
a.cc: In function 'int main()': a.cc:200:13: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 200 | cin >> v >> c; | ^~~ | std::cin In file included from a.cc:9: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern ist...
s798539086
p02243
C++
import java.io.IOException; import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); int u = in.nextInt(); int[][] mat = new int[u][u]; for (int i ...
a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.util.Arrays; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules...
s401023376
p02243
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
s956290880
p02243
C++
/#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; map <int,int> mp; #define INF (1<<30) #define INFLL (1ll<<60) #define EPS (1e-10) static const int MAX=1e5; static const int MOD=1e9+7; static const int NMAX=50; static const int MMAX=50; int dx[4]={0,1,0,-1},dy[4]={-...
a.cc:1:2: error: stray '#' in program 1 | /#include <bits/stdc++.h> | ^ a.cc:1:1: error: expected unqualified-id before '/' token 1 | /#include <bits/stdc++.h> | ^ a.cc:6:1: error: 'map' does not name a type 6 | map <int,int> mp; | ^~~ a.cc:17:9: error: 'pair' does not name a type 17 |...
s068060547
p02243
C++
#include <cstdio> #include <cstdlib> #include <climits> #include <queue> #include <map> using namespace std; typedef map<int, int>::iterator mitr; map<int, int> w[100]; int d[100]; char pos[100]; priority_queue<pair<int,int> > others; pair<int,int> p; void findPath(){ p = others.top(); others.pop(); whi...
a.cc: In function 'int main()': a.cc:49:5: error: 'memset' was not declared in this scope 49 | memset(pos,0,sizeof(char)*100); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <map> +++ |+#include <cstring> ...
s915181592
p02243
C++
import queue class Edge: def __init__(self, from_v, to_v, cost): self.from_v = from_v self.to_v = to_v self.cost = cost def __lt__(self, other): return self.cost < other.cost def get_from_v(self): return self.from_v def get_to_v(self): return self.to_...
a.cc:40:11: error: invalid preprocessing directive #self 40 | # self.edges = [] | ^~~~ a.cc:43:29: error: stray '#' in program 43 | self.distance = [] # 最短距離 | ^ a.cc:47:11: error: invalid preprocessing directive #self 47 | # self.edges...
s936438883
p02243
C++
#include<iostream> #include<algorithm> #include<queue> #include<vector> #include<utility> #include<limits> using namespace std; typedef pair<int, int> Edge; int main() { int n; cin >> n; vector< vector< Edge > > lists; for (int i = 0; i < n; i++) { vector<Edge> list; int u, k; cin >> u >> k; for (int j = 0...
a.cc: In function 'int main()': a.cc:28:30: error: 'INT32_MAX' was not declared in this scope 28 | vector<int> costs(n, INT32_MAX); | ^~~~~~~~~ a.cc:7:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 6 | #inc...
s076743035
p02243
C++
#include<iostream> #include<algorithm> #include<queue> #include<vector> #include<utility> #include<limits> using namespace std; typedef pair<int, int> Edge; int main() { int n; cin >> n; vector< vector< Edge > > lists; for (int i = 0; i < n; i++) { vector<Edge> list; int u, k; cin >> u >> k; for (int j = 0...
a.cc: In function 'int main()': a.cc:28:30: error: 'INT32_MAX' was not declared in this scope 28 | vector<int> costs(n, INT32_MAX); | ^~~~~~~~~ a.cc:7:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 6 | #inc...
s289989356
p02243
C++
#include<iostream> #include<algorithm> #include<queue> #include<vector> #include<utility> #include<limits> using namespace std; typedef pair<int, int> Edge; int main() { int n; cin >> n; vector< vector< Edge > > lists; for (int i = 0; i < n; i++) { vector<Edge> list; int u, k; cin >> u >> k; for (int j = 0...
a.cc: In function 'int main()': a.cc:28:30: error: 'INT32_MAX' was not declared in this scope 28 | vector<int> costs(n, INT32_MAX); | ^~~~~~~~~ a.cc:7:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 6 | #inc...
s695665190
p02243
C++
#include<iostream> #include<algorithm> #include<queue> using namespace std; static const int MAX = 10000; static const int INFTY = (1 << 21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n; vector<pair<int, int> > adj[MAX] void dijkstra() { priority_queue<pair<int, int> ...
a.cc:17:1: error: expected initializer before 'void' 17 | void dijkstra() { | ^~~~
s351856811
p02243
C++
#include<iostream> #include<algorithm> #include<queue> using namespace std; static const int MAX = 10000; static const int INFTY = (1 << 21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n; vector<pair<int, int> > adj[MAX]; void dijkstra() { priority_queue<pair<int, int> ...
a.cc: In function 'void dijkstra()': a.cc:53:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 53 | int main() { | ^~ a.cc:53:9: note: remove parentheses to default-initialize a variable 53 | int main() { | ^~ | -- a.cc:53:9: note...
s630602363
p02243
C++
#include<iostream> #include<queue> #include<vector> using namespace std; static const int MAX = 10000; static const int INF = (1<<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n; vector<pair<int,int>> adj[MAX]; void dijkstra(){ int color[MAX], d[MAX]; for(int i ...
a.cc: In function 'void dijkstra()': a.cc:41:24: error: no matching function for call to 'std::priority_queue<std::pair<int, int> >::push(int, int&)' 41 | pq.push((-1)*d[v], v); | ~~~~~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/queue:66, from a.c...
s365861039
p02243
C++
#include <iostream> #include <algorithm> #include <queue> using namespace std; static const int MAX = 10000; static const int INFTY = (1<<20); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK= 2; int n; vector<pair<int, int> > adj[MAX]; // 重み付き有向グラフの隣接リスト表現 void dijkstra() { priority_...
a.cc: In function 'void dijkstra()': a.cc:40:48: error: expected ';' before 'PQ' 40 | d[v] = d[u] + adj[u][j].second | ^ | ; 41 | // priority_queueはデフォルトで大きい値を優先するため-1をかける ...
s664663005
p02243
C++
#include<iostream> #include<cstdio> #include<climits> using namespace std; #define N 10001 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...
a.cc: In function 'int main()': a.cc:79:10: error: expected primary-expression before ']' token 79 | delete g[][]; | ^ a.cc:79:12: error: expected primary-expression before ']' token 79 | delete g[][]; | ^
s412045412
p02243
C++
#include<iostream> #include<cstdio> #include<climits> using namespace std; #define N 10001 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...
a.cc: In function 'int main()': a.cc:79:10: error: expected primary-expression before ']' token 79 | delete g[]; | ^
s201653736
p02243
C++
#include<iostream> #include<vector> #include<queue> #include <bitset> 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; } }; b...
a.cc: In function 'int main()': a.cc:76:27: error: '::_DEBUG_ERROR' has not been declared 76 | ::_DEBUG_ERROR("invalid"); | ^~~~~~~~~~~~
s688229717
p02243
C++
#include <iostream> #include <vector> using namespace std; typedef unsigned short ushort; typedef vector <int> vi; typedef vector <vi> vvi; class blanch{ public: bool visited; int distance; ushort from; }; typedef vector <blanch> vb; int make_graph(vvi &graph, vb &nodes){ int n=graph.size(); for (int i=0; i<...
a.cc: In function 'int make_graph(vvi&, vb&)': a.cc:23:37: error: 'INT_MAX' was not declared in this scope 23 | nodes[i].distance = INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <cl...
s140978892
p02243
C++
#include <iostream> #include <vector> using namespace std; typedef unsigned short ushort; class blanch{ public: bool visited; int distance; ushort from; ushort to; }; typedef vector <blanch> vb; typedef vector <vb> vvb; int make_graph(vvb &graph, vb &nodes){ int n=nodes.size(); for (ushort i=0; i<n; i++){...
a.cc: In function 'int make_graph(vvb&, vb&)': a.cc:21:37: error: 'INT_MAX' was not declared in this scope 21 | nodes[i].distance = INT_MAX; | ^~~~~~~ a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <cl...
s789205904
p02244
Java
package kadai1.prog1.main; import java.util.Scanner; public class Prog006 { public static final int N=8; public static final int free=-1; public static final int not_free=1; static int row[]=new int [N]; static int col[]=new int [N]; static int dpos[]=new int [2*N-1]; static int dneg[]=new int [2*N-1]; stati...
Main.java:5: error: class Prog006 is public, should be declared in a file named Prog006.java public class Prog006 { ^ 1 error
s421736889
p02244
Java
import java.util.Scanner; public class Prog006 { public static final int N=8; public static final int free=-1; public static final int not_free=1; static int row[]=new int [N]; static int col[]=new int [N]; static int dpos[]=new int [2*N-1]; static int dneg[]=new int [2*N-1]; static boolean x[][]=new boolean ...
Main.java:3: error: class Prog006 is public, should be declared in a file named Prog006.java public class Prog006 { ^ 1 error
s244674842
p02244
C
#include<stdio.h> #define N 8 #define free -1 #define notfree 1 #define FALSE 2 #define TRUE 3 int row[N],col[N],dpos[2*N-1],dneg[2*N-1]; int X[N][N] void initialize(void); void printbord(void); void recursive(int); int main(){ int i,j,k,r,c; initialize(); for(i...
main.c:9:13: error: expected ';' before 'void' 9 | int X[N][N] | ^ | ; 10 | 11 | void initialize(void); | ~~~~ main.c: In function 'main': main.c:21:47: error: 'X' undeclared (first use in this function) 21 | ...
s808921939
p02244
C
#include<stdio.h> #define N 8 #define free -1 #define notfree 1 #define FALSE 2 #define TRUE 3 int row[N],col[N],dpos[2*N-1],dneg[2*N-1]; int X[N][N]; void initialize(void); void printbord(void); void recursive(int); int main(){ int i,j,k,r,c; initialize(); for(...
main.c: In function 'main': main.c:29:13: error: implicit declaration of function 'recrusive'; did you mean 'recursive'? [-Wimplicit-function-declaration] 29 | recrusive(0); | ^~~~~~~~~ | recursive main.c: In function 'printboard': main.c:78:17: error: expected declara...
s856664689
p02244
C
#include<stdio.h> #define N 8 #define free -1 #define notfree 1 #define FALSE 2 #define TRUE 3 int row[N],col[N],dpos[2*N-1],dneg[2*N-1]; int X[N][N]; void initialize(void); void printbord(void); void recursive(int); int main(){ int i,j,k,r,c; initialize(); for(...
main.c: In function 'main': main.c:29:13: error: implicit declaration of function 'recrusive'; did you mean 'recursive'? [-Wimplicit-function-declaration] 29 | recrusive(0); | ^~~~~~~~~ | recursive main.c: In function 'printboard': main.c:78:22: error: expected declara...
s113991282
p02244
C
#include<stdio.h> #define N 8 #define free -1 #define notfree 1 #define FALSE 2 #define TRUE 3 int row[N],col[N],dpos[2*N-1],dneg[2*N-1]; int X[N][N]; void initialize(void); void printbord(void); void recursive(int); int main(){ int i,j,k,r,c; initialize(); for(...
main.c: In function 'main': main.c:29:13: error: implicit declaration of function 'recrusive'; did you mean 'recursive'? [-Wimplicit-function-declaration] 29 | recrusive(0); | ^~~~~~~~~ | recursive
s245123294
p02244
C
#include <iostream> int board[8]; int col[8]; int diag1[15]; int diag2[15]; int fixed[8]; bool search(int r) { if (r == 8) return true; if (fixed[r]) return search(r+1); for (int c = 0; c < 8; c++) { if (col[c] || diag1[r-c+7] || diag2[r+c]) continue; board[r] = c; col[c] = true; ...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s800977778
p02244
C
#include<stdio.h> #define N 8 #define FREE -1 #define NOT_FREE 1 int row[N],col[N],dpos[2*N-1],dneg[2*N-1]; int x[N][N]; void initialize(void); void printBoard(void); void recursive(int); int main(){ int i,j; initialize(); for( i = 0 ; i < N ; i++ ){ for(j = 0 ; j < N ; j++ ){ x[i][j] = false; ...
main.c: In function 'main': main.c:20:17: error: 'false' undeclared (first use in this function) 20 | x[i][j] = false; | ^~~~~ main.c:2:1: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include<stdio.h> +++ |+#include...
s268344861
p02244
C
#include<stdio.h> #define N 8 #define FREE -1 #define NOT_FREE 1 int row[N],col[N],dpos[2*N-1],dneg[2*N-1]; int x[N][N]; void initialize(void); void printBoard(void); void recursive(int); int main(){ int i,j; initialize(); for( i = 0 ; i < N ; i++ ){ for(j = 0 ; j < N ; j++ ){ x[i][j] = 0; }...
main.c: In function 'initialize': main.c:49:5: error: 'dreg' undeclared (first use in this function); did you mean 'dneg'? 49 | dreg[i] = FREE; | ^~~~ | dneg main.c:49:5: note: each undeclared identifier is reported only once for each function it appears in
s827425719
p02244
C
/** Queen Chess */ /* include */ #include <stdio.h> #include <stdlib.h> /* define */ #define MAX 8 #define BLACK 1 //queen exist #define WHITE 0 //queen non-exist /* prototype */ void search(int i); /* global */ //X????????????Y????¨???????JUDGE????????????ULLR(Upper Left, Lower Right)???URLL(Upper Right, Lower L...
main.c:82:5: error: conflicting types for 'search'; have 'int(int)' 82 | int search(int n){ | ^~~~~~ main.c:15:6: note: previous declaration of 'search' with type 'void(int)' 15 | void search(int i); | ^~~~~~
s463073803
p02244
C
#include <stdio.h> #define N 8 #define FREE -1 #define NOT_FREE 1 #define TRUE 3 #define FALSE 2 void initialize(void); void printboard(void); void recursive(int); int row[N],col[N],dpos[2*N-1],dneg[2*N-1]; int Q[N][N]; void initialize(){ int i; for ( i = 0; i < N; i++ ){ row[i] = FREE; col[i] = FREE; } ...
main.c: In function 'printBoard': main.c:87:1: error: expected declaration or statement at end of input 87 | } | ^
s257559804
p02244
C
a
main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input 1 | a | ^
s690783394
p02244
C
#include <iostream> using namespace std; int row[8], col[8], dpos[15], dneg[15], ans[8][8] = { 0 }; void print() { for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (ans[i][j] == 1) { if (row[i] != j) { return; } ...
main.c:3:10: fatal error: iostream: No such file or directory 3 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s743749511
p02244
C
#include <iostream> using namespace std; int row[8], col[8], dpos[15], dneg[15], ans[8][8] = { 0 }; void print() { for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (ans[i][j] == 1) { if (row[i] != j) { return; } ...
main.c:2:10: fatal error: iostream: No such file or directory 2 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s546545879
p02244
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <math.h> #define INPUT_FILE_NAME "InputData.txt" #define MAX_BUF 255 #define BY_STDIN 1 #define BY_FILE 0 #define QUEEN_NUM 8 typedef struct Flag { int advance[QUEEN_NUM]; /* ???????????\?????§????????????????????????????????????????????...
main.c: In function 'createInputByFile': main.c:229:9: error: unknown type name 'errno_t'; did you mean 'ino_t'? 229 | errno_t err = fopen_s(&fp, filePath, "r"); | ^~~~~~~ | ino_t main.c:229:23: error: implicit declaration of function 'fopen_s'; did you mean 'fopen'? [-Wimplicit-fu...
s358030543
p02244
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <math.h> #define INPUT_FILE_NAME "InputData.txt" #define MAX_BUF 255 #define BY_STDIN 1 #define BY_FILE 0 #define QUEEN_NUM 8 typedef struct Flag { int advance[QUEEN_NUM]; /* ???????????\?????§????????????????????????????????????????????...
main.c: In function 'createInputByFile': main.c:229:9: error: unknown type name 'errno_t'; did you mean 'ino_t'? 229 | errno_t err = fopen_s(&fp, filePath, "r"); | ^~~~~~~ | ino_t main.c:229:23: error: implicit declaration of function 'fopen_s'; did you mean 'fopen'? [-Wimplicit-fu...
s529240979
p02244
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <math.h> #define INPUT_FILE_NAME "InputData.txt" #define MAX_BUF 255 #define BY_STDIN 1 #define BY_FILE 0 #define QUEEN_NUM 8 typedef struct Flag { int advance[QUEEN_NUM]; /* ???????????\?????§????????????????????????????????????????????...
main.c: In function 'createInputByFile': main.c:229:19: error: implicit declaration of function 'fopen_s'; did you mean 'fopen'? [-Wimplicit-function-declaration] 229 | int err = fopen_s(&fp, filePath, "r"); | ^~~~~~~ | fopen
s212445564
p02244
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <math.h> #define INPUT_FILE_NAME "InputData.txt" #define MAX_BUF 255 #define BY_STDIN 1 #define BY_FILE 0 #define QUEEN_NUM 8 typedef struct Flag { int advance[QUEEN_NUM]; /* ???????????\?????§???????????????????????...
main.c:4:10: fatal error: windows.h: No such file or directory 4 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s305157463
p02244
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <math.h> #define INPUT_FILE_NAME "InputData.txt" #define MAX_BUF 255 #define BY_STDIN 1 #define BY_FILE 0 #define TRUE #define FALSE #define QUEEN_NUM 8 typedef struct boardStatus { int advance[QUEEN_NUM]; /* ???????...
main.c:4:10: fatal error: windows.h: No such file or directory 4 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s320904946
p02244
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <math.h> #define INPUT_FILE_NAME "InputData.txt" #define MAX_BUF 255 #define BY_STDIN 1 #define BY_FILE 0 #define TRUE 1 #define FALSE 0 #define QUEEN_NUM 8 typedef struct boardStatus { int advance[QUEEN_NUM]; /* ???...
main.c:4:10: fatal error: windows.h: No such file or directory 4 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s183854016
p02244
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <math.h> #define INPUT_FILE_NAME "InputData.txt" #define MAX_BUF 255 #define BY_STDIN 1 #define BY_FILE 0 #define TRUE 1 #define FALSE 0 #define QUEEN_NUM 8 typedef struct boardStatus { int advance[QUEEN_NUM]; /* ???...
main.c:4:10: fatal error: windows.h: No such file or directory 4 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s768012787
p02244
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <math.h> #include <windows.h> #define INPUT_FILE_NAME "InputData.txt" #define MAX_BUF 255 #define BY_STDIN 1 #define BY_FILE 0 #define TRUE 1 #define FALSE 0 #define QUEEN_NUM 8 typedef struct BoardStatus { /* ???????????????????????????...
main.c:5:10: fatal error: windows.h: No such file or directory 5 | #include <windows.h> | ^~~~~~~~~~~ compilation terminated.
s395702268
p02244
C
#include<stdio.h> #define N 8 char Q[N][N]; void putpoint1(x,y){ int i,j; for(i=1;i<N-x;i++){ for(j=1;j<N-y;j++){ Q[x+i][j+y]='???'; } for(j=1;y-j>=0;j++){ Q[x+i][y-j]='???'; } } for(i=1;x-i>=0;i++){ for(j=1;j<N-y;j++){ Q[x-i][j+y]='???'; } for(j=1;y-j>=0;j--){ Q[x-i][y-j]='?...
main.c: In function 'putpoint1': main.c:4:6: error: type of 'x' defaults to 'int' [-Wimplicit-int] 4 | void putpoint1(x,y){ | ^~~~~~~~~ main.c:4:6: error: type of 'y' defaults to 'int' [-Wimplicit-int] main.c:8:21: warning: trigraph ??' ignored, use -trigraphs to enable [-Wtrigraphs] 8 | Q[x+i]...
s989119636
p02244
C
#include<stdio.h> #define N 8 char Q[N][N]; void putpoint1(x,y){ int i,j; for(i=1;i<N-x;i++){ for(j=1;j<N-y;j++){ Q[x+i][j+y]='.'; } for(j=1;y-j>=0;j++){ Q[x+i][y-j]='.'; } } for(i=1;x-i>=0;i++){ for(j=1;j<N-y;j++){ Q[x-i][j+y]='.'; } for(j=1;y-j>=0;j--){ Q[x-i][y-j]='.'; } }...
main.c: In function 'putpoint1': main.c:4:6: error: type of 'x' defaults to 'int' [-Wimplicit-int] 4 | void putpoint1(x,y){ | ^~~~~~~~~ main.c:4:6: error: type of 'y' defaults to 'int' [-Wimplicit-int] main.c: In function 'putpoint2': main.c:24:6: error: type of 'x' defaults to 'int' [-Wimplicit-int] ...
s837448132
p02244
C
#include <stdio.h> #define B 8 int check(int,int,int,int,int,int,int,int) int check(int i, int j, int k, int l, int m, int n, int o, int p) { return (i != j) && (i != k) && (i != l) && (i != m) && (i != n) && (i != o) && (i != p) && (j != k) && (j != l) && (j != m) && (j != n) && (j != o) && (j != p) ...
main.c: In function 'check': main.c:7:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 7 | { | ^ main.c:29:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 29 | { | ^ main.c:53: error: expected '{' at end of input
s732542848
p02244
C
#include <stdio.h> #define FREE_NOT 1 #define FREE 0 void putQueen(int); int n=8; int dpos[8]; int col[8]; int dneg[8]; int row[8]; int r[8],c[8]; int main() { int i; int k,a,b; scanf("%d",&k); for(i=0;i<k;i++){ scanf("%d",&r); scanf("%d",&c); row[r]=c; } putQueen(0); for(b=0;b<n;b++){ ...
main.c: In function 'main': main.c:19:8: error: array subscript is not an integer 19 | row[r]=c; | ^
s196383688
p02244
C
#include<stdio.h> #define N 8 #define FREE -1 #define NOT_FREE 1 int row[N], col[N], dpos[2 * N - 1], dneg[2 * N - 1]; bool X[N][N]; void initialize(){ int i; for(i = 0 ; i < N ; i++) {row[i] = FREE, col[i] = FREE;} for(i = 0 ; i < 2 * N ; i++) {dpos[i] = FREE, dneg[i]] = FREE;} } void printBoard(){ int i,...
main.c:9:1: error: unknown type name 'bool' 9 | bool X[N][N]; | ^~~~ main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include<stdio.h> +++ |+#include <stdbool.h> 2 | main.c: In function 'initialize': main.c:14:56: error: exp...
s169759879
p02244
C
else printf("Q"); } printf("\n"); } return; } if(row[i] == NOT_FREE) putQueen(i+1); else{ for(j = 0; j < N; j++){ if(col[j] == NOT_FREE || dpos[i+j] == NOT_FREE || dneg[i-j+N-1] == NOT_FREE) continue; col[j] = dpos[i+j] = dneg[i-j+N-1] = Board[i][j] = NOT_FREE; putQueen(i+...
main.c:1:9: error: expected identifier or '(' before 'else' 1 | else | ^~~~ main.c:3:7: error: expected identifier or '(' before '}' token 3 | } | ^ main.c:4:14: error: expected declaration specifiers or '...' before string constant 4 | printf("\n"); | ...
s110945245
p02244
C
#include<stdio.h> #define N 8 int Location[N][N]; int row[N]; int col[N]; int attackR[2*N-1]; int attackL[2*N-1]; void init(){ int i,j; for(i=0;i<N;i++)row[i]=col[i]==-1; for(i=0;i<2*N-1;i++) attackR[i]=attackL[i]=-1; for(i=0;i<N;i++){ for(j=0;j<N;j++){ Location[N][N]=-1; } } } void printLoca...
/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
s478158733
p02244
C
#include<stdio.h> #define N 8 int Location[N][N]; int row[N]; int col[N]; int attackR[2*N-1]; int attackL[2*N-1]; void init(){ int i,j; for(i=0;i<N;i++)row[i]=col[i]==-1; for(i=0;i<2*N-1;i++) attackR[i]=attackL[i]=-1; for(i=0;i<N;i++){ for(j=0;j<N;j++){ Location[N][N]=-1; } } } void printLoca...
/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
s946757099
p02244
C
#include<stdio.h> #define N 8 int Location[N][N]; int row[N]; int col[N]; int attackR[2*N-1]; int attackL[2*N-1]; void init(){ int i,j; for(i=0;i<N;i++)row[i]=col[i]==-1; for(i=0;i<2*N-1;i++) attackR[i]=attackL[i]=-1; for(i=0;i<N;i++){ for(j=0;j<N;j++){ Location[N][N]=-1; } } } void printLoc...
/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
s493953783
p02244
C
#include <stdio.h> #define FREE 0 #define N_FREE 1 #define Q 2 #define N 8 int board[N][N]; int row[N],col[N],dneg[2*N-1],dpos[2*N-1]; void printboard(int); void putQueen(int); int main(){ int k,r,c; int i; scanf("%d",&k); for(i=0;i<k;i++){ scanf("%d",&r); scanf("%d",&c); board[r][c] = N_F...
main.c: In function 'printboard': main.c:30:1: error: number of arguments doesn't match prototype 30 | void printboard(){ | ^~~~ main.c:10:6: error: prototype declaration 10 | void printboard(int); | ^~~~~~~~~~ main.c: In function 'putQueen': main.c:55:5: error: too few arguments to function 'pri...
s895836354
p02244
C
#include<stdio.h> #define N 8 #define FREE -1 #define NOT_FREE 1 int row[N],col[N],dpos[2*N-1],dneg[2*N-1]; bool X[N][N]; void initialize(){ for(int i=0;i<N;i++){ row[i]=FREE,col[i]=FREE; } void printBoard(){ for(int i=0;i<N;i++){ for(int j=0;j<N;j++){ if(X[i][j]){ if(row[i]!=j)return; } ...
main.c:7:1: error: unknown type name 'bool' 7 | bool X[N][N]; | ^~~~ main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include<stdio.h> +++ |+#include <stdbool.h> 2 | #define N 8 main.c: In function 'main': main.c:51:34: error...