submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s764935737
p00440
C++
#include<iostream> #include<cstdio> #include<string> #include<vector> #include<algorithm> using namespace std; typedef long long int ll; int x=1; int main() { while(x!=0){ int n,k,a[10^5]; cin >> n >> k; if(n==0&&k==0)return 0; for(int i=0;i<n;i++){ cin >> a[i]; a[i]=a[i]-i; } sort(a,a+n); int b[10^5+2];...
a.cc: In function 'int main()': a.cc:12:17: warning: result of '10^5' is 15; did you mean '1e5'? [-Wxor-used-as-pow] 12 | int n,k,a[10^5]; | ^ | --- | 1e a.cc:12:15: note: you can silence this warning by using a hexadecimal constant (0xa rather than 1...
s624957548
p00440
C++
#include "stdio.h" #include <queue> using namespace std; int main() { int n,k; scanf("%d %d",&n,&k); priority_queue q; for(int i = 0; i < k; i++) { int w; scanf("%d",&w); q.push(w); } int dp[2] = {0,0}; int flg = 0; int max = 0; if(q.top() == 0) { flg = 1; q.pop(); } for(int i = 0; i < n; i++) ...
a.cc:61:12: error: extended character   is not valid in an identifier 61 | if(max < dp[0]) | ^ a.cc: In function 'int main()': a.cc:10:17: error: class template argument deduction failed: 10 | priority_queue q; | ^ a.cc:10:17: error: no matching function for call to 'pri...
s224258063
p00440
C++
#include "stdio.h" #include <queue> using namespace std; int main() { int n,k; scanf("%d %d",&n,&k); priority_queue<int> q; for(int i = 0; i < k; i++) { int w; scanf("%d",&w); q.push(w); } int dp[2] = {0,0}; int flg = 0; int max = 0; if(q.top() == 0) { flg = 1; q.pop(); } for(int i = 0; i < n; ...
a.cc:61:12: error: extended character   is not valid in an identifier 61 | if(max < dp[0]) | ^ a.cc: In function 'int main()': a.cc:61:12: error: '\U00003000dp' was not declared in this scope 61 | if(max < dp[0]) | ^~~~
s234856570
p00440
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; int main(){ while(1){ int ans=0,p=0,n,k,x,a[100001]={},flag=0,sflag=0; vector<int> V; cin>>n>>k; if(n==0 && k==0) break; for(int i=0;i<k;i++){ cin>>x; if(x==0) flag=1; a[x]=1; } for(int i=1;i<=n;i++){ if(sflag=...
a.cc: In function 'int main()': a.cc:39:21: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<' 39 | endl<<ans<<endl; | ~~~~^~~~~
s316071255
p00440
C++
#include <cstdio> #include <algorithm> #include <vector> using namespace std; #define MAX 100000 int main(){ int N, K, in; while(scanf("%d%d" ,&N ,&K), (N | K)){ bool found = false, used[MAX+2]; vector<int> vec; int start = MAX; memset(used,false,sizeof(used)); for(int i = 0 ; i < K ; i++)...
a.cc: In function 'int main()': a.cc:17:5: error: 'memset' was not declared in this scope 17 | 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 <vector> +++ |+#include <cstring...
s317804137
p00441
C
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct pole{ struct pole* next; int y; } Pole; Pole* table[5001]; int search(int x,int y) { if(x < 0 || y < 0)return 0; if(table[x] != NULL) { Pole* pt = table[x]; while(pt->next != NULL) { if(pt->y == y) return 1; pt = pt->next;...
main.c: In function 'main': main.c:90:33: error: 'else' without a previous 'if' 90 | else if(search(posx[4],posy[4]) && search(posx[5],posy[5])) | ^~~~ main.c:90:48: error: 'posx' undeclared (first use in this function) 90 | ...
s556410699
p00441
C++
#include<iostream> #include<cstdio> #include<fstream> using namespace std; int main() { int n,x[3000],y[3000]; bool f[5001][5001]; while(true){ int ans=0; cin >> n; if(n==0)return 0; memset(f,false,sizeof(f)); for(int i=0;i<n;i++){ cin >> x[i] >> y[i]; f[x[i]][y[i]]=true; } for(int i=0;i<n;i++){ ...
a.cc: In function 'int main()': a.cc:13:17: error: 'memset' was not declared in this scope 13 | memset(f,false,sizeof(f)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<fstream> +++ ...
s735154244
p00441
C++
#include<iostream> #include<algorithm> using namespace std; int grid[6000][6000]; struct cord{ int x,y; cord operator+(const cord& a)const{ cord res; res.x=a.x+x; res.y=a.y+y; return res; } cord operator-(const cord& a)const{ cord res; res.x=a.x-x; res.y=a.y-y; return res; } ...
a.cc: In function 'int main()': a.cc:37:5: error: 'memset' was not declared in this scope 37 | memset(grid,0,sizeof(grid)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorithm> +++ |+#include <cstring> ...
s412184301
p00441
C++
#include<iostream> #include<algorithm> using namespace std; int grid[6000][6000]; struct cord{ int x,y; cord operator+(const cord& a)const{ cord res; res.x=a.x+x; res.y=a.y+y; return res; } cord operator-(const cord& a)const{ cord res; res.x=a.x-x; res.y=a.y-y; return res; } ...
a.cc: In function 'int main()': a.cc:37:5: error: 'memset' was not declared in this scope 37 | memset(grid,0,sizeof(grid)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorithm> +++ |+#include <cstring> ...
s353846041
p00441
C++
#include<iostream> #include<algorithm> #include<utility> using namespace std; int grid[6000][6000]; struct cord{ int x,y; cord operator+(const cord& a)const{ cord res; res.x=a.x+x; res.y=a.y+y; return res; } cord operator-(const cord& a)const{ cord res; res.x=a.x-x; res.y=a.y-y; ...
a.cc: In function 'int main()': a.cc:38:5: error: 'memset' was not declared in this scope 38 | memset(grid,0,sizeof(grid)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<utility> +++ |+#include <cstring> ...
s714199198
p00441
C++
#include<iostream> #include<string> #include<algorithm> #include<map> #include<set> #include<utility> #include<vector> #include<cmath> #include<cstdio> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define rp(a) while(a--) #define pb push_back #define mp make_pair #define all(in) in.begin(),in....
a.cc: In function 'int main()': a.cc:32:17: error: 'memset' was not declared in this scope 32 | memset(in,0,sizeof(in)); | ^~~~~~ a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 9 | #include<cstdio> +++ |+...
s422691761
p00441
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int N; int X[3000], Y[3000]; bool F[5001][5001]; int solve(int P, int Q){ int xp = X[P]; int yp = Y[P]; int xq = X[Q]; int yq = Y[Q]; int xs = xp + (yp - yq); int ys = yp + (xq - xp); int xr = xq + (yp - yq); int yr = yq + (xq - xp); ...
a.cc: In function 'int main()': a.cc:28:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 28 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s369573415
p00441
C++
#include <iostream> #include <string> #include <vector> #include <cstring> #include <climits> #include <algorithm> #include <map> using namespace std; #define x first #define y second int main() { int n; while (cin >> n, n) { map<int, bool> has; vector<pair<int,int> > co(n); for (int ...
a.cc: In function 'int main()': a.cc:11:11: error: 'first' was not declared in this scope 11 | #define x first | ^~~~~ a.cc:21:17: note: in expansion of macro 'x' 21 | has[x+10000*y] = true; | ^ a.cc:12:11: error: 'second' was not declared in this scope 12 | #d...
s569443045
p00441
C++
#include <bits/stdc++.h> #define FOR(i,n) for(int i=0;i<(int)(n);i++) #define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++) #define pb(a) push_back(a) #define mp(x,y) make_pair(x,y) #define ZERO(a) memset(a,0,sizeof(a)) #define len(a) sizeof(a) #define ll long long #define pii pair<int,int> #define INF 1<<29 #define M...
a.cc:11:16: error: expected ']' before ';' token 11 | #define MAX 511; | ^ a.cc:14:7: note: in expansion of macro 'MAX' 14 | int x[MAX],y[MAX]; | ^~~ a.cc:14:10: error: expected unqualified-id before ']' token 14 | int x[MAX],y[MAX]; | ^ a.cc:14:17: error: expect...
s431431615
p00441
C++
#include <bits/stdc++.h> #define FOR(i,n) for(int i=0;i<(int)(n);i++) #define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++) #define pb(a) push_back(a) #define mp(a,b) make_pair(a,b) #define ZERO(a) memset(a,0,sizeof(a)) #define len(a) sizeof(a) #define ll long long #define pii pair<int,int> #define INF 1<<29 #define M...
a.cc:11:16: error: expected ']' before ';' token 11 | #define MAX 511; | ^ a.cc:14:7: note: in expansion of macro 'MAX' 14 | int x[MAX],y[MAX]; | ^~~ a.cc:14:10: error: expected unqualified-id before ']' token 14 | int x[MAX],y[MAX]; | ^ a.cc:14:17: error: expect...
s580139884
p00441
C++
#include <bits/stdc++.h> #define FOR(i,n) for(int i=0;i<(int)(n);i++) #define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++) #define pb(a) push_back(a) #define mp(a,b) make_pair(a,b) #define ZERO(a) memset(a,0,sizeof(a)) #define len(a) sizeof(a) #define ll long long #define pii pair<int,int> #define INF 1<<29 #define M...
a.cc:11:16: error: expected ']' before ';' token 11 | #define MAX 511; | ^ a.cc:14:7: note: in expansion of macro 'MAX' 14 | int x[MAX],y[MAX]; | ^~~ a.cc:14:10: error: expected unqualified-id before ']' token 14 | int x[MAX],y[MAX]; | ^ a.cc:14:17: error: expect...
s919311568
p00441
C++
#include <bits/stdc++.h> #define FOR(i,n) for(int i=0;i<(int)(n);i++) #define FORR(i,m,n) for(int i=(int)(m);i<(int)(n);i++) #define pb(a) push_back(a) #define mp(a,b) make_pair(a,b) #define ZERO(a) memset(a,0,sizeof(a)) #define len(a) sizeof(a) #define ll long long #define pii pair<int,int> #define INF 1<<29 #define M...
a.cc: In function 'void solve()': a.cc:29:50: error: expected ';' before ')' token 29 | ma=max(ma,v.first*v.first+v.second*v.second)); | ^ | ;
s163437580
p00441
C++
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <queue> #include <algorithm> #include <utility> #include <cmath> #define INF_LL 9000000000000000000 #define INF 2000000000 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) using namespace...
a.cc: In function 'int main()': a.cc:70:9: error: 'memset' was not declared in this scope 70 | memset(fld, 0, sizeof(fld)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <cmath> +++ |+#include <cstr...
s052375599
p00441
C++
#include <iostream> #include <cstdio> #include <vector> #include <cmath> #include <cstring> #include <numeric> #include <algorithm> #include <functional> #include <array> #include <map> #include <queue> #include <limits.h> #include <set> #include <stack> #include <random> #include <complex> #include <unordered_map> #de...
a.cc: In function 'int main()': a.cc:73:46: error: 'cur' was not declared in this scope 73 | pii nexx = { cur.first - sa.first, cur.second - sa.second }; | ^~~ a.cc:73:91: error: could not convert '{<expression error>, <expression err...
s000967312
p00441
C++
#include<iostream> #include<string> #include<cmath> #include<queue> #include<vector> #include<functional> #include<algorithm> #include<cstdio> using namespace std; struct P{ int x,y; }; int main() { int n; while(cin>>n&&n!=0){ P a[3000]; for(int i=0;i<n;i++){ cin>>a[i].x>>a[i].y; } int sum=0; for(int i=...
a.cc: In function 'int main()': a.cc:46:35: error: jump to label 'stop' 46 | stop:; | ^~~~ a.cc:41:40: note: from here 41 | goto stop; | ^~~~ a.cc:43:39: note:...
s020657234
p00441
C++
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> #include <bitset> #include <cstring> using namespace std; #define FOR(I,A,B) for(int I...
a.cc: In function 'int main()': a.cc:27:9: error: 'isp' was not declared in this scope 27 | CLR(isp); | ^~~ a.cc:18:25: note: in definition of macro 'CLR' 18 | #define CLR(mat) memset(mat, 0, sizeof(mat)) | ^~~
s118320622
p00441
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <string> #include <ctime> #include <algorithm> #include <vector> #include <cstring> #include <stack> #include <queue> #include <utility> #include <cmath> using namespace std; int n; typedef pair<int, int> P; P pole[3005]; bool field[5005][5005]; int ma...
a.cc: In function 'int main()': a.cc:61:160: error: expected ')' before 'p4' 61 | if(p3.first >= 0 && p3.first < 5000 && p3.second >= 0 && p3.second < 5000 && p4.first >= 0 && p4.first < 5000 && p4.second >= 0 p4.second < 5000 && field[p3.first][p3.second] && field[p4.first][p4.second...
s710880496
p00441
C++
#include <iostream> #include <algorithm> #include <array> #include <math.h> #include <set> #include <stdlib.h> #include <string> #include <vector> #define INT_MAX 2000000000 #define MOD 1000000007 #define rep(i,aa,bb) for(i = (aa); i < (bb); i++) #define bitget(a,b) (((a) >> (b)) & 1) #define vint vector<int> #define ...
a.cc: In function 'int main()': a.cc:36:17: error: 'memset' was not declared in this scope 36 | memset(h, sizeof(h), 0); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <vector> +++ |+...
s536317260
p00441
C++
#include <iostream> #include <algorithm> #include <array> #include <math.h> #include <set> #include <stdlib.h> #include <string> #include <vector> #define INT_MAX 2000000000 #define MOD 1000000007 #define rep(i,aa,bb) for(i = (aa); i < (bb); i++) #define bitget(a,b) (((a) >> (b)) & 1) #define vint vector<int> #define ...
a.cc: In function 'int main()': a.cc:32:17: error: 'memset' was not declared in this scope 32 | memset(h, sizeof(h), 0); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <vector> +++ |+...
s015269648
p00441
C++
#include <bits/stdc++.h> #define int long long #define r(i,n) for(int i=0;i<n;i++) using namespace std; typedef pair<double,double>P; int n,x[3001],y[3001]; set<P>st; int main(){ while(cin>>n,n){ st.clear(); r(i,n){ cin>>x[i]>>y[i]; st.insert(P(x[i],y[i])); } int ans=0; r(i,n)r(j,n)if(i!=j){ int tx1...
cc1plus: error: '::main' must return 'int'
s183005589
p00441
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 #include<bits/stdc++.h> using namespace std; int n; bool p[5001][5001]; bool c(int a){ return 0<=a&&a<=5000; } int main(){ while(cin>>n&&n){ int x[5000],y[5001],an=0; for(int i=0;i<n;i++)cin>>x[i]>>y[i],p[x[i]][y[i]]=1; for(int i=0;i<n;i...
a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 1 | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:27: /usr/...
s626049003
p00441
C++
int main(){ while(1){ int n; cin >> n; if(n==0) break; int X[1001],Y[1001]; bool exi[1001][1001]; for(int i=1; i<=n; i++){ cin >> X[i] >> Y[i]; exi[X[i]][Y[i]] = true; } bool sik=false; priority_queue<int> PQ; for(int i=1; i<n; i++){ for(int j=...
a.cc: In function 'int main()': a.cc:4:5: error: 'cin' was not declared in this scope 4 | cin >> n; | ^~~ a.cc:13:5: error: 'priority_queue' was not declared in this scope 13 | priority_queue<int> PQ; | ^~~~~~~~~~~~~~ a.cc:13:20: error: expected primary-expression before 'int' 13 |...
s290304681
p00441
C++
#include <iostream> using namespace std; bool exi[5005][5005]; bool c(int a){ return 0<=a&&a<=5000; } int main(){ while(1){ int X[5005],Y[5005]; int n,au = 0; cin >> n; if(n==0) break; for(int i=0; i<n; i++) cin >> X[i] >> Y[i]; exi[X[i]][Y[i]] = true; for(int i...
a.cc: In function 'int main()': a.cc:15:59: error: 'i' was not declared in this scope 15 | for(int i=0; i<n; i++) cin >> X[i] >> Y[i]; exi[X[i]][Y[i]] = true; | ^
s607145746
p00441
C++
#include <iostream> using namespace std; int n; bool exi[5001][5001]; bool c(int a){ return 0<=a&&a<=5000; } int main(){ while(cin>>n&&n){ int X[5001],Y[5001]; int an = 0; for(int i=0; i<n; i++) { cin >> X[i] >> Y[i]; exi[X[i]][Y[i]] = 1; } for(int...
a.cc: In function 'int main()': a.cc:24:21: error: 'au' was not declared in this scope; did you mean 'an'? 24 | au = max(an, dx*dx+dy*dy); | ^~ | an a.cc:26:21: error: 'au' was not declared in this scope; did you mean 'an'? 26 | ...
s527498905
p00441
C++
#include <iostream> using namespace std; int n; bool p[5001][5001]; bool c(int a){ return 0<=a&&a<=5000; } int main(){ while(cin>>n&&n){ int x[5001],y[5001]; int an = 0; for(int i=0; i<n; i++) { cin >> x[i] >> y[i]; exi[x[i]][y[i]] = 1; } for(int i...
a.cc: In function 'int main()': a.cc:14:13: error: 'exi' was not declared in this scope; did you mean 'exit'? 14 | exi[x[i]][y[i]] = 1; | ^~~ | exit a.cc:23:20: error: 'exi' was not declared in this scope; did you mean 'exit'? 23 | if(exi[x1][y1]&&ex...
s943558444
p00441
C++
#include <iostream> using namespace std; int n; bool p[5001][5001]; bool c(int a){ return 0<=a&&a<=5000; } int main(){ while(cin>>n&&n){ int x[5000],y[5001],an=0; for(int i=0;i<n;i++)cin>>x[i]>>y[i],p[x[i]][y[i]]=1; for(int i=0;i<n;i++) for(int j=i;j<n;j++){ i...
a.cc: In function 'int main()': a.cc:19:20: error: 'exi' was not declared in this scope; did you mean 'exit'? 19 | if(exi[x1][y1]&&exi[x2][y2]&&c(x1)&&c(y1)&&c(x2)&&c(y2)) | ^~~ | exit a.cc:21:20: error: 'exi' was not declared in this scope; did you m...
s030723517
p00441
C++
#include <iostream> using namespace std; int n; bool p[5001][5001]; bool c(int a){ return 0<=a&&a<=5000; } int main(){ while(cin>>n&&n){ int x[5001],y[5001],an = 0; for(int i=0; i<n; i++) cin >> x[i] >> y[i],p[x[i]][y[i]] = 1; for(int i=0; i<n; i++) for(int j=i; j<n; j++){ ...
a.cc: In function 'int main()': a.cc:21:44: error: 'cc' was not declared in this scope; did you mean 'c'? 21 | if((x3)&&c(y3)&&p[x3][y3]&&cc(x4)&&c(y4)&&p[x4][y4]) | ^~ | c
s934803822
p00441
C++
#include <iostream> #include<cstdlib> #include<queue> #include<set> #include<vector> #include<string> #include<algorithm> #include<stack> #include<map> #include<cstdio> #include<fstream> using namespace std; #define rep(i,a) for(int i=0;i<a;i++) #define mp make_pair #define P pair<int,int> #define ll __int64 int n; int...
a.cc: In function 'int main()': a.cc:41:1: error: 'memset' was not declared in this scope 41 | memset(x,0,sizeof x); | ^~~~~~ a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<fstream> +++ |+#include <cstring> 12 | using na...
s604396222
p00441
C++
#include<cstdio> #include<vector> #include<algorithm> #include<set> #define men(d) (((d.vx*d.vx)+(d.vy*d.vy))/2) using namespace std; struct Data{ unsigned short vx : 13; signed short vy : 14; unsigned short cx : 13; unsigned short cy : 13; Data(unsigned short a,signed short b,unsigned short c,unsig...
a.cc: In function 'int main()': a.cc:44:31: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'fisrt'; did you mean 'first'? 44 | int tx=ins[i].fisrt-ins[j].first,ty=ins[i].second-ins[j].se...
s004758988
p00441
C++
#include <stdio.h> #include <iostream> #include <vector> #include <list> #include <cmath> #include <fstream> #include <algorithm> #include <string> #include <queue> #include <set> #include <map> #include <complex> #include <iterator> #include <cstdlib> #include <sstream> using namespace std; #define EPS (1e-10) #defi...
a.cc: In function 'int main()': a.cc:41:17: error: 'memset' was not declared in this scope 41 | memset(points,0,sizeof(points)); | ^~~~~~ a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 14 | #include <cstdlib...
s734867211
p00441
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <iterator> #include <list> #include <map> #include <queue> #include <bitset> #include <fstream> using namespace std; typedef long long ll; typedef pair<int,int> P; vector<P> points; bool checkSqr(P, P); double distance(P, P); int ...
a.cc: In function 'int main()': a.cc:40:62: error: 'pow' was not declared in this scope 40 | res = max(res, (int)(pow(distance(a,b), 2.0) / 2)); | ^~~ a.cc: In function 'double distance(P, P)': a.cc:54:21: erro...
s239702098
p00441
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <iterator> #include <list> #include <map> #include <queue> #include <bitset> #include <fstream> using namespace std; typedef long long ll; typedef pair<int,int> P; vector<P> points; bool checkSqr(P, P); double dist(P, P); int main...
a.cc: In function 'int main()': a.cc:38:78: error: 'pow' was not declared in this scope 38 | if(checkSqr(a, b)) res = max(res, (int)(pow(dist(a,b), 2.0))); | ^~~ a.cc: In function 'double dist(P, P...
s293109955
p00441
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <iterator> #include <list> #include <map> #include <queue> #include <bitset> #include <fstream> using namespace std; typedef long long ll; typedef pair<int,int> P; vector<P> points; bool checkSqr(P, P); double dist(P, P); int main...
a.cc: In function 'int main()': a.cc:38:78: error: 'pow' was not declared in this scope 38 | if(checkSqr(a, b)) res = max(res, (int)(pow(dist(a,b), 2.0))); | ^~~ a.cc: In function 'double dist(P, P...
s045430899
p00441
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <iterator> #include <list> #include <map> #include <queue> #include <bitset> #include <fstream> using namespace std; typedef long long ll; typedef pair<int,int> P; vector<P> points; bool checkSqr(P, P); double dist(P, P); int main...
a.cc: In function 'int main()': a.cc:38:78: error: 'pow' was not declared in this scope 38 | if(checkSqr(a, b)) res = max(res, (int)(pow(dist(a,b), 2.0))); | ^~~ a.cc: In function 'double dist(P, P...
s611212607
p00441
C++
#include<cstdio> #include<cstring> #include<vector> #include<map> #define max(a,b) (a>b?a:b) using namespcae std; vector< pair<int,int> > points; int table[5001][5001]; int main(){ int a; while(scanf("%d",&a),a){ memset(table,0,sizeof(table)); points.clear(); while(a--){ int j,k; scanf("%d%d",&j,&k); points.pus...
a.cc:6:7: error: expected nested-name-specifier before 'namespcae' 6 | using namespcae std; | ^~~~~~~~~ a.cc:7:1: error: 'vector' does not name a type 7 | vector< pair<int,int> > points; | ^~~~~~ a.cc: In function 'int main()': a.cc:13:9: error: 'points' was not declared in this scope; did you...
s680274214
p00441
C++
#include<cstdio> #include<cstring> #include<vector> #include<map> #define max(a,b) (a>b?a:b) using namespace std; vector< pair<int,int> > points; int table[5001][5001]; int main(){ int a; while(scanf("%d",&a),a){ memset(table,0,sizeof(table)); points.clear(); while(a--){ int j,k; scanf("%d%d",&j,&k); points.pus...
a.cc: In function 'int main()': a.cc:23:41: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} and 'int') 23 | int x1=points[i][0],x2=points[j][0],y1=points[i][1],y...
s495547199
p00441
C++
#include<cstdio> #include<cstring> #include<vector> #include<map> #define max(a,b) (a>b?a:b) using namespace std; vector< pair<int,int> > points; int table[5001][5001]; bool Check(int x,int y){ return (0<=x&&x<=5000&&0<=y&&y<=5000)?(bool)table[x][y]:false; } int main(){ int a; while(scanf("%d",&a),a){ memset(table,...
a.cc: In function 'int main()': a.cc:21:30: error: expected ';' before '}' token 21 | table[j][k]=1 | ^ | ; 22 | } | ~
s869440463
p00441
C++
#include<cstdio> #include<cstring> #include<vector> #include<map> #define max(a,b) (a>b?a:b) using namespace std; vector< pair<int,int> > points; vector<int> table[5001]; bool Check(int x,int y){ return (0<=x&&x<=5000&&0<=y&&y<=5000)?(bool)table[x][y]:false; } int main(){ int a; while(scanf("%d",&a),a){ memset(tabl...
a.cc: In function 'int main()': a.cc:18:61: error: no matching function for call to 'std::vector<int>::push_back()' 18 | for(int j=0; j<=5000; j++)table[i].push_back(); | ~~~~~~~~~~~~~~~~~~^~ In file included from /usr/include/c++/14/vector:66, ...
s631874846
p00441
C++
import java.util.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class Main { int INF = 1 << 28; final int MAX = 5001; boolean[][] map; HashSet<P> ps; void run() { Scanner sc = new Scanner(System.in); for(;;) { int n = sc.nextInt(); if( n==0 ) break; map = new boolean[M...
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import static java.lang.Math.*; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-...
s004578311
p00441
C++
#include <iostream> #include <cstdio> #include <vector> #include <map> #include <cmath> #include <algorithm> using namespace std; struct P{ int x,y; P(int x_, int y_){ x = x_; y = y_; } P(){} }; bool exist[5001][5001]; int x[3001], y[3001]; int main(){ int n; while( cin >> n , n ){ for(int i=0 ; i < 5001 ; ...
a.cc: In function 'int main()': a.cc:29:30: error: invalid types 'bool [5001][5001][int [3001]]' for array subscript 29 | exist[y][x] = true; | ^
s359248207
p00441
C++
#include <iostream> #include <cstdio> #include <vector> #include <map> #include <cmath> #include <algorithm> using namespace std; struct P{ int x,y; P(int x_, int y_){ x = x_; y = y_; } P(){} }; char exist[5001][5001]; int x[3001], y[3001]; int main(){ int n; while( cin >> n , n ){ for(int i=0 ; i < 5001 ; ...
a.cc: In function 'int main()': a.cc:29:30: error: invalid types 'char [5001][5001][int [3001]]' for array subscript 29 | exist[y][x] = true; | ^
s003560366
p00441
C++
#include <iostream> #include <iomanip> #include <vector> #include <map> #include <set> #include <queue> #include <bitset> #include <stack> #include <utility> #include <numeric> #include <algorithm> #include <functional> #include <complex> #include <string> #include <sstream> #include <cstdio> #include <cstdlib> #inclu...
a.cc: In function 'int main()': a.cc:87:17: error: 'ret' was not declared in this scope; did you mean 'rep'? 87 | cout << ret << endl; | ^~~ | rep a.cc: At global scope: a.cc:89:5: error: expected unqualified-id before 'return' 89 | return 0; | ^~~...
s865284520
p00441
C++
#include<iostream> #include<vector> #include<map> #include<algorithm> using namespace std; bool mem[5001][5001]; const int H = 5000, W = 5000; vector<pair<int, int>> points; bool check(int x, int y, int dx, int dy) { return x + dx <= W && x + dx >= 0 && y + dy <= H && y + dy >=0 && mem[x + dx][y + dy] && x...
a.cc: In function 'int main()': a.cc:43:30: error: 'pow' was not declared in this scope 43 | ans = max(ans, (int)(pow(dx, 2) + pow(dy, 2))); | ^~~
s931548963
p00441
C++
#include<iostream> using namespace std; bool a[3002][3002]; bool f(int x,int y){ if(x<0||x>=3002||y<0||y>=3002)return false; return a[x][y]; } int main(){ while(1){ for(int i=0;i<3002;i++)for(int j=0;j<3002;j++)a[i][j]=false; int n,x[3002],y[3002]; scanf("%d",&n); if(n==0)braek; for(int i=0;i<n;i++){ scanf("%...
a.cc: In function 'int main()': a.cc:15:33: error: 'braek' was not declared in this scope 15 | scanf("%d",&n); if(n==0)braek; | ^~~~~
s677538103
p00442
C++
#include <stdio.h> #include <algorithm> #include <stack> #define FOR(i,a,b) for(int i=a;i<b;++i) #define REP(i,b) FOR(i,0,b) using namespace std; int data[5000]; stack<int> wn[5000]; int main(){ int n; int m; scanf_s("%d%d", &n, &m); fill(data, data + 5000, 0); int a, b; REP(i, m){ scanf_s("%d%d", &a, &b);...
a.cc: In function 'int main()': a.cc:17:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 17 | scanf_s("%d%d", &n, &m); | ^~~~~~~ | scanf a.cc:18:14: error: reference to 'data' is ambiguous 18 | fill(data, data + 5000, 0); | ^~...
s777971854
p00442
C++
#include <stdio.h> #include <algorithm> #include <stack> #define FOR(i,a,b) for(int i=a;i<b;++i) #define REP(i,b) FOR(i,0,b) using namespace std; int data[5000]; stack<int> wn[5000]; int main(){ int n; int m; scanf_s("%d%d", &n, &m); fill(data, data + 5000, 0); int a, b; REP(i, m){ scanf_s("%d%d", &a, &b);...
a.cc: In function 'int main()': a.cc:17:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 17 | scanf_s("%d%d", &n, &m); | ^~~~~~~ | scanf a.cc:18:14: error: reference to 'data' is ambiguous 18 | fill(data, data + 5000, 0); | ^~...
s832516337
p00442
C++
#include <vector> #include <iostream> #include <algorithm> using namespace std; int V, E, A, B; vector<vector<int> > G; vector<int> T; vector<bool> used; void rec(int u) { used[u] = true; for (int i = 0; i < G[u].size(); i++) { int v = G[u][i]; if (!used[v]) { rec(v); } } T.push_back(u); } int main()...
In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h: In instantiation of 'bool std::binary_search(_FIter, _FIter, const _Tp&) [with _FIter = __gnu_cxx::__normal_iterator<int*, vector<int> >; _Tp = vector<int>]': a.cc:65:21: required from here 65...
s728260432
p00442
C++
//???????????????????????¨??????????????????A????????????B????????£?????¨??????A -> B??¨????????????????????? //????????¨???????????°???????????§???????????°???????????§s??????t????????????????????¨????????¨?????? //????????????????????????s -> s1 -> s2 -> ??? -> t??¨???????????¨?????§?????????????????¨???????????????s...
a.cc: In function 'int main()': a.cc:69:9: error: 'sort' was not declared in this scope; did you mean 'short'? 69 | sort(perm, perm + n); //????????§????????? | ^~~~ | short
s955551866
p00442
C++
#include <stdio.h> #include <stdlib.h> #include <cmath> #include <time.h> #include <iostream> #include <vector> #include <algorithm> #include <string> #include <string.h> #include <queue> #define FOR(i, a) for(i = 0; i < (a); i++) #define FORM(i, a) for(i = (a) i >= 0; i--) using namespace std; vector<int> E[5050]; i...
a.cc:77:1: error: unterminated comment 77 | /* | ^
s174168130
p00442
C++
#include <stdio.h> #include <vector> #include <queue> using namespace std; #define REP(i,x) for(int i = 0;i < x;++i) int n, m; vector<int>graph[5678]; vector<int>ans; int dev[5678];//in int main() { scanf("%d", &n); scanf("%d", &m); REP(i, m) { int win,lose; scanf("%d %d", &win, &lose); --win; --lose; ...
a.cc: In function 'int main()': a.cc:53:21: error: 'find' was not declared in this scope 53 | if (find(graph[i].begin(), graph[i].end(), i + 1) == graph[i].end()) | ^~~~
s091117695
p00442
C++
#include <vector> #include <algorithm> #include <set> #include <map> #include <queue> #include <stack> #include <iostream> #include <cstdio> #include <cmath> #include <cstring> using namespace std; typedef long long ll; typedef pair<ll,ll> P; typedef double db; #define fr first #define sc second #define pb push_back #...
a.cc: In function 'int main()': a.cc:50:17: error: reference to 'rank' is ambiguous 50 | rank[now]=team; | ^~~~ 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++/...
s009273102
p00442
C++
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <queue> #include <algorithm> #include <utility> #include <cmath> #include <map> #include <set> #include <stack> #include <cstdio> #include <cstdlib> #include <cstring> #define INF_LL 1e18 #define INF 1e9 #define REP(i, n) for(int i = ...
a.cc: In function 'int main()': a.cc:61:17: error: 'uf' was not declared in this scope 61 | uf.unite(a, b); | ^~
s183138669
p00442
C++
#if 1 #include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <queue> #include <stack> #include <array> #include <deque> #include <algorithm> #include <utility> #include <cstdint> #include <functional> #include...
a.cc: In function 'int main()': a.cc:80:53: error: unable to find numeric literal operator 'operator""i32' 80 | std::iota(win_max_index, win_max_index + N, 0i32); | ^~~~ a.cc:84:53: error: unable to find numeric literal operator 'operator""i32' 84 ...
s648691418
p00442
C++
#if 1 #include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <queue> #include <stack> #include <array> #include <deque> #include <algorithm> #include <utility> #include <cstdint> #include <functional> #include...
a.cc: In function 'int main()': a.cc:80:53: error: unable to find numeric literal operator 'operator""i32' 80 | std::iota(win_max_index, win_max_index + N, 0i32); | ^~~~ a.cc:84:53: error: unable to find numeric literal operator 'operator""i32' 84 ...
s239937115
p00442
C++
#include <iostream> #include <stack> #include <map> #include <algorithm> #include <sstream> #include <queue> #include <string> #include <cmath> using namespace std; #define F first #define S second const int INF=100000000; struct Node{ vector<int> to,from; }; bool e[5000][5000]; int main(){ int n,m; cin >> n >> m...
a.cc: In function 'int main()': a.cc:23:9: error: 'memset' was not declared in this scope 23 | memset(e,0,sizeof(e)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <cmath> +++ |+#include <cstring> ...
s329661226
p00443
Java
import java.io.InputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.InputMismatchException; import java.util.NoSuchElementException; import java.math.BigInteger; public class Main{ static PrintWriter out...
Main.java:39: error: incompatible types: possible lossy conversion from long to int if(r[now]==0&&b[now]==0) return (long)p[now]+q[now]; ^ Main.java:42: error: incompatible types: possible lossy conversion from long to int return bb/gcd(q[now],bb)*(p[now]+q[now]); ...
s743002620
p00443
Java
import java.io.InputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.InputMismatchException; import java.util.NoSuchElementException; import java.math.BigInteger; public class Main{ static PrintWriter out...
Main.java:39: error: incompatible types: possible lossy conversion from long to int if(r[now]==0&&b[now]==0) return (long)p[now]+(long)q[now]; ^ Main.java:42: error: incompatible types: possible lossy conversion from long to int return bb/gcd(q[now],bb)*(p[now]+q[now]); ...
s028717418
p00443
Java
import java.io.InputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.InputMismatchException; import java.util.NoSuchElementException; import java.math.BigInteger; public class Main{ static PrintWriter out...
Main.java:49: error: incompatible types: possible lossy conversion from long to int int g=gcd(bb*p[now],rr*q[now]); ^ 1 error
s649592492
p00443
Java
gimport java.io.*; import java.util.*; class Node { public int p, q, r, b, parent; Node(int p, int q, int r, int b) { this.p = p; this.q = q; this.r = r; this.b = b; this.parent = -1; } } public class Main { Scanner sc; int n; int root; Node[] tree; ...
Main.java:1: error: class, interface, enum, or record expected gimport java.io.*; ^ Main.java:2: error: class, interface, enum, or record expected import java.util.*; ^ 2 errors
s803731420
p00443
C
#include<stdio.h> #include<string.h> #include<climits> #define min(a,b) (a<b?a:b) struct x{int p,q,r,b;}B[105]; int N,i,j,h[105],r,t; int gcd(int a,int b) { int c; for(;b!=0;) { c=a%b;a=b;b=c; } return a; } int dfs(int p) { int r,b,i,j,ta,tb,i,rj,t1,t2; if(p==-1)return 1; if(h[p]>=0)return h[p]; r=dfs(B[p]...
main.c:3:9: fatal error: climits: No such file or directory 3 | #include<climits> | ^~~~~~~~~ compilation terminated.
s493909108
p00443
C
#include<stdio.h> #include<string.h> #include<climits> #define min(a,b) (a<b?a:b) struct x{int p,q,r,b;}B[105]; int N,i,j,h[105],r,t; int gcd(int a,int b) { int c; for(;b!=0;) { c=a%b;a=b;b=c; } return a; } int dfs(int p) { int r,b,i,j,ta,tb,ri,rj,t1,t2; if(p==-1)return 1; if(h[p]>=0)return h[p]; r=dfs(B[p...
main.c:3:9: fatal error: climits: No such file or directory 3 | #include<climits> | ^~~~~~~~~ compilation terminated.
s222494460
p00443
C
#include<stdio.h> typedef struct { long long p,q,r,b; } mobile; mobile bar[100]; long long data[100]; long long kbs(long long a, long long b){ if(a>b){ if(a%b==0) return b; else return kbs(a%b,b); }else{ if(b%a==0) return a; else return kbs(a,b%a); } } long long weight(int i){ if(data[i-1]>0) return da...
main.c: In function 'weight': main.c:27:17: error: 'b' undeclared (first use in this function) 27 | b=bar[i-1].q*weight(bar[i-1].b); | ^ main.c:27:17: note: each undeclared identifier is reported only once for each function it appears in main.c:31:17: error: 'a' undeclared (firs...
s919686985
p00443
C
#include <stdio.h> #include <string.h> typedef __int64 ll; typedef struct { int ldata, rdata; int left, right; int parent; } BINARY; BINARY tree[101]; int gcd(int a, int b) { if (a < b){ a ^= b; b ^= a; a ^= b; } return (b == 0 ? a : gcd(b, a % b)); } int lcm(int a, ...
main.c:4:9: error: unknown type name '__int64'; did you mean '__int64_t'? 4 | typedef __int64 ll; | ^~~~~~~ | __int64_t
s106386567
p00443
C
#include <cstdio> using namespace std; typedef struct stick{ int lren, rren, sl, sr, weight; } STICK; int n, tmp, top; int depth[101]; STICK st[101]; void init(int k){ for(int i = 0; i <= k; i++){ depth[i] = 0; st[i].weight = 0; } } int gcd(int a, int b){ if(b == 0) return a; return gcd(b, a % b); } int ...
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s500105818
p00443
C
/* AizuOnline A0520 Lightest Mobile */ #include <stdio.h> struct MOB { int leftlen ;int rightlen; int leftnode ;int rightnode; } ; struct MOB mobiles[100]; int prime[10]={2,3,5,7,11,13,17,19,23,29}; long int gcd(long int x,long int y) { long int w,r; int i,pr; for(i=0;i<10;i++) { pr=prime[i]; ...
main.c: In function 'lcm': main.c:37:25: error: expected ';' before '}' token 37 | return(x/gcd(x,y)*y);1 | ^ | ; 38 | } | ~ main.c: At top level: main.c:87:1: error: return type defaults to 'int' [-Wimplicit-int] 87 | ...
s432781225
p00443
C
#include <stdio.h> typedef struct _node{ unsigned int p; unsigned int q; unsigned int r; unsigned int b; unsigned int left; //p-side mass unsigned int right; //q-side mass } Node; unsigned int calc_mass(unsigned int trgt); unsigned int calc_gcd( unsigned int a, unsigned int b); Node MOB[101]; unsigned int main(...
main.c: In function 'main': main.c:54:17: error: unknown type name 'prunsigned'; did you mean 'unsigned'? 54 | prunsigned intf("%d\n",Total); | ^~~~~~~~~~ | unsigned main.c:54:33: error: expected declaration specifiers or '...' before string constant 54 ...
s206193635
p00443
C
#include <stdio.h> typedef struct _node{ unsigned int p; unsigned int q; unsigned int r; unsigned int b; unsigned int left; //p-side mass unsigned int right; //q-side mass } Node; unsigned int calc_mass(unsigned int trgt); unsigned int calc_gcd( unsigned int a, unsigned int b); Node MOB[101]; unsigned int main(...
main.c: In function 'calc_mass': main.c:111:33: error: expected ';' before 'left2' 111 | gcd=calc_gcd(right,left) | ^ | ; 112 | left2=left/gcd,right2=right/gcd; | ~~~~~
s114721263
p00443
C
#include <stdio.h> typedef struct _node{ long long int p; long long int q; int r; int b; long long int left; //p-side mass long long int right; //q-side mass } Node; long long int calc_mass(int trgt); long long int calc_gcd( int a, int b); Node MOB[101]; int main(){ int n; int chk[101]; int i; long long in...
main.c:64:15: error: conflicting types for 'calc_gcd'; have 'long long int(long long int, long long int)' 64 | long long int calc_gcd( long long int a, long long int b){ | ^~~~~~~~ main.c:12:15: note: previous declaration of 'calc_gcd' with type 'long long int(int, int)' 12 | long long int c...
s935039855
p00443
C++
#include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; int gcd(int a, int b) { if (b == 0) { return a; } int r = a % b; return gcd(b, r); int we(int wl, int wr, int lel, int ler) { int ml = wl * lel; int mr = wr * ler; int bil = mr / gcd(ml, mr); int bir = ml / gcd(ml, ...
a.cc: In function 'int gcd(int, int)': a.cc:13:42: error: a function-definition is not allowed here before '{' token 13 | int we(int wl, int wr, int lel, int ler) { | ^ a.cc:20:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] ...
s160356896
p00443
C++
#include<vector> #include<algorithm> using namespace std; typedef long long ll; struct node{ll lv,rv,lc,rc;}; #define MAX_N 101 ll gcd(ll x,ll y){return __gcd(x,y);} ll lcm(ll x,ll y){return x/gcd(x,y)*y;} int n; node g[MAX_N]; int t[MAX_N]; ll rec(int pos){ if(pos==0)return 1; node m=g[pos]; ll a=rec(m.lc); ...
a.cc: In function 'void solve()': a.cc:26:3: error: 'cout' was not declared in this scope 26 | cout<<rec(root)<<endl; | ^~~~ a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 2 | #include<algorithm> +++ |+#include <iostream> 3 ...
s889740789
p00443
C++
#include<cstdio> #include<vector> #include<algorithm> using namespace std; int GCD(int a,int b){ if(b>a)swap(a,b); return (b==0)?a:GCD(b,a%b); } int LCM(int a,int b){ return a*b/GCD(a,b); } int l[101],r[101],w1[101],w2[101]; int dfs(int x){ if(x==0)return 1; int red=l[x]*dfs(w1[x]); int blue=r[x...
a.cc: In function 'int dfs(int)': a.cc:18:12: error: 'memo' was not declared in this scope 18 | return memo[x]=lcm/l[x]+lcm/r[x]; | ^~~~ a.cc: In function 'int main()': a.cc:23:19: error: 'N' was not declared in this scope 23 | bool flag[N+1];fill(flag,flag+n+1,true); | ...
s224197584
p00443
C++
#include<cstdio> #include<vector> #include<algorithm> using namespace std; int GCD(int a,int b){ if(b>a)swap(a,b); return (b==0)?a:GCD(b,a%b); } int LCM(int a,int b){ return a/gcd(a,b)*b; } int l[101],r[101],w1[101],w2[101]; int memo[101]; int dfs(int x){ if(x==0)return 1; if(memo[x]!=-1)return memo...
a.cc: In function 'int LCM(int, int)': a.cc:10:14: error: 'gcd' was not declared in this scope 10 | return a/gcd(a,b)*b; | ^~~
s970469374
p00443
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int n; ll red[100]; ll blue[100]; ll le[100]; ll ri[100]; ll gcd(ll a,ll b){ if(b>a){ a^=b; b^=a; a^=b; } while(1){ int temp=a%b; if(temp==0) break; a=b; b=temp; } return b; } ll dfs(int now){ ll l=1,r=1; if(le[now]!=0) l*=dfs(le[now]...
a.cc: In function 'll dfs(int)': a.cc:25:10: error: expected ';' before 'l' 25 | l | ^ | ; 26 | l ans=blue[now]*r*red[now]*l/g; | ~ a.cc:27:16: error: 'ans' was not declared in this scope; did you mean 'abs'? 27 | return ans/blue[now]+ans/red...
s737715893
p00443
C++
#include <iostream> using namespace std; int dp[110],K[110],O[110],L[110],R[110]; int gcd(int a,int b){ int tmp; while((tmp=a%b)!=0){ a=b; b=tmp; } return b; } int mobi(int bou){ if(bou==0) return 1; if(dp[bou]!=0) return dp[bou]; int l,r,li,ri,gc,gc2,a,b; l=mobi(L[bou]); r=mobi(R[bou]); ri=K[bou];li=...
a.cc: In function 'int main()': a.cc:35:17: error: 'memset' was not declared in this scope 35 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ ...
s795475820
p00443
C++
#include<iostream> #include<algorithm> using namespace std; int x[100][2],w[100][2],n; bool cal[110]; int COU(int a,int b){ ??while(true){ ????if(a<2||b<2)return 1; ????if(a<b){int t=a;a=b,b=t;} ????a%=b; ????if(!a)return b; ??} } long long DFS(int q){ ????????if(!q)return 1; ????????q--; ????????long long a=DFS(w[q][0...
a.cc: In function 'int COU(int, int)': a.cc:7:1: error: expected primary-expression before '?' token 7 | ??while(true){ | ^ a.cc:7:2: error: expected primary-expression before '?' token 7 | ??while(true){ | ^ a.cc:7:3: error: expected primary-expression before 'while' 7 | ??while(true){ |...
s514273349
p00443
C++
#include<iostream> #include<algorithm> using namespace std; int x[100][2],w[100][2],n; bool cal[110]; int COU(int a,int b){ while(true){ if(a<2||b<2)return 1; if(a<b){int t=a;a=b,b=t;} a%=b; if(!a)return b; } } long long DFS(int q){ if(!q)return 1; q--; long long a=DFS(w[q][0]),b=DFS(w[q][1]); return (a*b...
a.cc: In function 'int main()': a.cc:23:28: error: expected ';' before 'for' 23 | if(!n)break | ^ | ; 24 | for(int i=0;i<n;i++)cal[i]=false; | ~~~
s459731263
p00443
C++
#include<bits/stdc++.h> #define int long long using namespace std; int gcd(int a,int b){ if(b==0)return a; return gcd(b,a%b); } int lcm(int a,int b){return a*b/gcd(a,b);} struct bou{ int l,r,x,y; }; int n[100];bou m[101]; int mincost(int a){ if(n[a-1]!=-1)return n[a-1]; int b=1,c=...
cc1plus: error: '::main' must return 'int'
s402874352
p00443
C++
#include "bits/stdc++.h" using namespace std; #define int long long #define CHOOSE(a) CHOOSE2 a #define CHOOSE2(a0,a1,a2,a3,x,...) x #define REP1(i, s, cond, cal) for (signed i = signed(s); i cond; i cal) #define REP2(i, s, n) REP1(i, s, < signed(n), ++) #define REP3(i, n) REP2(i, 0, n) #define rep(...) CHOOSE((__VA_...
a.cc: In function 'int main()': a.cc:52:32: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'? 52 | int idx = find(all(root), true) - root.begin(); | ^~~ | std::filesystem::perms::all In fi...
s732937866
p00443
C++
#include <iostream> #define int long long using namespace std; typedef struct Node { int p, q, r, b; } Node; int gcd(int a, int b){ if(a < b){ return gcd(b, a); } if(b > 0){ return gcd(b, a % b); } return a; } int lcm(int a, int b){ long long tmp = a; tmp *= b; return (int)(tmp / gcd(a, b)); } Node nodes[10...
cc1plus: error: '::main' must return 'int'
s001961601
p00443
C++
#include<stdio.h> #include<cstring> #define max(a,b) (a>b?a:b) long long int a[101],b[101],c[101],d[101],memo[101],res=0; long long int gcd(long long int x,long long int y){ if(x==0)return y; else return gcd(y%x,x); } long long int solve(int x){ if(memo[x]!=0)return memo[x]; int left=a[x]*solve(c[x]),right=b[x]*so...
a.cc: In function 'int main()': a.cc:20:61: error: expected ')' before '{' token 20 | for(;scanf("%d",&n),n!=0;memset(memo,0,sizeof(memo)){ | ~ ^ | )
s364183060
p00443
C++
#include <cstdio> using namespace std; typedef long long ll; typedef struct stick{ ll lren, rren, sl, sr, weight; } STICK; ll n, tmp, top; ll depth[101]; STICK st[101]; void init(ll k){ for(ll i = 0; i <= k; i++){ depth[i] = 0; st[i].weight = 0; } } ll gcd(ll a, ll b){ if(b == 0) return a; return gcd(b, a...
a.cc:43:1: error: '::main' must return 'int' 43 | ll main(){ | ^~
s042495262
p00443
C++
require 'rational' class AOJ0520 def initialize(n) @n = n @poles = [] end def solve @n.times{ @poles << gets.split.map(&:to_i) } top = ((1..@n).to_a - @poles.map{ |p| [p[2], p[3]] }.flatten)[0] weight(top-1) end def weight(id) r = (@poles[id][2] == 0 ? 1 : weight(@poles[id][2]-1))...
a.cc:1:9: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes 1 | require 'rational' | ^~~~~~~~~~ a.cc:5:5: error: stray '@' in program 5 | @n = n | ^ a.cc:6:5: error: stray '@' in program 6 | @poles = [] | ^ a.cc:10:5: error: stray '@' ...
s966063028
p00443
C++
#include<iostream> #include<cstdio> using namespace std; int a[100+2],b[100+2],c[100+2],d[100+2],w[100+2],n; int s(int x){ int ans; if(w[x]!=-1)return w[x]; else { int e=a[x]*s(c[x]),f=b[x]*s(d[x]); int g=e,h=f,gcd; while(1){ g%=h; if(g==0)break; h%=g; if(h==0)break; } gcd=e*f/max(g,h); ans=...
a.cc: In function 'int main()': a.cc:28:17: error: break statement not within loop or switch 28 | if(n==0)break; | ^~~~~
s857886301
p00443
C++
//Bokan ga bokka--nn!! //Daily Lunch Special Tanoshii !! #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <string> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <functional> #include <iostream> #include <map> #include <set> using namespace std; typede...
a.cc: In function 'int main()': a.cc:43:29: error: 'n' was not declared in this scope; did you mean 'yn'? 43 | scanf("%d",&n); | ^ | yn a.cc:52:31: error: invalid types 'int[int]' for array subscript 52 | i...
s153637864
p00444
Java
import java.util.*; public class AOJ_0521{ void run(){ Scanner sc = new Scanner(System.in); int[] coins = { 500, 100, 50, 10, 5, 1}; while(true){ int price = sc.nextInt(); if(price == 0){ break; } int change = 1000 - price; ...
Main.java:2: error: class AOJ_0521 is public, should be declared in a file named AOJ_0521.java public class AOJ_0521{ ^ 1 error
s179461388
p00444
Java
import java.util.Scanner; class Main{ Main(){ Scanner scan = new Scanner(System.in); while(true){ int yen=scan.nextInt(); if(yen==0){ break; } yen=1000-yen; System.out.println(hantei(yen)); } } int[] init(int[] w){ for(int i=0;i<w.length;i++){ w[i]=0; } return w; } int hante...
Main.java:72: error: reached end of file while parsing public st ^ 1 error
s479829245
p00444
Java
public static void main(String[] args) { Scanner cin = new Scanner(System.in); while(true){ int x,ans; x=cin.nextInt(); if(x==0){ break; } x=1000-x; ans=x/500; x=x%500; ans=ans+x/100; x=x%100; ans=ans+x/50; x=x%50; ans=ans+x/10; x=x%10; ans=ans+x; System....
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) 1 error
s179320560
p00444
C
#include <stdio.h> int main(){ int g,t,m500,m100,m50,m10,m5,m1,cnt=0; while(1){ scanf("%d",&g); if(g==0){ break; } t=1000-g; m500=t/500; cnt=cnt+m500; m500=t%500; m100=m500/100; cnt=cnt+m100; m100=m500%100; m50=m100/50; cnt=cnt+m50; m50=m100%50; m10=m50/...
main.c: In function 'main': main.c:29:3: error: expected declaration or statement at end of input 29 | } | ^
s102873959
p00444
C
#include <stdio.h> int main(void) { int daikin; int oturi; int maisu = 0; while( 0){ scanf("%d", &daikin); oturi = 1000 - daikin; if(oturi / 500 >= 1){ maisu += oturi / 500; oturi = oturi % 500; } if(oturi / 100 >= 1){ maisu += oturi / 100; oturi = oturi % 100; } if(oturi / 50...
main.c: In function 'main': main.c:46:1: error: expected declaration or statement at end of input 46 | } | ^
s291525978
p00444
C
#include <stdio.h> const int money[] = { 500, 100, 50, 10, 5, 1 }; const int size = sizeof( money ) / sizeof( int ); int main ( void ) { int x, i, answer = 0; //while ( 1 ) { scanf( "%d", &x ); if ( x == 0 ) { break; } x = 1000 - x; for ( i = 0; i < size; ++i ) { answer += x / money[i]; x %= m...
main.c: In function 'main': main.c:13:25: error: break statement not within loop or switch 13 | break; | ^~~~~
s482104696
p00444
C
#include <stdio.h> int main(void) { int price; int change; int cnt; int i; while (scanf("%d", &n) != EOF){ change = 1000 - price; cnt = 0; for (i = 100; i > 0; i /= 10){ cnt += change / 5 / i; change %= 5 * i; cnt += change / i; ...
main.c: In function 'main': main.c:10:25: error: 'n' undeclared (first use in this function) 10 | while (scanf("%d", &n) != EOF){ | ^ main.c:10:25: note: each undeclared identifier is reported only once for each function it appears in
s288295298
p00444
C
#include <iostream> using namespace std; int main(){ int a[6]={500,100,50,10,5,1},input,count,i; while(1){ cin>>input; if(input==0){ break; } input=1000-input; for(i=0,count=0;i<6;i++){ if(input/a[i]>0){ count+=input/a[i]; } input=input-(input/a[i])*a[i]; } ...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s789744017
p00444
C
#include <stdio.h> int main() { int a , b, c, d, e, f, x; while(1) { scanf("%d", &x); if( x == 0 )break; a = (1000 - x) / 500; b = (1000 - (x+a*500))/100; c = (1000 - (x+a*500+b*100) / 50; d = (1000 - (x+a*500+b*100+c*50) / 10; e = (1000 - (x+a*500+b*100+c*50+d*10) / ...
main.c: In function 'main': main.c:11:40: error: expected ')' before ';' token 11 | c = (1000 - (x+a*500+b*100) / 50; | ~ ^ | ) main.c:19:1: error: expected declaration or statement at end of input 19 | } | ^ main...
s605472397
p00444
C
#include <stdio.h> int main() { int a , b, c, d, e, f, x; while(1) { scanf("%d", &x); if( x == 0 )break; a = (1000 - x) / 500; b = (1000 - (x+a*500))/100; c = (1000 - (x+a*500+b*100) / 50; d = (1000 - (x+a*500+b*100+c*50) / 10; e = (1000 - (x+a*500+b*100+c*50+d*10) / ...
main.c: In function 'main': main.c:11:40: error: expected ')' before ';' token 11 | c = (1000 - (x+a*500+b*100) / 50; | ~ ^ | ) main.c:19:1: error: expected declaration or statement at end of input 19 | } | ^ main...
s247449581
p00444
C
#include <stdio.h> int main() { int a , b, c, d, e, f, x; while(1) { scanf("%d", &x); if( x == 0 )break; a = (1000 - x) / 500; b = (1000 - (x+a*500))/100; c = (1000 - (x+a*500+b*100) / 50; d = (1000 - (x+a*500+b*100+c*50) / 10; e = (1000 - (x+a*500+b*100+c*50+d*10) / ...
main.c: In function 'main': main.c:11:40: error: expected ')' before ';' token 11 | c = (1000 - (x+a*500+b*100) / 50; | ~ ^ | ) main.c:19:1: error: expected declaration or statement at end of input 19 | } | ^ main...