submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s254335238
p01284
C++
#include<bits/stdc++.h> using namespace std; struct node{ int d,m; }data[1001]; int T,t[101],n,f[101]; bool cmp(node s1,node s2){ if(s1.d==s2.d) return s1.m<s2.m; return s1.d<s2.d; } int main(){ while(true){ scanf("%d",&T); if(T==0) return 0; for(int i=1;i<=T;i++) scanf("%d",&t[i]); scanf("%d",&n); for(in...
a.cc:36:2: error: stray '#' in program 36 | &#171; Back | ^ a.cc: In function 'int main()': a.cc:18:32: error: reference to 'data' is ambiguous 18 | scanf("%d%d",&data[i].d,&data[i].m); | ^~~~ In file included from /usr/include/c++/14/string:53, ...
s782936834
p01284
C++
#include<bits/stdc++.h> using namespace std; struct node{ int d,m; }data[1001]; int T,t[101],n,f[101]; bool cmp(node s1,node s2){ if(s1.d==s2.d) return s1.m<s2.m; return s1.d<s2.d; } int main(){ while(true){ scanf("%d",&T); if(T==0) return 0; for(int i=1;i<=T;i++) scanf("%d",&t[i]); scanf("%d",&n); for(in...
a.cc:36:2: error: stray '#' in program 36 | &#171; Back | ^ a.cc: In function 'int main()': a.cc:18:32: error: reference to 'data' is ambiguous 18 | scanf("%d%d",&data[i].d,&data[i].m); | ^~~~ In file included from /usr/include/c++/14/string:53, ...
s879887211
p01284
C++
#include <bits/stdc++.h> #define rep(i, a, n) for(int i = a; i < n; i++) #define int long long using namespace std; typedef pair<int, int> P; const int INF = 1e9; int T, N; vector<int> t; int tm[110]; int ed; int memo[110]; int solve(int idx){ if(memo[idx] != -1) return memo[idx]; if(idx > ed) return 0; ...
a.cc: In function 'long long int solve(long long int)': a.cc:24:19: error: reference to 'tm' is ambiguous 24 | if(wake > tm[i]) break; | ^~ In file included from /usr/include/time.h:39, from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gn...
s084776343
p01284
C++
#include <bits/stdc++.h> #define rep(i, a, n) for(int i = a; i < n; i++) #define int long long using namespace std; typedef pair<int, int> P; const int INF = 1e9; int T, N; vector<int> t; int tm[110]; int ed; int memo[110]; int solve(int idx){ if(memo[idx] != -1) return memo[idx]; if(idx > ed) return 0; ...
a.cc: In function 'long long int solve(long long int)': a.cc:24:19: error: reference to 'tm' is ambiguous 24 | if(wake > tm[i]) break; | ^~ In file included from /usr/include/time.h:39, from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gn...
s281703969
p01285
C++
#include<bits/stdc++.h> #define REP(i,s,n) for(int i=s;i<n;i++) #define rep(i,n) REP(i,0,n) #define EPS (1e-6) #define equals(a,b) (fabs((a)-(b)) < EPS) #define COUNTER_CLOCKWISE 1 #define CLOCKWISE -1 #define ONLINE_BACK 2 #define ONLINE_FRONT -2 #define ON_SEGMENT 0 using namespace std; class Point{ public:...
a.cc: In function 'Line calcLine(Line, Line, Point, Point)': a.cc:153:14: error: 'heron' was not declared in this scope 153 | double S = heron(p1,cp,p2); | ^~~~~
s536952457
p01285
C++
#include<iostream> #include<complex> #include<cmath> #include<vector> using namespace std; #define REP(i,b,n) for(int i=b;i<n;i++) #define rep(i,n) REP(i,0,n) #define mp make_pair #define pb push_back #define fir first #define sec second typedef complex<double> P; typedef pair<P,P> ...
a.cc: In function 'P rot(P, P)': a.cc:52:11: error: lvalue required as left operand of assignment 52 | ret.real()=cos(phi)*a.real()-sin(phi)*a.imag(); | ~~~~~~~~^~ a.cc:53:11: error: lvalue required as left operand of assignment 53 | ret.imag()=sin(phi)*a.real()+cos(phi)*a.imag(); | ~~~~~~~~^~...
s031544027
p01285
C++
#include<iostream> #include<complex> #include<cmath> #include<vector> #include<algorithm> using namespace std; #define REP(i,b,n) for(int i=b;i<n;i++) #define rep(i,n) REP(i,0,n) #define mp make_pair #define pb push_back #define fir first #define sec second typedef complex<double> P; ty...
a.cc: In function 'P rot(P, P)': a.cc:53:11: error: lvalue required as left operand of assignment 53 | ret.real()=cos(phi)*a.real()-sin(phi)*a.imag(); | ~~~~~~~~^~ a.cc:54:11: error: lvalue required as left operand of assignment 54 | ret.imag()=sin(phi)*a.real()+cos(phi)*a.imag(); | ~~~~~~~~^~...
s023888064
p01286
C++
#include <bits/stdc++.h> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i,n) for(int i=0;i<(int)(n);++i) #define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i) #define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i) #define each(a,b) for(auto& (a): (b)) #define all(v) (v).begi...
a.cc: In function 'int main()': a.cc:183:19: error: 'class PushRelabel<int>' has no member named 'max_flow' 183 | cout << d.max_flow(al,al+1) << "\n"; | ^~~~~~~~
s967736794
p01286
C++
#include <iostream> using namespace std; int H, W, C, M, Nw, Nc, Nm, s, t, res; int Win, Wout, Cin, Cout, Mio, V; int cap[310][310]; bool used[310]; enum { source = 300, sink, nwin, nwout, ncin, ncout, nmio }; bool dfs(int v, int t) { if(v == t) return true; used[v] = true; for(int i = 0; i < 310; ++i) if(cap[v]...
a.cc: In function 'int main()': a.cc:32:17: error: 'memset' was not declared in this scope 32 | memset(cap, 0, sizeof(cap)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> ...
s631645625
p01287
C++
#include<cstring> #include<cstdio> #include<map> #include<string> #include<set> #include<algorithm> using namespace std; int o[8]; char st[111]; int p[3][8] = { {1, 2, 3, 0, 5, 6, 7, 4}, {5, 6, 1, 0, 3, 4, 7, 2}, {5, 0, 3, 4, 7, 6, 1, 2} }; vector<int> permu(const vector<int> & v, int * p) { vector<int> res(v); fo...
a.cc:15:1: error: 'vector' does not name a type 15 | vector<int> permu(const vector<int> & v, int * p) { | ^~~~~~ a.cc: In function 'int main()': a.cc:26:25: error: 'vector' was not declared in this scope 26 | vector<int> vec; | ^~~~~~ a.cc:7:1: note: 's...
s244219858
p01287
C++
#include <iostream> #include <string> #include <algorithm> #include <map> #include <iomanip> using namespace std; bool hs[1<<24]; int calchs(int c[8]) { int ret=0; for(int i=0; i<8; i++) ret|=c[i]<<(3*i); return ret; } class Octahedra { public: int f[8]; void all_rotate() { hs[calchs(f)]=1; for(int i=0;...
a.cc: In function 'int main()': a.cc:97:17: error: 'memset' was not declared in this scope 97 | memset(hs, 0, sizeof(hs)); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <iomanip> +++...
s386089044
p01287
C++
#include<map> #include<set> #include<string> #include<vector> #include<iostream> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; typedef vector<int> vi; void rotx(vi &v){ vi t=v; v[0]=t[4]; v[1]=t[5]; v[2]=t[1]; v[3]=t[0]; v[4]=t[7]; v[5]=t[6]; v[6]=t[2]; v[7]=t[3]; } void roty(vi &v){ vi t=v; v[0]...
a.cc: In function 'int main()': a.cc:74:17: error: 'sort' was not declared in this scope; did you mean 'short'? 74 | sort(clr.begin(),clr.end()); | ^~~~ | short a.cc:79:24: error: 'next_permutation' was not declared in this scope 79 | }wh...
s888489963
p01287
C++
#include <iostream> #include <algorithm> #include <numeric> #include <vector> #include <cassert> #include <string> #include <memory.h> #include <queue> #include <cstdio> #include <cstdlib> #include <set> #include <map> #include <cctype> #include <iomanip> #include <sstream> #include <cctype> #include <fstream> #include...
a.cc: In function 'int main()': a.cc:99:5: error: 'a' was not declared in this scope 99 | a | ^
s389167383
p01288
Java
import java.util.*; public class Main2{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); while(true){ int nodenum = sc.nextInt(); int qnum = sc.nextInt(); if(nodenum == 0 && qnum == 0){ break; } initData(nodenum); for(int i = 2; i <= nodenum; i++){ setParent(...
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java public class Main2{ ^ Main.java:23: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal int n = new Integer(d[2] - '0'); ^ 1 error 1 warning
s321112067
p01288
C
#include<iostream> /************** * @Math **************/ #include<cmath> #include<algorithm> /************** * @String **************/ #include<cstring> #include<string> #include<string.h> /************** * @container **************/ #include<vector> #include<stack> #include<queue> #include<map> #include<s...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s192867107
p01288
C
#include<stdio.h> #include <stdlib.h> #include <string> #define MAX_N 100002 int par[MAX_N]; int rank[MAX_N]; int n,o,temp[MAX_N]; struct node { int parent,mark; } ; struct node p[MAX_N]; void node_init(int n){ int i; for (i = 0; i <= n; ++i) { p[i].parent = temp[i]; if (i == 1) p[i].mark = 1; el...
main.c:3:10: fatal error: string: No such file or directory 3 | #include <string> | ^~~~~~~~ compilation terminated.
s331600971
p01288
C
#include<stdio.h> #include <stdlib.h> #include <string> #define MAX_N 100002 int par[MAX_N]; int rank[MAX_N]; int n,o,temp[MAX_N]; struct node { int parent,mark; } ; struct node p[MAX_N]; void node_init(int n){ int i; for (i = 0; i <= n; ++i) { p[i].parent = temp[i]; if (i == 1) p[i].mark = 1; el...
main.c:3:10: fatal error: string: No such file or directory 3 | #include <string> | ^~~~~~~~ compilation terminated.
s974822514
p01288
C
#include<stdio.h> #include<string.h> #include<stdlib.h> #define MAX_N 200000 int par[MAX_N]; int original_par[MAX_N]; int query_list[MAX_N][2]; void init(int n){ int i; for(i=0;i<n;i++){ par[i] = i; } } int find(int x){ if(par[x]==x){ return x; }else { return par[x] = find(par[x]); } } void uni...
main.c: In function 'main': main.c:85:1: error: expected declaration or statement at end of input 85 | } | ^
s967041161
p01288
C
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cmath> #include <queue> #include <vector> #define SIZE 100010 typedef struct Node { int father; int ancester; std::vector<int> childs; } Node; Node node[SIZE]; void mark(int num) { std::queue<int> q; q.push(num); while (!q.empty()) { int n = q.fr...
main.c:2:10: fatal error: iostream: No such file or directory 2 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s274419613
p01288
C
#include<cstdio> #include<iostream> #include<algorithm> #include<cmath> #include<cstring> #include<string> #include<cstdlib> #include<ctime> #include<stack> #include<queue> #include<set> #include<map> #include<vector> #define mem(name,value) memset(name,value,sizeof(name)) #define loop(i,from,to) for(int i=from;i<to;i+...
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s398303768
p01288
C
#include<cstdio> #include<cstring> int n,q,f[100005],ans; bool mkd[100005]; char c[5],d; int main() { int i,a; while(1) { scanf("%d%d",&n,&q); if(!n) break; memset(mkd,0,sizeof(mkd));ans=0; mkd[1]=true; for(i=2;i<=n;i++) scanf("%d",&f[i]); for(i=1;i<=q;i++) { scanf("%s",c);d=c[0]; scanf("%d",&a);...
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s005851201
p01288
C
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <vector> #include <queue> #include <stack> #include <algorithm> #define ti printf("YES\n"); typedef long long ll; const int maxn=100005; const int INF=0x3f3f3f3f; const int mod=1e6; using namespace std; int pre[maxn]; int Find(int x) ...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s783920757
p01288
C
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; const int MAX_N = 100000 + 10; int N, Q; int P[MAX_N]; int vis[MAX_N]; void build(int N) { for (int i = 0; i <= N; i++) P[i] = i; } int find(int x) { if (vis[P[x]]) return P[x]; else return find(P[x]); ...
main.c:1:10: fatal error: algorithm: No such file or directory 1 | #include <algorithm> | ^~~~~~~~~~~ compilation terminated.
s473615946
p01288
C
#include<stdio.h> #include<string> #include<cstring> using namespace std; const int num = 1e5+1; int n,q,ask[num][2],time[num]={},askl=0; int father[num]; bool mark[num]={}; long long getF(int t) { if(mark[t]&&time[t]<=ask[askl][1]) return (long long)t; return (long long)(father[t]=getF(father[t])); } i...
main.c:2:9: fatal error: string: No such file or directory 2 | #include<string> | ^~~~~~~~ compilation terminated.
s214235990
p01288
C
#include<iostream> using namespace std; int n,q; int par[110],Rank[110]; void init() { int i; for(i=0;i<110;i++) { par[i]=i; Rank[i]=0; } Rank[1]=1; } int MV(int t) { if(t==1) return 1; else return(t+MV(par[t])); } void QV(int t) { cout<<par[t]<<endl; } int m...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s011706052
p01288
C
#include<stdio.h> #define maxn 100005 int n,m; int f[maxn]; char vis[maxn]; int _find(int x) { if(vis[x]) return x; else return _find(f[x]); } int main() { int i; while(scanf("%d%d",&n,&m)!=EOF) { if(!n&&!m)break; long long sum=0; for(i=1;i<=n;i++) { ...
main.c: In function 'main': main.c:25:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 25 | memset(vis,0,sizeof(vis)); | ^~~~~~ main.c:2:1: note: include '<string.h>' or provide a declaration of 'memset' 1 | #include<stdio.h> +++ |+#include <string.h> ...
s689751819
p01288
C++
/* author:hdsdogge begin: end: cost: *//* author #include<iostream> #include<string> #include<queue> #include<map> #include<stack> #include<algorithm> #include<cmath> #include<cstdio> #include<cstring> #include<vector> #include<bitset> #include<cstdlib> #include<list> #include <sstream> #include<ctype.h> ...
a.cc:7:4: error: unterminated comment 7 | *//* author | ^
s831452841
p01288
C++
#include<iostream> #include<vector> #include<algorithm> #include<set> #include<queue> #include<string> #include<cstdio> #include<stack> #include<cmath> #include<bitset> #include<functional> #include<memory> #include<utility> using namespace std; #define FOR(i,m,n) for(i=m;i<n;i++) #define MIN(x,y) (x>y?y:x) #define ab(...
a.cc: In function 'int main()': a.cc:41:17: error: 'memset' was not declared in this scope 41 | memset(node, 0, sizeof(node)); | ^~~~~~ a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 13 | #include<utility> ...
s816468867
p01288
C++
#include<iostream> #include<vector> #include<algorithm> #include<set> #include<queue> #include<string> #include<cstdio> #include<stack> #include<memory.h> #include<cmath> #include<bitset> #include<functional> #include<memory> #include<utility> using namespace std; #define FOR(i,m,n) for(i=m;i<n;i++) #define MIN(x,y) (x...
a.cc: In function 'int main()': a.cc:43:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 43 | scanf_s("%d%d", &N, &Q); | ^~~~~~~ | scanf
s533623257
p01288
C++
// // 2170.cpp // // // Created by Yoshida Satoshi on 2018/10/28. // #include <stdio.h> #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <queue> #include <stack> #include <utility> #define MAX 100010 #define P make_pair<char,int> typedef long long ll; using namespace std; str...
a.cc: In member function 'void UF::furiwake(int)': a.cc:64:37: error: 'n' was not declared in this scope; did you mean 'yn'? 64 | if(m[x]) par[c[x][i]]=x+n; | ^ | yn a.cc: In member function 'int UF::score(int)': a.cc:72:...
s449739257
p01288
C++
// // 2170.cpp // // // Created by Yoshida Satoshi on 2018/10/28. // #include <stdio.h> #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <queue> #include <stack> #include <utility> #define MAX 100010 #define P make_pair<char,int> typedef long long ll; using namespace std; str...
a.cc: In member function 'void UF::furiwake(int)': a.cc:64:37: error: 'n' was not declared in this scope; did you mean 'yn'? 64 | if(m[x]) par[c[x][i]]=x+n; | ^ | yn a.cc: In member function 'int UF::score(int)': a.cc:72:...
s451548548
p01288
C++
// // 2170.cpp // // // Created by Yoshida Satoshi on 2018/10/28. // #include <stdio.h> #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <queue> #include <stack> #include <utility> #define MAX 100010 #define P make_pair<char,int> typedef long long ll; using namespace std; str...
a.cc: In constructor 'UF::UF(int)': a.cc:37:33: error: invalid types 'int[int]' for array subscript 37 | for(int i=0;i<n;i++) m[i]=false; | ^ a.cc: In member function 'void UF::delmark(int)': a.cc:79:19: error: break statement not within loop or switch 79 | ...
s931593237
p01288
C++
// // 2170.cpp // // // Created by Yoshida Satoshi on 2018/10/28. // #include <stdio.h> #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <queue> #include <stack> #include <utility> #define MAX 100010 #define P make_pair<char,int> typedef long long ll; using namespace std; str...
a.cc: In constructor 'UF::UF(int)': a.cc:37:33: error: invalid types 'int[int]' for array subscript 37 | for(int i=0;i<n;i++) m[i]=false; | ^ a.cc: In member function 'void UF::delmark(int)': a.cc:79:19: error: break statement not within loop or switch 79 | ...
s812731385
p01288
C++
#include <iostream> using namespace std; typedef pair<char, int> P; const int MAX_N = 100000; const int MAX_Q = 100000; int N, Q; int p[MAX_N+5]; bool M[MAX_N+5]; int uf_par[MAX_N+5]; int uf_rank[MAX_N+5]; int mark[MAX_N+5]; void init(int n) { for(int i = 0; i < N; i++) { uf_par[i] = i; uf_rank[i]...
a.cc: In function 'int find(int)': a.cc:23:9: error: 'uf_pair' was not declared in this scope; did you mean 'uf_par'? 23 | if (uf_pair[x] == x) { | ^~~~~~~ | uf_par a.cc: In function 'bool same(int, int)': a.cc:45:12: error: 'uf_find' was not declared in this scope 45 | return ...
s520447928
p01288
C++
#include <iostream> #include <algorithm> using namespace std; typedef pair<char, int> P; const int MAX_N = 100000; const int MAX_Q = 100000; int N, Q; int p[MAX_N+5]; bool M[MAX_N+5]; int uf_par[MAX_N+5]; int uf_rank[MAX_N+5]; int mark[MAX_N+5]; void init(int n) { for(int i = 0; i < N; i++) { uf_par[i] = ...
a.cc: In function 'int find(int)': a.cc:24:9: error: 'uf_pair' was not declared in this scope; did you mean 'uf_par'? 24 | if (uf_pair[x] == x) { | ^~~~~~~ | uf_par a.cc: In function 'bool same(int, int)': a.cc:46:12: error: 'uf_find' was not declared in this scope 46 | return ...
s306233284
p01288
C++
#include <iostream> #include <stdio.h> #include <cstdlib> #include <vector> #include <string> #include <queue> #include <map> #include <algorithm> #define INF 10000000 using namespace std; typedef pair<int,int> P; struct node{ bool marked; int parent; int num; }; int main(){ while(1){ vector<node> T; ...
a.cc: In function 'int main()': a.cc:37:20: error: 'child' was not declared in this scope 37 | T.push_back((child){false,i,parent-1}); | ^~~~~
s921445624
p01288
C++
#include<cstring> #include<cstdio> #include<algorithm> #include<iostream> #include<vector> using namespace std; int v[444444], dep[444444], bg[444444], ed[444444]; vector<int> edges[444444]; char st[111]; vector<pair<int, int> > st0; void build(int k, int l, int r) { v[k] = 1; if(l != r) { build(k + k, l, (l + r) /...
a.cc: In function 'int main()': a.cc:93:37: error: expected ';' before '}' token 93 | printf("%lld\n",ans) | ^ | ; 94 | } | ~
s313958631
p01288
C++
#include <cstdio> #include <cmath> #include <cstring> #include <cstdlib> #include <climits> #include <ctime> #include <queue> #include <stack> #include <algorithm> #include <list> #include <vector> #include <set> #include <map> #include <iostream> #include <deque> #include <complex> #include <string> #include <iomanip>...
a.cc:123:1: error: expected ',' or ';' before 'main' 123 | main(){ | ^~~~
s869675211
p01288
C++
// // AOJ 2170 Marked Ancestor // // Created by TaoSama on 2015-03-16 // Copyright (c) 2015 TaoSama. All rights reserved. // #include <algorithm> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include ...
a.cc: In function 'void init(int)': a.cc:33:17: error: reference to 'rank' is ambiguous 33 | rank[i] = 0; | ^~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++...
s713563731
p01288
C++
#include <vector> #include <cstdio> using namespace std; class union_find{ vector<int> parent; public: vector<int> marked; int root(int a){return parent[a]==a||marked[a]?a:(parent[a]=root(parent[a]));} union_find(int n):parent(n),marked(n){for(int i=1;i<n;i++)parent[i]=i;} int same(int a,int b){return root(a)==ro...
a.cc: In function 'int main()': a.cc:35:17: error: 'reverse' was not declared in this scope 35 | reverse(query.begin(),query.end()); | ^~~~~~~
s809994256
p01288
C++
#include <vector> #include <cstdio> using namespace std; class union_find{ vector<int> parent; public: vector<int> marked; int root(int a){return parent[a]==a||marked[a]?a:(parent[a]=root(parent[a]));} union_find(int n):parent(n),marked(n){for(int i=1;i<n;i++)parent[i]=i;} int same(int a,int b){return root(a)==ro...
a.cc: In function 'int main()': a.cc:35:17: error: 'reverse' was not declared in this scope 35 | reverse(query.begin(),query.end()); | ^~~~~~~
s264172533
p01288
C++
#include<iostream> #include<stdio.h> #include<math.h> #include<vector> #include<queue> using namespace std; struct node{ int id; node* parent; int h; vector<node*> child; }; bool com(node* n1,node* n2){ return n1->id<n2->id; } int main(){ int n,q,p; while(cin>>n>>q,n){ vector<node*>...
a.cc: In function 'int main()': a.cc:49:21: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 49 | sort(marked.begin(),marked.end(),com); | ^~~~ | sqrt a.cc:50:24: error: 'binary_search' was not declared in this scope 50 | ...
s277852885
p01288
C++
/* * hujx.cpp * * Created on: 2015年5月21日 * Author: dell */ #include<stdio.h> #include<iostream> #include<string> #include<string.h> #include<algorithm> #include<iomanip> #include<vector> #include<time.h> #include<queue> #include<stack> #include<iterator> #include<math.h> #include<stdlib.h> #include<limits.h>...
a.cc: In function 'int main()': a.cc:42:12: error: '__int64' was not declared in this scope; did you mean '__ynf64'? 42 | #define ll __int64 | ^~~~~~~ a.cc:67:9: note: in expansion of macro 'll' 67 | ll ans=0; | ^~ a.cc:72:25: error: 'ans' was not declared in this scope; did...
s095934153
p01288
C++
#include<cstdio> #include<iostream> #include<cstdlib> #include<cstring> using namespace std; const int MAXN = 100000 + 10; int par[MAX]; int Find(int x){ if (x == par[x]) return par[x]; return Find(par[x]); } int main(){ int n, q; char ins[10]; int v; while (~scanf("%d%d", &n, &q) && (n || q)){ long long sum...
a.cc:7:9: error: 'MAX' was not declared in this scope; did you mean 'MAXN'? 7 | int par[MAX]; | ^~~ | MAXN a.cc: In function 'int Find(int)': a.cc:9:18: error: 'par' was not declared in this scope 9 | if (x == par[x]) | ^~~ a.cc:11:21: error: 'par' was ...
s738460849
p01288
C++
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> using namespace std; const int N = 100005; int par[N], flag[N]; int find(int x) { if (flag[x] == 1) return x; else return find(par[x]); } int main() { int n, m; char s[10]; while (~scanf("%d%d", &n, &m)) { __int64 ans;...
a.cc: In function 'int main()': a.cc:22:17: error: '__int64' was not declared in this scope; did you mean '__ynf64'? 22 | __int64 ans; | ^~~~~~~ | __ynf64 a.cc:23:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 23 | a...
s500140181
p01288
C++
#include <iostream> #include <stdio.h> #define maxN 100016 using namespace std; int par[maxN], rank[maxN]; int find(int x) { if (par[x] == x) return x; return find(par[x]); } int main() { int n, t, i, j, x; __int64 sum; char c; while (scanf("%d%d", &n, &t) && (n || t)) { par[1] = 1; for (i = 2; i <= n;...
a.cc: In function 'int main()': a.cc:19:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 19 | __int64 sum; | ^~~~~~~ | __int64_t a.cc:27:26: error: 'sum' was not declared in this scope 27 | for (i = sum = 0; i < t; i++) | ...
s147649373
p01288
C++
#include <iostream> #include <stdio.h> #define maxN 100000 + 16 using namespace std; int par[maxN], mark[maxN]; int qx[maxN], qt[maxN], tt; int find(int x) { return mark[x] < tt ? x : par[x] = find(par[x]); } int main() { int n, t, i, x, nn; char c; __int64 sum; while (scanf("%d%d", &n, &t) && (n || t)) { p...
a.cc: In function 'int main()': a.cc:19:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'? 19 | __int64 sum; | ^~~~~~~ | __int64_t a.cc:42:34: error: 'sum' was not declared in this scope 42 | for (i = nn - 1, sum = 0; i >= 1; i--) ...
s823376902
p01288
C++
#include <iostream> #define Q 100005 using namespace std; typedef long long ll; ll n,q,u,t[Q],p[Q]; bool marked[Q]; char c[Q]; int find(int x){ if(marked[p[x]]) return p[x]; return p[x]=find(p[x]); } int main(){ while(1){ cin>>n>>q; if(!n&&!q) break; for(int i=0;i<n;i++) marked[i]=false; for(int...
a.cc: In function 'int main()': a.cc:25:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 25 | ans=0; | ^~~ | abs
s231436070
p01288
C++
#include <cstdio> #include <iostream> #include <vector> #include <cstring> using namespace std; const int MAX_N = 100000; int N, Q; char Ope[MAX_N]; int Openum[MAX_N], Marked[MAX_N]; vector<int> child[MAX_N]; void mark(int x, int num) { if(Marked[x] == x || Marked[x] == num) return; Marked[x] = num; for(int i...
a.cc: In function 'void solve()': a.cc:25:36: error: expected ';' before 'for' 25 | memset(Marked, 0, sizeof(Marked)) | ^ | ; 26 | for(int i = 0; i < Q; i++){ | ~~~ a.cc:26:18: error: 'i' w...
s352666762
p01288
C++
#include <cstdio> #include <iostream> using namespace std; const int MAX_N = 100001; // int N, Q; // long long int ans; // int par[MAX_N]; // bool marked[MAX_N]; void init() { for (int i = 0; i <= N; i++) { par[i] = i; } } int search(int x) { if (marked[x]) return x; else return search(par[x...
a.cc: In function 'void init()': a.cc:14:24: error: 'N' was not declared in this scope 14 | for (int i = 0; i <= N; i++) { | ^ a.cc:15:5: error: 'par' was not declared in this scope 15 | par[i] = i; | ^~~ a.cc: In function 'int search(int)': a.cc:20:7: error: 'marked' ...
s834090670
p01288
C++
#include<iostream> #include<cstdio> #include<cmath> #include<vector> #include<queue> #include<map> #include<algorithm> #include<complex> #include<string> #include<cstring> using namespace std; #define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++) #define rep(x,to) rep2(x,0,to) #define INF 100000000 #define all(x) x...
a.cc: In function 'int main()': a.cc:62:21: error: 'class std::queue<std::pair<int, int> >' has no member named 'clear' 62 | mna.clear(); | ^~~~~
s972192522
p01288
C++
#include<cstdio> #include<iostream> #include<algorithm> #include<cmath> using namespace std; typedef long long int lli; typedef pair<int,bool> P; int N,Q; int p[1000000]; bool hoge[10000000]; int q; char s; int parent(int x){ if(hoge[p[x]]==1) return p[x]; else return parent(p[x]); } int main(){ while(1){ s...
a.cc: In function 'int main()': a.cc:23:5: error: 'memset' was not declared in this scope 23 | memset(p,0,sizeof(p)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<cmath> +++ |+#include <cstring> 5 | us...
s783309496
p01288
C++
#include<cstdio> #include<iostream> #include<algorithm> #include<cmath> using namespace std; typedef long long int lli; typedef pair<int,bool> P; int N,Q; int p[1000000]; bool hoge[10000000]; int q; char s; int parent(int x){ if(hoge[p[x]]==1) return p[x]; else return parent(p[x]); } int main(){ while(1){ s...
a.cc: In function 'int main()': a.cc:23:5: error: 'memset' was not declared in this scope 23 | memset(p,0,sizeof(p)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<cmath> +++ |+#include <cstring> 5 | us...
s719228056
p01288
C++
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<vector> #define LL long long using namespace std; const int N = 100010; vector<int> edge[N]; vector<int> mark[N], query[N]; int n, m; int L(int x){return x << 1;} int R(int x){return x << 1 | 1;} struct Tree{ struct node{ int v; }tr[...
a.cc: In function 'void dfs(int, int)': a.cc:65:21: error: redeclaration of 'int _index' 65 | int _index = min(m, 50); | ^~~~~~ a.cc:53:21: note: 'int _index' previously declared here 53 | int _index = min(m, 50); | ^~~~~~
s997746775
p01288
C++
#include <iostream> #include <cstdio> #include <cstring> using namespace std; const int maxn =100000+10; int n,q; int par[maxn]; bool mark[maxn]; int find(int x){ if(mark[x]){ return x; } else{ return find(par[x]); } } int main(){ while(scanf("%d%d",&n,&q)!=EOF){ if(n==0&&q...
a.cc: In function 'int main()': a.cc:31:9: error: 'LL' was not declared in this scope 31 | LL sum=0; | ^~ a.cc:40:17: error: 'sum' was not declared in this scope 40 | sum+=find(v); | ^~~ a.cc:43:25: error: 'sum' was not declared in this scope 43 | ...
s857115400
p01288
C++
#include?<iostream> #include?<vector> #include?<queue> #include?<stack> using?namespace?std; //?并?集相?数据与算法 #define?MAX_N?100000?+?16 int?parent[MAX_N]; int?height[MAX_N]; void?init(const?int&?n) { for?(int?i?=?0;?i?<?n;?++i) { parent[i]?=?i; height[i]?=?0; } } int?find(const?int&?x) { if?(parent[x]?==?x) { ...
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME> 1 | #include?<iostream> | ^ a.cc:2:9: error: #include expects "FILENAME" or <FILENAME> 2 | #include?<vector> | ^ a.cc:3:9: error: #include expects "FILENAME" or <FILENAME> 3 | #include?<queue> | ^ a.cc:4:9: ...
s182484171
p01288
C++
#include <iostream> #include <stdio.h> #include <memory.h> using namespace std; const int MAX_N = 100000; int N; int Q; bool marked[MAX_N + 4]; int par[MAX_N + 4]; int find(int x) { if (marked[par[x]]) { return par[x]; } return find(par[x]); } int main() { while (scanf("%d %d", &N, &Q) != EO...
a.cc: In function 'int main()': a.cc:21:38: error: 'EOD' was not declared in this scope; did you mean 'EOF'? 21 | while (scanf("%d %d", &N, &Q) != EOD && N > 0 && Q > 0) { | ^~~ | EOF
s465444548
p01288
C++
#include<iostream> #include<algorithm> #include<vector> #define MAX 100010 #define INF 1<<20 using namespace std; vector<int> lis[MAX]; int u[MAX],r[MAX]; bool vis[MAX]; void DFS(int x,int len,int nod){ vis[x]=true; r[x]=len,u[x]=nod; for(int i=0;i<lis[x].size();i++){ if(!vis[lis[x][i]]&&r[lis[x][i]]>len+1){ ...
a.cc: In function 'int main()': a.cc:31:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 31 | scanf_s("%d",&z);z--; | ^~~~~~~ | scanf a.cc:41:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 41 | ...
s173541024
p01288
C++
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; const int maxn = 2e5 + 4; int par[maxn]; int x[1010], y[1010]; int find(int x){ if(par[x] == x) return x; else return find(par[x]); } int main(){ int n, q; while(scanf("%d%d", &n, &q)!=EOF){ if(n == 0 && q == 0) break; ...
a.cc: In function 'int main()': a.cc:21:17: error: 'll' was not declared in this scope 21 | ll ans = 0; | ^~ a.cc:28:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 28 | ans += find(x); | ...
s750507885
p01288
C++
#include<iostream> #include<vector> struct UnionFind{ vector <int> par; UnionFind(int N) : par(N, -1){} void unite(int x, int y){ x = root(x); y = root(y); if(x != y){ par[x] += par[y]; par[y] = x; } } int root(int x){ return par[x] < 0 ? x : par[x] = ...
a.cc:4:5: error: 'vector' does not name a type 4 | vector <int> par; | ^~~~~~ a.cc: In constructor 'UnionFind::UnionFind(int)': a.cc:5:24: error: class 'UnionFind' does not have any field named 'par' 5 | UnionFind(int N) : par(N, -1){} | ^~~ a.cc: In member functio...
s836423029
p01288
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; struct UnionFind{ vector <int> par; UnionFind(int N) : par(N, -1){} void unite(int x, int y){ x = root(x); y = root(y); if(x != y){ par[x] += par[y]; par[y] = x; } } int roo...
a.cc: In function 'int main()': a.cc:28:11: error: 'ifs' was not declared in this scope 28 | while(ifs >> N >> Q && N){ | ^~~ a.cc:29:9: error: 'memset' was not declared in this scope 29 | memset(marked, 0, sizeof(marked)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in ...
s383959111
p01288
C++
#include<iostream> #include<cstdio> using namespace std; int n,q; int tree[100050]; int Find(int x) { if(tree[x]==x) return x; return Find(tree[x]); } int main() { while(scanf("%d %d",&n,&q)==2) { if(n==0&&q==0) break; tree[1]=1; for(int i=2;i<=n;i++) ...
a.cc: In function 'int main()': a.cc:31:13: error: 'gets' was not declared in this scope; did you mean 'getw'? 31 | gets(s); | ^~~~ | getw
s958207188
p01288
C++
#include<iostream> #include<cstdio> using namespace std; int n,q; int tree[100050]; int Find(int x) { if(tree[x]==x) return x; return Find(tree[x]); } int main() { while(scanf("%d %d",&n,&q)==2) { if(n==0&&q==0) break; tree[1]=1; for(int i=2;i<=n;i++) ...
a.cc: In function 'int main()': a.cc:31:13: error: 'gets' was not declared in this scope; did you mean 'getw'? 31 | gets(s); | ^~~~ | getw
s221585334
p01288
C++
//C++14 (Clang 3.8.0) #include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #includ...
a.cc: In function 'void dfs(int, int)': a.cc:35:8: error: 'used' was not declared in this scope 35 | if(used[start]==1) return ; | ^~~~ a.cc:36:5: error: 'mark' was not declared in this scope 36 | mark[start]=root; | ^~~~ a.cc:37:19: error: 'child' was not declared in this scope ...
s955862462
p01288
C++
#include<bits/stdc++.h> #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b)) #define MAXN 100000+1109 using namespace std; char ch[30]; int n,m; int fa[MAXN]; int a[MAXN],Q[MAXN]; bool Is[MAXN]; long long Ans=0; int find(int x) { if(fa[x]==x) return x; if(Is[x]==true) return x; fa[x]=find(fa[x]);...
a.cc: In function 'int main()': a.cc:29:35: error: expected ')' before ';' token 29 | while(~scanf("%d%d",&n,&m);) | ~ ^ | ) a.cc:29:36: error: expected primary-expression before ')' token 29 | while(~scanf("%d%d",&n,&m)...
s936577236
p01288
C++
#include<bits/stdc++.h> #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b)) #define MAXN 100000+1109 using namespace std; char ch[30]; long long n,m; long long fa[MAXN]; long long a[MAXN],Q[MAXN]; bool Is[MAXN]; long long Ans=0; long long Mark[MAXN]; long long find(long long x) { if(fa[x]==x) retu...
a.cc:29:9: error: expected initializer before 'while' 29 | while(~scanf("%lld%lld",&n,&m)) | ^~~~~ a.cc:40:9: error: expected unqualified-id before 'return' 40 | return 0; | ^~~~~~ a.cc:41:1: error: expected declaration before '}' token 41 | } | ^
s575152008
p01288
C++
#include <cstdio> #include <algorithm> #include <cstring> using namespace std; typedef long long int ll; const int MAX_N = 100010; struct UnionFind { int node[MAX_N]; UnionFind() {} void init() { memset(node, -1, sizeof(node)); } int find(int x) { return (node[x] < 0 ? x : node[x] ...
a.cc:44:1: error: 'vector' does not name a type 44 | vector< vector<int> > G; | ^~~~~~ a.cc: In function 'void init(int, int)': a.cc:50:23: error: 'G' was not declared in this scope 50 | for(size_t i=0; i<G[root].size(); i++) { | ^ a.cc: In function 'int main()': a.cc:75:9: e...
s753130102
p01288
C++
#include <cstdio> #include <algorithm> #include <cstring> #include <vector> using namespace std; typedef long long int ll; const int MAX_N = 100010; struct UnionFind { int node[MAX_N]; UnionFind() {} void init() { memset(node, -1, sizeof(node)); } int find(int x) { return (node[x] ...
a.cc: In function 'int main()': a.cc:80:9: error: 'debug' was not declared in this scope 80 | debug(); | ^~~~~
s337596950
p01288
C++
class UnionFindTree: """Disjoint-Set Data Structure Union-Find Tree complexity: init: O(n) find, unite, same: O(alpha(n)) used in SRM505 div.2 900, ATC001 A, DSL1A(AOJ) """ def __init__(self, n): self.par = list(range(n)) # parent self.rank = [0] * n...
a.cc:2:7: warning: missing terminating " character 2 | """Disjoint-Set Data Structure | ^ a.cc:2:7: error: missing terminating " character 2 | """Disjoint-Set Data Structure | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:8:7: warning: missing terminating " character 8 | """ | ...
s509725681
p01288
C++
#include<iostream> #include<cstdio> #include<cstring> #include<vector> #include<algorithm> using namespace std; int flag[100010],par[100010]; vector<int> gg[100010]; int n,q; long long ans; void setpar(int parr,int x) { par[x]=parr; if(!flag[x]) { for(int i=0;i<gg[x].size();i++) setpar(parr,gg[x][i]); } } int ...
a.cc: In function 'int main()': a.cc:26:13: error: 'i' was not declared in this scope 26 | par[i]=0; | ^
s853027656
p01288
C++
#include<cstdio> #include<algorithm> #include<map> #include<vector> using namespace std; const int MAX_N=100001; vector<int>edge[MAX_N]; vector<int>id[MAX_N]; int vi[MAX_N*2]; int DFS(int n,int d) { vi[d]=n; id[n].push_back(d); for(int i=0;i<edge[n].size();++i) { d=DFS(edge[n][i],d+1)+1; vi[d]=n; id[n].push_...
a.cc: In function 'int main()': a.cc:27:14: error: request for member 'resize' in 'edge', which is of non-class type 'std::vector<int> [100001]' 27 | edge.resize(MAX_N); | ^~~~~~ a.cc:28:12: error: request for member 'resize' in 'id', which is of non-class type 'std::vector<int> [100001]' ...
s456261956
p01288
C++
#include <iostream> using namespace std; #define MAX_N 100002 /* union find */ int par[MAX_N]; // root int rank[MAX_N]; // depth of tree // 要素数nで初期化 void init(int n) { for (int i=0;i<n; i++) { par[i] = i; rank[i] = 0; } } // 木の根を求める(あえて根の張りなおしをしない) int find(int x) { if (par[x] == x) { return...
a.cc: In function 'void init(int)': a.cc:14:5: error: reference to 'rank' is ambiguous 14 | rank[i] = 0; | ^~~~ In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, from /usr/include/c++/14/exception:166, ...
s045594429
p01288
C++
#include <iostream> #include <sstream> #include <string> #include <algorithm> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <cassert> using namespace std; #define FOR(i,k,n) for(int i=(k); i<(int)(n);...
a.cc: In function 'int main()': a.cc:43:16: error: expected ';' before 'for' 43 | mark[0] = 1 | ^ | ; a.cc:44:9: error: 'i' was not declared in this scope 44 | REP(i, N - 1){ | ^ a.cc:18:35: note: in definition of macro 'FOR' 18 | #define FOR(i,k,...
s154097533
p01288
C++
#include<iostream> #include<map> #include<algorithm> using namespace std; int n, q, root[10500]; long long res; bool marked[10500]; pair<char, int> query[10500]; int r(int x){ if(marked[x])return x; return root[x]=r(root[x]); } int main() { while(true){ cin >> n >> q; if(n == 0 && q == 0)return 0; ...
a.cc: In function 'int main()': a.cc:30:19: error: 'Q' was not declared in this scope 30 | for(int i=Q-1;i>=0;i--){ | ^
s840534990
p01288
C++
#include<iostream> #include<stdio> #include<map> #include<algorithm> using namespace std; int n, q, root[105000]; long long res; int marked[105000]; pair<char, int> query[105000]; int r(int x){ if(marked[x])return x; return root[x]=r(root[x]); } int main() { while(true){ scanf("%d%d", &n, &q); // cin...
a.cc:2:9: fatal error: stdio: No such file or directory 2 | #include<stdio> | ^~~~~~~ compilation terminated.
s068669294
p01288
C++
#include <algorithm> #include <cstdlib> #include <iostream> #include <stack> #include <vector> using namespace std; int parent[100000]; bool is_mark[100000], is_root[100000]; class union_find { private: vector<int> uf; public: union_find(int n) { uf.resize(n, -1); } inline int find(int x) { return uf[x] < 0...
a.cc: In function 'int main()': a.cc:56:17: error: 'memset' was not declared in this scope 56 | memset(is_root, false, sizeof(is_root)); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <...
s000337429
p01288
C++
#include <cstdio> #include <vector> #include <algorithm> using namespace std; vector<int> G[100000]; bool vis[100000], marked[100000]; int qtype[100000], vertex[100000]; int par[100000], pp[100000]; void init() { for (int i = 0; i < 100000; i++) par[i] = i; } int find(int x) { if (par[x] == x) return (x); retur...
a.cc: In function 'int main()': a.cc:60:17: error: 'memset' was not declared in this scope 60 | memset(marked, 0, sizeof(marked)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algori...
s844584474
p01288
C++
#include<iostream> #include<cstdio> using namespace std; int n,q; int tree[100050]; int Find(int x) { if(tree[x]==x) return x; return Find(tree[x]); } int main() { while(scanf("%d %d",&n,&q)==2) { if(n==0&&q==0) break; tree[1]=1; for(int i=2;i<=n;i++) ...
a.cc: In function 'int main()': a.cc:31:13: error: 'gets' was not declared in this scope; did you mean 'getw'? 31 | gets(s); | ^~~~ | getw a.cc: At global scope: a.cc:44:1: error: expected unqualified-id before '[' token 44 | [C++] | ^
s575168919
p01288
C++
#include <iostream> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N, Q; bool mark[100001]; int tree[100001]; while (1) { cin >> N >> Q; if (N == 0 && Q == 0) { break; } memset(mark, false, sizeof(mark)); mark[...
a.cc: In function 'int main()': a.cc:16:9: error: 'memset' was not declared in this scope 16 | memset(mark, false, sizeof(mark)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#incl...
s496458069
p01288
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; #define INF (1<<29) template<class T> class BinomialHeap{ struct Tree{ T val; std::vector<Tree *> edge; Tree(T &v):val(v){} ~Tree(){ for(int i=0;i<degree();i++)delete edge[i]; } void add(Tree *t){edge.push_back(t);} void p...
a.cc:162:2: error: expected unqualified-id before '/' token 162 | */ | ^
s019504222
p01288
C++
#include<iostream> #include<vector> #include<algorithm> #include<queue> using namespace std; #define INF (1<<29) template<class T> class BinomialHeap{ struct Tree{ T val; std::vector<Tree *> edge; Tree(T &v):val(v){} ~Tree(){ for(int i=0;i<degree();i++)delete edge[i]; } void add(Tree *t){edge.push_ba...
a.cc: In function 'int main()': a.cc:149:17: error: 'memset' was not declared in this scope 149 | memset(par,-1,sizeof(par)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include<queue> +++ ...
s790571431
p01288
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; #define INF (1<<29) template<class T> struct Vector{ int sz,cap; T *p; Vector():sz(0),cap(0),p(0){} ~Vector(){ clear(); } void swap(Vector &v){ std::swap(sz,v.sz); std::swap(cap,v.cap); std::swap(p,v.p); } int size()const{re...
a.cc: In function 'int main()': a.cc:209:45: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int' 209 | bh[v].push(i+1); | ~^~ a.cc:136:22: note: initializing argument 1 of 'void BinomialHeap<T>::push...
s905828825
p01289
C++
#include <cmath> #include <cstdlib> #include <iostream> #include <queue> #include <sstream> #include <vector> using namespace std; template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; } typedef pair<int, int> edge; #define to first #define cost second typedef vector<vector<edge>> graph; constexp...
a.cc: In function 'std::vector<int> dijkstra(int, const graph&)': a.cc:71:29: error: 'INT_MAX' was not declared in this scope 71 | vector<int> dist(n, INT_MAX); | ^~~~~~~ a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include...
s427879325
p01289
C++
#include <iostream> #include <vector> #include <queue> #include <cmath> using namespace std; class Edge{ public: int p, q, cost; Edge(int p, int q, int cost) : p(p), q(q), cost(cost) {} bool operator < (const Edge &e) const { return cost > e.cost; } }; int main(){ int n, s, t; while(cin >> n >> s >> t, n){ s...
a.cc: In function 'int main()': a.cc:23:17: error: 'memset' was not declared in this scope 23 | memset(out,0,sizeof(out)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <cmath> +++ |...
s678530524
p01290
C++
Queen can escape.
a.cc:1:1: error: 'Queen' does not name a type 1 | Queen can escape. | ^~~~~
s796158980
p01290
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++) #define REP(i,n) FOR(i,0,n) #define ALL(a) a.begin(), a.end() #define MS(m,v) memset(m,v,sizeof(m)) typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<string> vs; typedef pair<int,...
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Ite...
s341149604
p01291
C++
#include <cmath> #include <cstdlib> #include <iostream> #include <vector> using namespace std; template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; } constexpr double EPS = 1e-9; struct point { double x, y; explicit point(double x_ = 0.0, double y_ = 0.0):x(x_), y(y_) {} point(const point &p):...
a.cc: In function 'double dist(const segment&, const segment&)': a.cc:101:19: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 101 | return min({dist(s, t.a), dist(s, t.b), dist(t, s.a), dist(t, s.b)}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
s731402332
p01291
C++
#include <climits> #include <cmath> #include <cstdlib> #include <iostream> #include <vector> using namespace std; template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; } constexpr double EPS = 1e-9; struct point { double x, y; explicit point(double x_ = 0.0, double y_ = 0.0):x(x_), y(y_) {} poi...
a.cc: In function 'double dist(const segment&, const segment&)': a.cc:102:19: error: no matching function for call to 'min(<brace-enclosed initializer list>)' 102 | return min({dist(s, t.a), dist(s, t.b), dist(t, s.a), dist(t, s.b)}); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
s414811703
p01291
C++
#include<bits/stdc++.h> using namespace std; #define r(i,n) for(int i=0;i<n;i++) typedef double D; typedef complex<D> P; typedef pair<P, P> L; typedef vector<P> VP; const D EPS = 1e-9; #define X real() #define Y imag() D dot(P a,P b) {return (conj(a)*b).X; } D cross(P a,P b) {return(conj(a)*b).Y;} int ccw(P a,P b,P c){...
a.cc:38:13: error: 'double y1' redeclared as different kind of entity 38 | double h,x1,y1,a[222][222]; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/...
s190749715
p01291
C++
#include<cstdio> #include<iostream> #include<vector> #include<string> #include<algorithm> #include<set> #include<map> #include<queue> #include<cmath> using namespace std; #define reps(i,f,n) for(int i=f;i<int(n);i++) #define rep(i,n) reps(i,0,n) typedef pair<int,int> pii; const int INF = 1000000000; const int N = ...
a.cc: In function 'double solve()': a.cc:115:24: error: 'h' was not declared in this scope 115 | if(n==0)return h; | ^
s783623550
p01293
C++
---------- STL Libraries ---------- */ // IO library #include <cstdio> #include <fstream> #include <iomanip> #include <ios> #include <iostream> // algorithm library #include <algorithm> #include <cmath> #include <numeric> // container library #include <array> #include <bitset> #include <deque> #include <map> #inclu...
a.cc:1:2: error: expected unqualified-id before '--' token 1 | ---------- STL Libraries ---------- */ | ^~ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/istream:40, from /usr/include/c++/14/fs...
s698142523
p01294
C++
Surface Area of Cubes
a.cc:1:1: error: 'Surface' does not name a type 1 | Surface Area of Cubes | ^~~~~~~
s311137690
p01294
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
s342042588
p01294
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const int INF = 1000000000; #define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++) #define rep(i,n) REP(i, 0, n) vector<int> m[100]; int N, D; int main(){ cin.tie(0); ios::sync_with_stdio(false); int _t, _s; while(cin >> N >> D && N)...
a.cc: In function 'int main()': a.cc:25:20: error: 'n' was not declared in this scope 25 | rep(i, n) | ^ a.cc:5:47: note: in definition of macro 'REP' 5 | #define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++) | ^ a.cc:25:13:...
s202471391
p01294
C++
include <bits/stdc++.h> using namespace std; typedef long long int ll; const int INF = 1000000000; #define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++) #define rep(i,n) REP(i, 0, n) int N, D; int main(){ cin.tie(0); ios::sync_with_stdio(false); ifstream ifs("2176_input.txt"); int _t, _s; while(cin ...
a.cc:1:1: error: 'include' does not name a type 1 | include <bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:9:5: error: 'cin' was not declared in this scope 9 | cin.tie(0); | ^~~ a.cc:10:5: error: 'ios' has not been declared 10 | ios::sync_with_stdio(false); | ...
s479661268
p01294
C++
import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { solver(); } static void solver() { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ int n = sc.nextInt(); int d = sc.nextInt(); if (n == 0 && d == 0) ...
a.cc:83:17: error: stray '@' in program 83 | @Override | ^ a.cc:1:1: error: 'import' does not name a type 1 | import java.util.ArrayList; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | i...
s418031089
p01294
C++
#include <stdio.h> #include <cmath> #include <algorithm> #include <cfloat> #include <stack> #include <queue> #include <vector> typedef long long int ll; typedef unsigned long long int ull; #define BIG_NUM 2000000000 #define MOD 1000000007 #define EPS 0.000000001 using namespace std; int** table; int** ruisekiwa; int N...
a.cc:17:18: warning: built-in function 'index' declared as non-function [-Wbuiltin-declaration-mismatch] 17 | int N,D,num[100],index[100],total[100]; | ^~~~~ a.cc: In function 'void func()': a.cc:51:120: error: invalid types 'int*[int [100]]' for array subscript 51 | ...
s572257657
p01294
C++
#include<iostream> #include<stack> using namespace std; #define REP(i, n) for(int i=0; i<n; i++) int INF = 10e8; int n, d; stack<int> st[1000]; int csum[1000]; int csort[1000]; void init(){ REP(i, n){ csort[i] = csum[i]; } } void sortcsort(){ sort(csort, csort+n, greater<int>()); } int main(){...
a.cc: In function 'void sortcsort()': a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'? 21 | sort(csort, csort+n, greater<int>()); | ^~~~ | short
s404992604
p01294
C++
#include <iostream> using namespace std; int main(){ int n, d; while(cin >> n >> d,n){ int acum[n][10000+1]; string ans = "Yes"; for(int i = 0; i < n; ++i) fill(acum[i],acum[i]+n,0); int m, N = 0, last_id[n]; for(int i = 0; i < n; ++i){ cin >> m; N += m; last_id[i] = m; f...
a.cc: In function 'int main()': a.cc:25:7: error: 'sort' was not declared in this scope; did you mean 'short'? 25 | sort(power,power+n,greater<int>()); | ^~~~ | short
s453360672
p01294
C++
#include<cstdio> #include<vector> #include<queue> #include<utility> using namespace std; typedef long long ll; typedef pair<long, pair<int, int> > P; int main(){ int n,d; while(scanf("%d%d", &n, &d) && n){ vector<ll> missile[n]; int m; ll min_ = LLONG_MAX, max_ = 0LL; bool ans...
a.cc: In function 'int main()': a.cc:16:19: error: 'LLONG_MAX' was not declared in this scope 16 | ll min_ = LLONG_MAX, max_ = 0LL; | ^~~~~~~~~ a.cc:5:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include<utilit...