submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s073558731
p00901
C++
#error "tsurai" #include <cstdio> #include <cstdint> #include <cassert> #include <cctype> #include <algorithm> #include <vector> #include <string> constexpr intmax_t MOD=2011; intmax_t apply(intmax_t lhs, char op, intmax_t rhs) { switch (op) { case '+': return (lhs + rhs) % MOD; case '-': return ((lhs - rhs) % ...
a.cc:1:2: error: #error "tsurai" 1 | #error "tsurai" | ^~~~~
s863258558
p00901
C++
#error "" #include <cstdio> #include <cstdint> #include <cassert> #include <cctype> #include <algorithm> #include <vector> #include <string> constexpr intmax_t MOD=2011; intmax_t apply(intmax_t lhs, char op, intmax_t rhs) { switch (op) { case '+': return (lhs + rhs) % MOD; case '-': return ((lhs - rhs) % MOD +...
a.cc:1:2: error: #error "" 1 | #error "" | ^~~~~ a.cc:145:229: error: stray '`' in program 145 | a.out: D.cpp:57: intmax_t parse(const std::__debug::vector<std::__cxx11::basic_string<char> >&, size_t&, size_t, size_t, size_t, size_t, size_t, size_t, const std::__debug::vector<std::__cxx11::basic_string<cha...
s986214926
p00901
C++
s[0]: LR[0, 23), TB[0, 4), base:1, prec:0 s[0]: LR[0, 23), TB[0, 4), base:1, prec:1 s[0]: LR[0, 23), TB[0, 4), base:1, prec:2 s[2]: LR[0, 23), TB[0, 4), base:1, prec:0 s[2]: LR[0, 23), TB[0, 4), base:1, prec:1 s[2]: LR[0, 23), TB[0, 4), base:1, prec:2 Returns 1 s[6]: LR[0, 23), TB[0, 4), base:1, prec:1 s[6]: LR[0, 23),...
a.cc:272:229: error: stray '`' in program 272 | a.out: D.cpp:78: intmax_t parse(const std::__debug::vector<std::__cxx11::basic_string<char> >&, size_t&, size_t, size_t, size_t, size_t, size_t, size_t, const std::__debug::vector<std::__cxx11::basic_string<char> >&): Assertion `false' failed. | ...
s389926300
p00902
C++
#include<iostream> #include<complex> #include<cmath> #include<vector> #include<iomanip> #include<set> using namespace std; typedef double elem; typedef complex<elem> point, vec; typedef pair<point,point> pp; const elem eps = 1e-8; const elem inf = 1e40; const elem pi = 2*acos(0.0); #define foreach(it,o) for(__typeof...
a.cc: In function 'int main()': a.cc:175:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 175 | sort(vc.begin(), vc.end(), cmp(calcCoG(vc))); | ^~~~ | sqrt a.cc:270:9: error: 'assert' was not declared in this scope 270 | assert(vcommon.size()>1); | ...
s126616793
p00902
C++
#include<iostream> #include<complex> #include<cmath> #include<vector> #include<iomanip> #include<set> #include<functional> #include<algorithm> #include<cstdlib> using namespace std; typedef double elem; typedef complex<elem> point, vec; typedef pair<point,point> pp; const elem eps = 1e-8; const elem inf = 1e40; cons...
a.cc: In function 'int main()': a.cc:274:9: error: 'assert' was not declared in this scope 274 | assert(vcommon.size()>1); | ^~~~~~ a.cc:10:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>' 9 | #include<cstdlib> +++ |+#include <cass...
s568870294
p00903
Java
import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; import java.util.Scanner; public class RoundTrip { public static void main(String[] args) { long cur = System.currentTimeMillis(); new RoundTrip().solver(); System.err.println(System.currentTimeMillis() - cur); } int[] e; i...
Main.java:6: error: class RoundTrip is public, should be declared in a file named RoundTrip.java public class RoundTrip { ^ 1 error
s382537942
p00903
Java
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; public class Main { public static void main(String[] args) { new RoundTrip().run(); } int[] e; int n; int...
Main.java:11: error: cannot find symbol new RoundTrip().run(); ^ symbol: class RoundTrip location: class Main 1 error
s452968526
p00903
Java
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; public class Main { public static void main(String[] args) { new RoundTrip().run(); } int[] e; int n; int...
Main.java:11: error: cannot find symbol new RoundTrip().run(); ^ symbol: class RoundTrip location: class Main 1 error
s820393812
p00903
Java
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; public class Main { public static void main(String[] args) { new RoundTrip().run(); } int[] e; int n; int...
Main.java:11: error: cannot find symbol new RoundTrip().run(); ^ symbol: class RoundTrip location: class Main 1 error
s847559269
p00903
C++
#include<iostream> #include<queue> using namespace std; struct edge{ int t,c,rev; }; bool u[52][52][1<<10]; struct S{ int c; char g,r,b; bool operator<(S s)const{ return c>s.c; }; }; int main(){ for(int n,m;cin>>n>>m,n|m;){ int d[52]={},e[52]; e[1]=0; e[n]=1000; int nalt[1234]={}; ...
a.cc: In function 'int main()': a.cc:49:25: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17 49 | if(u[c.g][c.r][c.b]++)continue; | ~~~~~~~~~~~~~~~^ a.cc:61:24: warning: narrowing conversion of 'f.edge::t' from 'int' to 'char' [-Wnarrowing] 61 | que.push({...
s820680443
p00903
C++
import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().solver(); } int[] e; int n; @SuppressWarnings("unchecked") void solver() { Scanner sc = new Scanner(System.in); while (tr...
a.cc:14:9: error: stray '@' in program 14 | @SuppressWarnings("unchecked") | ^ a.cc:121:17: error: stray '@' in program 121 | @Override | ^ a.cc:1:1: error: 'import' does not name a type 1 | import java.util.ArrayList; | ^~~~~~ a.cc:1:1: note: C...
s466220120
p00903
C++
import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().solver(); } int[] e; int n; @SuppressWarnings("unchecked") void solver() { Scanner sc = new Scanner(System.in); while (tr...
a.cc:14:9: error: stray '@' in program 14 | @SuppressWarnings("unchecked") | ^ a.cc:123:17: error: stray '@' in program 123 | @Override | ^ a.cc:1:1: error: 'import' does not name a type 1 | import java.util.ArrayList; | ^~~~~~ a.cc:1:1: note: C...
s301356650
p00903
C++
import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().solver(); } int[] e; int n; int[] shrink; @SuppressWarnings("unchecked") void solver() { Scanner sc = new Scanner(System.i...
a.cc:15:9: error: stray '@' in program 15 | @SuppressWarnings("unchecked") | ^ a.cc:155:17: error: stray '@' in program 155 | @Override | ^ a.cc:1:1: error: 'import' does not name a type 1 | import java.util.ArrayList; | ^~~~~~ a.cc:1:1: note: C...
s844479859
p00903
C++
#include<bits/stdc++.h> using namespace std; const int INF = (1<<29); typedef pair<int,int> P; struct edge{ int to,c; edge(int to=0,int c=0):to(to),c(c){} bool operator<(const edge& e) const { return c > e.c; } }; int N,M; int D[55],E[55],F[55]; bool used[55]; void dfs( int v, vector<vector<edge>> &G, vect...
a.cc: In function 'int dijk(int, int, const std::vector<int>&, std::vector<std::vector<edge> >&)': a.cc:63:1: warning: no return statement in function returning non-void [-Wreturn-type] 63 | } | ^ a.cc: In function 'int make_rot(const std::vector<int>&, std::vector<std::vector<edge> >&)': a.cc:73:1: warning: n...
s867044136
p00903
C++
#include<bits/stdc++.h> using namespace std; using Weight=int; const Weight INF=1e9; enum{SAME,ASC,DES}; struct Edge{ int to; Weight cost; int label; }; using Edges=vector<Edge>; using Graph=vector<Edges>; priority_queue<pair<Weight,int>,vector<pair<Weight,int>>,greater<>> que; vector<int> used(50*50*(1<<...
a.cc:18:42: error: wrong number of template arguments (1, should be 2) 18 | void dijkstra(int s,Graph& g,array<Weight> &d){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, fro...
s328844588
p00903
C++
#include<bits/stdc++.h> using namespace std; using Weight=int; const Weight INF=1e9; enum{SAME,ASC,DES}; struct Edge{ int to; Weight cost; }; struct Edge2{ int to; Weight cost; char label; }; using Edges=vector<Edge>; using Graph=vector<Edges>; using Edges2=vector<Edge2>; using Graph2=vector...
a.cc: In function 'Weight solve(int, int, std::vector<int>&, std::vector<int>&, const Graph2&)': a.cc:109:104: error: too many initializers for 'Edge' 109 | graph[vertex(i,j,l,n)].push_back(Edge{vertex(i,g[j][k].to,toMask,n),w,g[j][k].label}); | ...
s678474789
p00903
C++
#include<bits/stdc++.h> using namespace std; using Weight=int; const Weight INF=1e9; enum{SAME,ASC,DES}; struct Edge{ int to; Weight cost; }; struct Edge2{ int to; Weight cost; char label; }; using Edges=vector<Edge>; using Graph=array<Edges,50*50*(1<<10)>; using Edges2=vector<Edge2>; using ...
a.cc: In function 'Weight solve(int, int, std::vector<int>&, std::vector<int>&, const Graph2&)': a.cc:114:12: error: passing 'const Graph2' {aka 'const std::vector<std::vector<Edge2> >'} as 'this' argument discards qualifiers [-fpermissive] 114 | g.clear(); | ~~~~~~~^~ In file included from /usr/include...
s082227170
p00903
C++
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; class Edge { public: int src,dst,cst; Edge(int src, int dst, int cst) :src(src),dst(dst),cst(cst) {} }; class State { public: int g, b, c, v; State(int g, int b, int c, int v) :g(g),b(b),c(c),v(v) {} bool oper...
a.cc: In function 'int solve(Graph&, Graph&)': a.cc:38:9: error: 'memset' was not declared in this scope 38 | memset(vis, 0, sizeof(vis)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <algorithm> +...
s643305538
p00904
C
#include<bits/stdc++.h> using namespace std; using Int = long long; #define ll long long #define mp(a,b) make_pair<a, b> set<pair<ll, ll> > ss; ll gcd(ll a, ll b){ return a == 0 ? b : gcd(b % a, a); } bool pythago(ll c){ for(ll i = 2; i * i < k; i++){ ll j = k - i * i; ll ss = sqrt(j); if(j > 1 && j = ss * ss) ...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s553570396
p00904
C
#include<bits/stdc++.h> using namespace std; using Int = long long; #define ll long long #define mp(a,b) make_pair<a, b> set<pair<ll, ll> > ss; ll gcd(ll a, ll b){ return a == 0 ? b : gcd(b % a, a); } bool pythago(ll c){ for(ll i = 2; i * i < k; i++){ ll j = k - i * i; ll ss = sqrt(j); if(j > 1 && j = ss * ss) ...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s104780460
p00904
C++
import java.util.Arrays; import java.util.Scanner; public class Main { MyScanner sc = new MyScanner(); Scanner sc2 = new Scanner(System.in); long start = System.currentTimeMillis(); long fin = System.currentTimeMillis(); final int MOD = 1000000007; int[] dx = { 1, 0, 0, -1 }; int[] dy = { 0, 1, -1, 0 }; void...
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Arrays; | ^~~~~~ 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.Scanner; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-t...
s957965772
p00904
C++
#include<iostream> using namespace std;int x[1<<23],p,q,n,i,j; main(){ for(i=0;i<1000;i++){for(j=0;j<1000;j++){x[i*i+j*j]++;}} cin>>n;for(i=0;i<n;i++){cin>>p>>q;int r=p*p+q*q,s=0; for(j=1;j<=r;j++){ if(r%j==0){s+=x[i]*x[r/i];} } if(s==8){cout<<'P'<<endl;}else{cout<<'C'<<endl;} }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:10:2: error: expected '}' at end of input 10 | } | ^ a.cc:3:7: note: to match this '{' 3 | main(){ | ^
s042524349
p00904
C++
#include<bits/stdc++.h> using namespace std; int main(){ int q; cin>>q; while(q--){ int m,n,t,c=0; cin>>m>>n; t=m*m+n*n; for(int i=0;i<10000;i++) for(int j=0;j<10000;j++) if(i*i+j*j<1)continue; if((m*i+n*j)%(i*i+j*j)==0&&(m*j-n*i)%(i*i+j*j)==0)c++; if(c<=4)cout<<'P'<<end...
a.cc: In function 'int main()': a.cc:13:16: error: 'i' was not declared in this scope 13 | if((m*i+n*j)%(i*i+j*j)==0&&(m*j-n*i)%(i*i+j*j)==0)c++; | ^ a.cc:13:20: error: 'j' was not declared in this scope 13 | if((m*i+n*j)%(i*i+j*j)==0&&(m*j-n*i)%(i*i+j*j)==0)c++; | ...
s164196834
p00904
C++
#include<bits/stdc++.h> using namespace std; using Int = long long; #define ll long long #define mp(a,b) make_pair<a, b> set<pair<ll, ll> > ss; ll gcd(ll a, ll b){ return a == 0 ? b : gcd(b % a, a); } bool pythago(ll c){ for(ll i = 2; i * i < k; i++){ ll j = k - i * i; ll ss = sqrt(j); if(j > 1 && j = ss * ss) ...
a.cc:22:40: warning: missing terminating " character 22 | if(a * a + b * b <= 1) cout << "C << endl; | ^ a.cc:22:40: error: missing terminating " character 22 | if(a * a + b * b <= 1) cout << "C << endl; | ^~...
s615717137
p00904
C++
#include<bits/stdc++.h> using namespace std; using Int = long long; #define ll long long #define mp(a,b) make_pair<a, b> set<pair<ll, ll> > ss; ll gcd(ll a, ll b){ return a == 0 ? b : gcd(b % a, a); } bool pythago(ll c){ for(ll i = 2; i * i < k; i++){ ll j = k - i * i; ll ss = sqrt(j); if(j > 1 && j = ss * ss) ...
a.cc:22:40: warning: missing terminating " character 22 | if(a * a + b * b <= 1) cout << "C << endl; | ^ a.cc:22:40: error: missing terminating " character 22 | if(a * a + b * b <= 1) cout << "C << endl; | ^~...
s994420153
p00904
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main(void){ int t; cin >> t; while(t--){ int p,q,cnt=0; cin >> p >> q; for(int n=0;n*n<=tmp;n++){ for(int m=0;m*m<=tmp;m++){ if(m*m+n*n<1)continue; if((m*p+n*q)%(m*m+n*n)==0 && (m*q-n*p)%(m*m+n*...
a.cc: In function 'int main()': a.cc:16:22: error: 'tmp' was not declared in this scope; did you mean 'tm'? 16 | for(int n=0;n*n<=tmp;n++){ | ^~~ | tm
s608718001
p00905
C++
#include<iostream> int main(void){ cout << "Hello, Wolrd!" << endl; }
a.cc: In function 'int main()': a.cc:4:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 4 | cout << "Hello, Wolrd!" << endl; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream...
s367091617
p00905
C++
#include <vector> #include <list> #include <map> #include <set> #include <stack> #include <queue> #include <deque> #include <algorithm> #include <utility> #include <functional> #include <sstream> #include <iostream> #include <cstdio> #include <cmath> #include <cstdlib> #include <cctype> #include <string> #include <cstr...
a.cc: In function 'bool ok(vs&, int, int, int)': a.cc:40:13: error: expected unqualified-id before 'or' token 40 | int or=0,oc=0,os=0; | ^~ a.cc:51:32: error: expected primary-expression before 'or' token 51 | if(num_indent!=or*r+oc*c+os*s){ | ...
s081757896
p00906
Java
import java.util.Arrays; import java.util.Scanner; public class Main1327 { public static final void main(String[] args) { new Main1327(); } public Main1327() { Scanner sc = new Scanner(System.in); while(true){ int n = sc.nextInt(); int m = sc.nextInt(); int a = sc.nextInt(); int b = sc.nextInt(...
Main.java:5: error: class Main1327 is public, should be declared in a file named Main1327.java public class Main1327 { ^ 1 error
s941420142
p00906
C++
#include<cstdlib> #include<iostream> #include<cstdio> #include<algorithm> #include<vector> #include<queue> #include<set> #include<cstring> #include<cmath> using namespace std; const int MAXN = (int) 50 + 10; const int INF = (int) 0x3f3f3f3f; typedef long long LL; int M,N,A,B,C,T; int s[MAXN]; struct Matrix{ LL a[...
a.cc: In function 'Matrix Matrix_Multiply(const Matrix&, const Matrix&, int)': a.cc:33:32: error: no match for 'operator[]' (operand types are 'Matrix' and 'int') 33 | for(int j=1;j<=N;j++) c[i][j]%=MOD; | ^
s280576834
p00906
C++
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <sstream> #include <cstring> #include <cstdio> #include <cstdlib> #include <cmath> #include <queue> #include <stack> #include <map> #include <set> #include <numeric> #include <cctype> #include <cassert> // BEGIN CUT HERE #ifdef _MSC_...
a.cc: In function 'int main()': a.cc:88:39: error: cannot bind non-const lvalue reference of type 'std::vector<std::vector<int> >&' to an rvalue of type 'std::vector<std::vector<int> >' 88 | auto ans = mul(mod_pow(v, t), ss); | ~~~~~~~^~~~~~ a.cc:42:46: note: in...
s006378310
p00906
C++
// +------------------------- // | Matrix Library Ver.1.0 // | Date: 2016/03/01 // | Name: square1001 // | Required: // | #include <vector> // +------------------------- // ------ Required ------ // #include <vector> using namespace std; // ------ Matrix class ------ // class ModMatrix { public: // ------ Variable...
a.cc: In function 'int main()': a.cc:154:17: error: 'scanf' was not declared in this scope 154 | scanf("%d%d%d%d%d%d", &N, &M, &A, &B, &C, &T); | ^~~~~ a.cc:173:32: error: 'printf' was not declared in this scope 173 | if (i) printf(" "); | ...
s929750739
p00906
C++
#include <vector> #include <iostream> #pragma warning(disable : 4996) using namespace std; // ------ Matrix class ------ // class ModMatrix { public: // ------ Variables ------ // static const int mod2 = 1000000007; int r, c, mod; vector<vector<int> > mat; // ------ Constructor ------ // ModMatrix() : r(0), c(0), ...
a.cc: In function 'ModMatrix operator+(const ModMatrix&, const ModMatrix&)': a.cc:23:96: error: invalid use of non-static data member 'ModMatrix::mod' 23 | c.mat[i][j] = (c.mat[i][j] + b.mat[i][j]) % ModMatrix::mod; | ...
s643772884
p00906
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; typedef vector<int>vec; typedef vector<vec>mat; int n, m, a, b, c, t; mat mul(mat&a, mat&b) { mat c(a.size(), vec(b[0].size())); rep(i, a.size())rep(j, b[0].size())rep(k, b.size()) (c[i][j] += a[i][k] * b[k][j]) %= m; return c; } ...
a.cc: In function 'int main()': a.cc:33:29: error: cannot bind non-const lvalue reference of type 'mat&' {aka 'std::vector<std::vector<int> >&'} to an rvalue of type 'mat' {aka 'std::vector<std::vector<int> >'} 33 | A = mul(ppow(A, t), B); | ~~~~^~~~~~ a.cc:8:13: note: ...
s816493612
p00906
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; typedef vector<int>vec; typedef vector<vec>mat; int n, m, a, b, c, t; mat mul(mat&a, mat&b) { mat c(a.size(), vec(b[0].size())); rep(i, a.size())rep(j, b[0].size())rep(k, b.size()) (c[i][j] += a[i][k] * b[k][j]) %= m; return c; } ...
a.cc: In function 'int main()': a.cc:33:33: error: cannot bind non-const lvalue reference of type 'mat&' {aka 'std::vector<std::vector<int> >&'} to an rvalue of type 'mat' {aka 'std::vector<std::vector<int> >'} 33 | mat C = mul(ppow(A, t), B); | ~~~~^~~~~~ a.cc:8:13:...
s036196183
p00906
C++
#include <valarray> #include <cstdio> using namespace std; typedef valarray<int>V; int n,m; V s,z; V &Me(const V &_x,const V &_y){ int i=0,j; for(;i<n;i++)for(j=0;j<n;j++)z[i*n+j]=(_x[slice(i*n,n,1)]*_y[slice(j,n,n)]).sum()%m; return z; } V &Mx(const V &_x){ int i=0,j; for(;i<n;i++)for(j=0;j<n;j++)z[i*n+j]=(_x[sli...
a.cc:22:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 22 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:27:17: error: 'x' was not declared in this scope 27 | x.resize(0); | ^
s616941573
p00906
C++
#include <valarray> #include <cstdio> using namespace std; typedef valarray<int>V; int n,m; V z; V &Me(const V &_x,const V &_y){ int i=0,j; for(;i<n;i++)for(j=0;j<n;j++)z[i*n+j]=(_x[slice(i*n,n,1)]*_y[slice(j,n,n)]).sum()%m; return z; } V &Mx(const V &_x){ int i=0,j; for(;i<n;i++)for(j=0;j<n;j++)z[i*n+j]=(_x[slice...
a.cc: In function 'void O(const V&)': a.cc:19:52: error: 's' was not declared in this scope 19 | for(;i<n-1;i++)printf("%d ",(r[slice(i*n,n,1)]*s).sum()%m); | ^ a.cc:20:38: error: 's' was not declared in this scope 20 | printf("%d\n",(r[slice(i*n,n,...
s705641362
p00906
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) rep2(i,0,n) #define rep2(i,m,n) for(int i=(m);i<(n);i++) #define sz(x) ((x).size()) typedef vector<long long> vi; typedef vector<vi> mat; int N,M,A,B,C,T,S[55]; mat mul(mat& A,mat& B){ int n=sz(A); mat C(n,vi(n)); rep(i,n)rep(j,n){ rep(k,n)C[i][j]+...
a.cc: In function 'mat mul(mat&, mat&)': a.cc:18:26: error: 'MOD' was not declared in this scope 18 | C[i][j]%=MOD; | ^~~ a.cc: In function 'int main2()': a.cc:48:1: warning: no return statement in function returning non-void [-Wreturn-type] 48 | } | ^
s162810197
p00906
C++
#include <vector> #include <map> #include <set> #include <stack> #include <queue> #include <algorithm> #include <utility> #include <functional> #include <sstream> #include <iostream> #include <cstdio> #include <cmath> #include <cstdlib> #include <cctype> #include <string> #include <cstring> #include <ctime> #include <c...
a.cc: In function 'int main()': a.cc:83:34: error: cannot bind non-const lvalue reference of type 'vvi&' {aka 'std::vector<std::vector<int> >&'} to an rvalue of type 'vvi' {aka 'std::vector<std::vector<int> >'} 83 | vvi ans = mul(pow(mat, T, M), S, M); | ~~~^~~~~~~...
s349907421
p00907
C++
#include<bits/stdc++.h> using namespace std; double read[1100]; vector<int> re; void init(int d){ int tot=d+3; re.clear(); for(int i=0;i<(1<<tot);i++){ int tmp=0; for(int j=0;j<tot;j++){ if((i>>j)&1)tmp++; } if(1+d==tmp){ re.push_back(i); } ...
a.cc:4:17: error: 'double read [1100]' redeclared as different kind of entity 4 | double read[1100]; | ^ In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24, from /usr/include/signal.h:328, from /usr/include/c++/14/csignal:42, ...
s513216230
p00907
C++
#include <iostream> #include<cmath> using namespace std; int D; double V[16]; double interpolate(int n,int E){ double sum=0.0; for(int k=0;k<3+D;k++){ if(k==n||k==E)continue; double p=V[k]; for(int i=0;i<D+3;++i) { if(!(i==k||k==n||k==E)) p*=(n-i)/(do...
a.cc: In function 'int main()': a.cc:37:42: error: expected ';' before 'cout' 37 | if(outlier(i)){javascript:void(0) | ^ | ; 38 | cout<<i<<endl; | ~~~~
s484408063
p00907
C++
#include <iostream> #include <cmath> using namespace std; int D=1; double V[16]; //与えられた点のy座標が入っている double interpolate(int n, int E) { // 補間多項式 L(x) の x=n での値 L(n) を計算する // L(x) の作成において,点 (n,V[n]) と (E,V[E]) は使わない double sum = 0.0; for (int k=0; k<D+3; ++k) { if (k == n || k == E) continue; double p = V[k...
a.cc: In function 'int main()': a.cc:44:57: error: expected primary-expression before '<<' token 44 | cout << /*"error is " */<< i << endl; | ^~
s900898948
p00907
C++
#include <stdio.h> #include <math.h> #include <vector> #define EPS 1e-3 #define REP(i,n) for(int i = 0; i < (n); i++) using namespace std; //FILE *in = freopen("input.txt", "r", stdin); //FILE *out = freopen("output.txt", "w", stdout); int n; long double data[10]; void input() { for(int i = 0; i < n + 3; i++) { ...
a.cc: In function 'void input()': a.cc:18:31: error: reference to 'data' is ambiguous 18 | scanf("%Lf", &data[i]); | ^~~~ In file included from /usr/include/c++/14/vector:69, from a.cc:3: /usr/include/c++/14/bits/range_access.h:344:5: note: candida...
s471395619
p00907
C++
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <vector> #include <iostream> using namespace std; const double eps = 1e-8; const int maxn = 100 + 10; typedef double Matrix[maxn][maxn]; // 逕ア莠取悽鬚倡噪迚ケ谿頑??梧カ亥?蜷惹ク堺ク?ョ壽弍蟇ケ隗帝亰?檎爆閾ウ荳堺ク?ョ壽弍髦カ譴ッ髦オ // 菴?凶x[i]隗」諠滉ク?ク疲怏髯撰シ檎ャャi陦碁勁莠?[i][i]蜥窟[i][...
a.cc: In function 'int main()': a.cc:109:2: error: expected '}' at end of input 109 | } | ^ a.cc:40:1: note: to match this '{' 40 | { | ^
s638130173
p00907
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <cstring> using namespace std; const double eps = 1e-8; const int maxn = 100 + 10; typedef double Matrix[maxn][maxn]; // 逕ア莠取悽鬚倡噪迚ケ谿頑??梧カ亥?蜷惹ク堺ク?ョ壽弍蟇ケ隗帝亰?檎爆閾ウ荳堺ク?ョ壽弍髦カ譴ッ髦オ // 菴?凶x[i]隗」諠滉ク?ク疲怏髯撰シ檎ャャi陦碁勁莠?[i][i]蜥窟[i][n]荵句、也噪蜈カ莉門?邏?插荳コ0...
a.cc: In function 'int main()': a.cc:107:2: error: expected '}' at end of input 107 | } | ^ a.cc:38:1: note: to match this '{' 38 | { | ^
s129128723
p00907
C++
//Name: Find the Outlier //Level: //Category: //Note: /** */ #include <iostream> #include <vector> #include <string> #include <array> using namespace std; bool solve() { int N; cin >> N; if(!N) return false; vector<double> ys(N+3); for(int i = 0; i < N+3; ++i) { cin >> ys[i]; } ...
a.cc: In function 'bool solve()': a.cc:39:12: error: 'fabs' was not declared in this scope; did you mean 'labs'? 39 | if(fabs(c - ys[CHECKER]) < 0.9) { | ^~~~ | labs
s982207207
p00908
C++
#include <cstdio> #include <cstring> #include <iostream> #include <utility> #include <queue> #include <string> #define INF 1e7 using namespace std; typedef pair<int,int> P; int dx[4]={1,0,-1,0}; int dy[4]={0,1,0,-1}; int ddx[4][2]={ 2,2, 0,1, -1,-1, 0,1 }; int ddy[4][2]={ 0,1, 2,2, 0,1, -1,-1 }; P add(P p1,P p2...
a.cc: In function 'P add(P, P)': a.cc:26:12: error: 'P' {aka 'struct std::pair<int, int>'} has no member named 'x' 26 | p3.x= | ^ a.cc:27:9: error: expected primary-expression before 'return' 27 | return P(p1.first+p2.first,p1.second+p2.second); | ^~~~~~ a.cc:28:1: w...
s942578691
p00908
C++
#include "bits/stdc++.h" using namespace std; const int dx[4] = { -1,0,1,0 }; const int dy[4] = { 0,1,0,-1 }; const int dx2[4] = { -1,0,2,1 }; const int dy2[4] = { 0,2,1,-1 }; struct aa { int x; int y; int turn; }; int getdis(const vector<vector<int>>&field, const int fx, const int fy,const int gx,const int gy) { ...
a.cc: In function 'int main()': a.cc:183:34: error: expected ')' before '}' token 183 | } | ^ | ) 184 | } | ~ a.cc:182:57: note: to match this ...
s362552641
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] w; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int a, int ...
Main.java:45: error: ';' expected w = new int[N] ^ Main.java:67: error: invalid method declaration; return type required public static Solve(){ ^ 2 errors
s892360841
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] w; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int a, int ...
Main.java:17: error: array required, but int found w -= w[b] - w[a]; ^ Main.java:17: error: array required, but int found w -= w[b] - w[a]; ^ Main.java:24: error: array required, but int found w[j] = w; ^ Main.java:27: error: cannot find symbol w[x] = -w; ^ symbol: vari...
s534977362
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] w; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int a, int ...
Main.java:17: error: array required, but int found w -= w[b] - w[a]; ^ Main.java:17: error: array required, but int found w -= w[b] - w[a]; ^ Main.java:24: error: array required, but int found w[j] = w; ^ Main.java:27: error: cannot find symbol w[x] = -w; ^ symbol: vari...
s436885566
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] w; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int a, int ...
Main.java:17: error: array required, but int found w -= w[b] - w[a]; ^ Main.java:17: error: array required, but int found w -= w[b] - w[a]; ^ Main.java:24: error: array required, but int found w[j] = w; ^ Main.java:27: error: array required, but int found w[i] = -w; ^ Main.j...
s830639499
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] w; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int a, int ...
Main.java:17: error: array required, but int found w -= w[b] - w[a]; ^ Main.java:17: error: array required, but int found w -= w[b] - w[a]; ^ Main.java:24: error: array required, but int found w[j] = w; ^ Main.java:27: error: array required, but int found w[i] = -w; ^ Main.j...
s205268702
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] w; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int a, int ...
Main.java:23: error: array required, but int found w[j] = w; ^ Main.java:26: error: array required, but int found w[i] = -w; ^ Main.java:71: error: cannot find symbol if(same(a,b)==false){ ^ symbol: variable a location: class Main Main.java:71: error: cannot find symbol ...
s800419781
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] w; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int a, int ...
Main.java:71: error: cannot find symbol if(same(a,b)==false){ ^ symbol: variable a location: class Main Main.java:71: error: cannot find symbol if(same(a,b)==false){ ^ symbol: variable b location: class Main Main.java:74: error: cannot find symbol System.out.prin...
s917487125
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] w; public static boolean same(int a, int b) { return findSet(a) == findSet(b); } public static void unite(int a, int ...
Main.java:83: error: unnamed classes are a preview feature and are disabled by default. public static int findSet(int i) { ^ (use --enable-preview to enable unnamed classes) Main.java:130: error: class, interface, enum, or record expected } ^ 2 errors
s192045879
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] w; public static boolean same(int a, int b) { return findSet(a) == findSet(b); } public static void unite(int a, int ...
Main.java:83: error: unnamed classes are a preview feature and are disabled by default. public static int findSet(int i) { ^ (use --enable-preview to enable unnamed classes) Main.java:130: error: class, interface, enum, or record expected } ^ 2 errors
s535905265
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] w; public static boolean same(int a, int b) { return findSet(a) == findSet(b); } public static void unite(int a, i...
Main.java:84: error: unnamed classes are a preview feature and are disabled by default. public static int findSet(int i) { ^ (use --enable-preview to enable unnamed classes) Main.java:131: error: class, interface, enum, or record expected } ^ 2 errors
s827857264
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] w; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int a, i...
Main.java:84: error: unnamed classes are a preview feature and are disabled by default. public static int findSet(int i) { ^ (use --enable-preview to enable unnamed classes) Main.java:131: error: class, interface, enum, or record expected } ^ 2 errors
s888031536
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:45: error: ';' expected weight = new int[N] ^ Main.java:86: error: class, interface, enum, or record expected } ^ 2 errors
s193524869
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:45: error: ';' expected weight = new int[N] ^ Main.java:86: error: class, interface, enum, or record expected } ^ 2 errors
s798641190
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:17: error: cannot find symbol w -= weight[b] - weight[a]; ^ symbol: variable b location: class Main Main.java:17: error: cannot find symbol w -= weight[b] - weight[a]; ^ symbol: variable a location: class Main Main.java:76: error:...
s579765400
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:76: error: cannot find symbol if(same(x, y)){ ^ symbol: variable x location: class Main Main.java:76: error: cannot find symbol if(same(x, y)){ ^ symbol: variable y location: class Main Main.java:79: error: cannot find ...
s395272208
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:76: error: cannot find symbol if(same(x, y)){ ^ symbol: variable x location: class Main Main.java:76: error: cannot find symbol if(same(x, y)){ ^ symbol: variable y location: class Main Main.java:79: error: cannot find ...
s736844530
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:76: error: cannot find symbol if(same(a, b)){ ^ symbol: variable a location: class Main Main.java:76: error: cannot find symbol if(same(a, b)){ ^ symbol: variable b location: class Main Main.java:77: error: cannot find ...
s460670579
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:76: error: cannot find symbol if(same(a,b)){ ^ symbol: variable a location: class Main Main.java:76: error: cannot find symbol if(same(a,b)){ ^ symbol: variable b location: class Main Main.java:77: error: cannot find sym...
s772550859
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:76: error: cannot find symbol if(same(a,b)){ ^ symbol: variable a location: class Main Main.java:76: error: cannot find symbol if(same(a,b)){ ^ symbol: variable b location: class Main Main.java:77: error: cannot find sym...
s372644446
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int a, int b) { return findSet(a) == findSet(b); } public static void unite(int x, ...
Main.java:76: error: cannot find symbol if(same(a,b)){ ^ symbol: variable a location: class Main Main.java:76: error: cannot find symbol if(same(a,b)){ ^ symbol: variable b location: class Main Main.java:77: error: cannot find sym...
s236950019
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:76: error: cannot find symbol if(same(a,b)){ ^ symbol: variable a location: class Main Main.java:76: error: cannot find symbol if(same(a,b)){ ^ symbol: variable b location: class Main Main.java:77: error: cannot find sym...
s152551088
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:85: error: class, interface, enum, or record expected } ^ 1 error
s936416898
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:75: error: cannot find symbol }else if(same(a,b)){ ^ symbol: variable a location: class Main Main.java:75: error: cannot find symbol }else if(same(a,b)){ ^ symbol: variable b location: class Main Main.java:76: error: can...
s352869085
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x, ...
Main.java:76: error: cannot find symbol if(same(a,b)){ ^ symbol: variable a location: class Main Main.java:76: error: cannot find symbol if(same(a,b)){ ^ symbol: variable b location: class Main Main.java:77: error: cannot find sym...
s446161184
p00909
Java
import java.util.Scanner; public class ouyou2 { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(int x...
Main.java:3: error: class ouyou2 is public, should be declared in a file named ouyou2.java public class ouyou2 { ^ 1 error
s979194850
p00909
Java
import java.util.Scanner; public class saisyu2 { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(i...
Main.java:3: error: class saisyu2 is public, should be declared in a file named saisyu2.java public class saisyu2 { ^ 1 error
s552425686
p00909
Java
import java.util.Scanner; public class saisyu2 { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(i...
Main.java:3: error: class saisyu2 is public, should be declared in a file named saisyu2.java public class saisyu2 { ^ 1 error
s355248674
p00909
Java
import java.util.Scanner; public class Main { public static int N; public static int M; public static int[] p; public static int[] rank; public static int[] weight; public static boolean same(int x, int y) { return findSet(x) == findSet(y); } public static void unite(i...
Main.java:40: error: unreachable statement return p[i] = findSet(p[i]);; ^ 1 error
s318992354
p00909
C
#include <map> #include <set> #include <queue> #include <stack> #include <cmath> #include <string> #include <cctype> #include <vector> #include <cstdio> #include <climits> #include <cstdlib> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef long long LL; LL a[110000]; int f[110...
main.c:1:10: fatal error: map: No such file or directory 1 | #include <map> | ^~~~~ compilation terminated.
s263325273
p00909
C++
#include<bits/stdc++.h> #define f first #define s second #define mp make_pair #define inf 1<<30 #define MAX 1000010 using namespace std; long long p[MAX],w[MAX]; pair<int,int> find(int a){ pair<int,int> pii; if(p[a]==a){ pii.f=a;pii.s=0; return pii; } pii=find(p[a]); pii.s+=w[a]; p[a]=pii.f; w[a...
a.cc: In function 'int main()': a.cc:34:5: error: 'M' was not declared in this scope 34 | M.clear(); | ^
s388968075
p00909
C++
#include<iostream> #include<vector> #include<string> #include<stdio.h> using namespace std; int weight[100000]; class DisjointSet{ public: int rank[100000],p[100000]; DisjointSet(){} DisjointSet(int size){ rank.resize(size,0); p.resize(size,0); for(int i=0;i<size;i++){ makeSet(i); weigh...
a.cc: In constructor 'DisjointSet::DisjointSet(int)': a.cc:15:10: error: request for member 'resize' in '((DisjointSet*)this)->DisjointSet::rank', which is of non-class type 'int [100000]' 15 | rank.resize(size,0); | ^~~~~~ a.cc:16:7: error: request for member 'resize' in '((DisjointSet*)this)->Di...
s169360784
p00909
C++
#include<iostream> #include<vector> #include<string> #include<stdio.h> using namespace std; int p[100000]; int rank[100000]; int weight[100000]; void makeSet(int x){ p[x]=x; rank[x]=0; weight[x]=0; } bool same(int x,int y){ return findSet(x)==findSet(y); } void unite(int x,int y,int w){ ...
a.cc: In function 'void makeSet(int)': a.cc:13:5: error: reference to 'rank' is ambiguous 13 | rank[x]=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, ...
s144995355
p00909
C++
#include<iostream> #include<vector> #include<string> #include<stdio.h> using namespace std; int p[100000]; int rank[100000]; int weight[100000]; void makeSet(int x){ p[x]=x; rank[x]=0; weight[x]=0; } int findSet(int x){ if(x==p[x]){ return x; }else{ return findSet(p[x]); } }...
a.cc: In function 'void makeSet(int)': a.cc:13:5: error: reference to 'rank' is ambiguous 13 | rank[x]=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, ...
s710762525
p00909
C++
return ret; } int find(int u) { if(node[u] < 0) return u; int val = get_weight(node[u]); weight[u] += val; return node[u] = find(node[u]); } }; int main() { int N, M; while(cin >> N >> M, N) { UnionFind uf; for(int i=0; i<M; i++) { char c...
a.cc:1:9: error: expected unqualified-id before 'return' 1 | return ret; | ^~~~~~ a.cc:2:5: error: expected declaration before '}' token 2 | } | ^ a.cc: In function 'int find(int)': a.cc:5:10: error: 'node' was not declared in this scope 5 | if(node[u] < 0) return u...
s916814699
p00909
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const int S = 100010; struct UnionFind { vector<int> node; vector<ll> weight; UnionFind() : node(S, -1), weight(S, 0) {} void unite(int u, int v, ll w) { int ov = v, ou = u; u = find(u), v = find(v); int wa = weight[ov], wb = w...
a.cc: In function 'int main()': a.cc:46:22: error: 'struct UnionFind' has no member named 'get_weight'; did you mean 'weight'? 46 | ll wa = uf.get_weight(a); | ^~~~~~~~~~ | weight a.cc:47:22: error: 'struct UnionFind' has no member named 'get_weight'; d...
s055207423
p00909
C++
#include<iostream> using namespace std; int parent[1<<17],rank[1<<17],weight[1<<17]; int root(int x) { if(parent[x]==x)return x; else { int r=root(parent[x]); weight[x]+=weight[parent[x]]; return parent[x]=r; } } int get_weight(int x) { root(x); return weight[x]; } bool issame(int x,int y) { return root(x)...
a.cc: In function 'void merge(int, int, int)': a.cc:35:12: error: reference to 'rank' is ambiguous 35 | if(rank[x]<rank[y])swap(x,y),w*=-1; | ^~~~ In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, fro...
s339553581
p00909
C++
#include<iostream> #include<cstdio> #include<bitset> #include<algorithm> using namespace std; class union_find{ private: vector<int> parents; vector<int> rank; vector<int> weight; public: union_find(int n){ for(int i=0;i<n;i++){ parents.push_back(i); rank.push_back(0); weight.push_back(0); } } int f...
a.cc:9:9: error: 'vector' does not name a type 9 | vector<int> parents; | ^~~~~~ a.cc:10:9: error: 'vector' does not name a type 10 | vector<int> rank; | ^~~~~~ a.cc:11:9: error: 'vector' does not name a type 11 | vector<int> weight; | ^~~~~~ a...
s566753170
p00909
C++
#include<iostream> #include<cstdio> #include<bitset> #include<algorithm> #include<vector> using namespace std; class union_find{ private: vector<int> parents; vector<int> weight; public: union_find(int n){ for(int i=0;i<n;i++){ parents.push_back(i); rank.push_back(0); weight.push_back(0); } } int fin...
a.cc: In constructor 'union_find::union_find(int)': a.cc:16:29: error: expected unqualified-id before '.' token 16 | rank.push_back(0); | ^
s405619489
p00909
C++
#include <stdio.h> #include <vector> #include <queue> #include <algorithm> using namespace std; //FILE *in = freopen("input.txt", "r", stdin); //FILE *out = freopen("output.txt", "w", stdout); int n, m; struct UnionFind { vector<int> par; vector<int> rank; UnionFind(int n){ par = vector<int>(n); rank = vector...
a.cc: In function 'int bfs(std::vector<std::vector<std::pair<int, int> > >, int, int)': a.cc:44:9: error: 'memset' was not declared in this scope 44 | memset(chk, 0, sizeof(chk)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <c...
s001454084
p00909
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; const int MAX = 100005; class UnionFind{ public: int par[MAX]; int rank[MAX]; 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 x; el...
a.cc: In function 'void init()': a.cc:50:3: error: 'memset' was not declared in this scope 50 | memset(used,false,sizeof(used)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<algorithm> +++ |+#include <cstring>...
s949249605
p00910
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107...
a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 1 | ^ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a...
s016560132
p00910
C++
#include <bits/stdc++.h> using namespace std; #define EPS (1e-9) struct Point3D { double x, y, z; Point3D(){} Point3D(double x, double y, double z) : x(x), y(y), z(z) {} Point3D operator + (const Point3D &p) const { return Point3D(x + p.x, y + p.y, z + p.z); } Point3D operator - (const Point3D ...
a.cc: In function 'void merge(std::unordered_set<int>&, std::unordered_set<int>&)': a.cc:124:39: error: conversion from 'std::unordered_set<int>::iterator' {aka 'std::__detail::_Insert_base<int, int, std::allocator<int>, std::__detail::_Identity, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, st...
s354265503
p00910
C++
#include<bits/stdc++.h> using namespace std; #define r(i,n) for(int i=0;i<n;i++) constexpr double EPS = 1e-10; constexpr double INF = 1LL << 55; constexpr double PI = acos(-1); #define equals(a, b) (fabs(a - b) < EPS) #define lt(a, b) (a - b < -EPS) #define le(a, b) (lt(a, b) || equals(a, b)) struct Point3D { doubl...
a.cc:84:44: error: macro "r" requires 2 arguments, but only 1 given 84 | Sphere(Point3D p, double r) : p(p), r(r) {} | ^ a.cc:3:9: note: macro "r" defined here 3 | #define r(i,n) for(int i=0;i<n;i++) | ^ a.cc: In constructor 'Sphere::Sphere(Point...
s264452411
p00910
C++
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <queue> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
a.cc: In function 'bool intersect(point, point, point)': a.cc:107:35: error: cannot bind non-const lvalue reference of type 'point&' to an rvalue of type 'point' 107 | point Q=add(a,mult(ab, -t)); | ~~~~^~~~~~~~ a.cc:76:36: note: initializing argument 2 of 'point ...
s042930813
p00910
C++
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <queue> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
a.cc: In function 'bool intersect(point&, point&, point&)': a.cc:107:35: error: cannot bind non-const lvalue reference of type 'point&' to an rvalue of type 'point' 107 | point Q=add(a,mult(ab, -t)); | ~~~~^~~~~~~~ a.cc:76:36: note: initializing argument 2 of 'poi...
s455294830
p00912
C++
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int n,w, len[51111],psum[51111]; struct SegTree{ int n, seg[401111]; void init(int _n){ n=_n; memset(seg,0,sizeof(seg)); } void set(int i, int x){ // printf("[%d] = %d\n",i,x); set(i,x,0,n,0); } int qmax(int l, int r){ // pr...
a.cc: In member function 'void SegTree::init(int)': a.cc:10:17: error: 'memset' was not declared in this scope 10 | memset(seg,0,sizeof(seg)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #inc...
s387651234
p00914
Java
import java.util.Arrays; import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); int n, k, s, cnt, use_cnt; void run() { for (;;) { n = sc.nextInt(); // less than or equal n k = sc.nextInt(); // num of elements s = sc.nextInt(); // sum of integer if ((n | k | s) == 0) { ...
Main.java:39: error: cannot find symbol new AOJ_1335().run(); ^ symbol: class AOJ_1335 location: class Main 1 error
s470935796
p00914
Java
import java.util.Arrays; import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); int n, k, s, cnt, use_cnt; void run() { for (;;) { n = sc.nextInt(); // less than or equal n k = sc.nextInt(); // num of elements s = sc.nextInt(); // sum of integer if ((n | k | s) == 0) { ...
Main.java:39: error: cannot find symbol new Main.run(); ^ symbol: class run location: class Main 1 error
s267305294
p00914
C
#include<stdio.h> #include<stdlib.h> int N,K,S; int dfs(int d,int n,int s) { int i,r=0; if(d==K&&n==0) return 1; if(s>N||d>=K)return 0; for(i=s;i<=N;i++) { dbg[d]=i; r+=dfs(d+1,n-i,i+1); } return r; } int main() { for(;scanf("%d%d%d",&N,&K,&S),N;) { printf("%d\n",dfs(0,S,1)); } return 0; }
main.c: In function 'dfs': main.c:13:17: error: 'dbg' undeclared (first use in this function) 13 | dbg[d]=i; | ^~~ main.c:13:17: note: each undeclared identifier is reported only once for each function it appears in
s347570632
p00914
C
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int ans,n,k,s; int used[21]; void dfs(int d,int sum,int t){ if(sum==s&&d==0){ans++;return;} else if(d==0) return ; for(int i=t+1;i<=n;i++){ if(!used[i]){ used[i]=1; dfs(d-1,sum+...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s431840015
p00914
C
#include<stdio.h> int main(){ int q,w,e,r,t,y; int i,j,k; int dp[21][11][156]; dp[0][0][0] = 1; for(i = 1;i < 21;i++){ dp[i][0][0]=1; for(j = 1;j < 11;j++){ for(k = 1;k < 156;k++){ dp[i][j][k] = (n<=s ? dp[i-1][j-1][k-i] : 0) + dp[i-1][j][k]; }}} while(scanf("%d%d%d",&q,&w,&e),q){ printf("%d\n"...
main.c: In function 'main': main.c:14:20: error: 'n' undeclared (first use in this function) 14 | dp[i][j][k] = (n<=s ? dp[i-1][j-1][k-i] : 0) + dp[i-1][j][k]; | ^ main.c:14:20: note: each undeclared identifier is reported only once for each function it appears in main.c:14:23: error: 's...
s624537963
p00914
C++
#include <cstdio> #include <iostream> using namespace std; long dp[25][200][30]; //dp[何個目まで足したか][残ってる数] int n, k; long rec(int a, int b, int c){ //a番目,残りb,前に足した数c if(dp[a][b][c]>=0) return dp[a][b][c]; long ret=0; if(a==k && b>=0){ if(b==0) ret=1; else ret=0; } else if(b<0) ret=0; else{ for(int i=c-1; ...
a.cc: In function 'int main()': a.cc:31:17: error: 'memset' was not declared in this scope 31 | memset(dp, -1, sizeof(dp)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <iostream> +...