submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s290724522
p02256
C++
#include<stdio.h> int main() { int x,y; scanf("%d %d",&x,&y); int n; for(n=1; (n<=x) && (n<=y) ;n++) { ??? int k=1; if((x%n==0) && (y%n==0)) k=n; } printf("%d\n",k); return 0; }
a.cc: In function 'int main()': a.cc:10:6: error: expected primary-expression before '?' token 10 | ??? int k=1; | ^ a.cc:10:7: error: expected primary-expression before '?' token 10 | ??? int k=1; | ^ a.cc:10:8: error: expected primary-expression before '?' token 10 | ...
s378610154
p02256
C++
#include<stdio.h> int main() { int x,y; scanf("%d %d",&x,&y); int n; int k=1; int a=x/2;b=y/2 for(n=1; (n<=a) && (n<=b) ;n++) { if((x%n==0) && (y%n==0)) k=n; } printf("%d\n",k); return 0; }
a.cc: In function 'int main()': a.cc:9:15: error: 'b' was not declared in this scope 9 | int a=x/2;b=y/2 | ^ a.cc:10:35: error: expected ';' before ')' token 10 | for(n=1; (n<=a) && (n<=b) ;n++) | ^ | ;
s311262058
p02256
C++
#include<stdio.h> int main() { int x,y; scanf("%d %d",&x,&y); int n; int k; int z,Z; if(x<y) z=x,Z=y; else z=y,Z=x; if(Z%2==0) int sz=Z*0.5; else int sz=Z*0.5+0.5; if(z<=sz) { for(n=z; n>=1 ;n--) { if(z%n==0) {if(Z%n==0) {k...
a.cc: In function 'int main()': a.cc:16:11: error: 'sz' was not declared in this scope; did you mean 'z'? 16 | if(z<=sz) | ^~ | z
s870092867
p02256
C++
#include<stdio.h> int main() { int x,y; scanf("%d %d",&x,&y); int n; int k; float z,Z; if(x<y) {z=x;Z=y;} else {z=y;Z=x;} if(Z%2==0) float sz=Z*0.5; else float sz=Z*0.5+0.5; if(z<=sz) { for(n=z; n>=1 ;n--) { if(z%n==0) {if(...
a.cc: In function 'int main()': a.cc:12:9: error: invalid operands of types 'float' and 'int' to binary 'operator%' 12 | if(Z%2==0) | ~^~ | | | | | int | float a.cc:16:11: error: 'sz' was not declared in this scope; did you mean 'z'? 16 | if(z<=sz) ...
s769676604
p02256
C++
#include<stdio.h> int main() { int x,y; scanf("%d %d",&x,&y); int n; int k; float z,Z; if(x<y) {z=x;Z=y;} else {z=y;Z=x;} int sz=Z/2; if(z<=sz) { for(n=z; n>=1 ;n--) { if(z%n==0) {if(Z%n==0) {k=n;break;}} } } else ...
a.cc: In function 'int main()': a.cc:17:17: error: invalid operands of types 'float' and 'int' to binary 'operator%' 17 | if(z%n==0) | ~^~ | | | | | int | float a.cc:18:22: error: invalid operands of types 'float' and 'in...
s514102876
p02256
C++
#include<stdio.h> int main() { int x,y; scanf("%d %d",&x,&y); int n; int k; int z,Z; if(x<y) {z=x;Z=y;} else if(x=y) {printf("%d",x);break;} else {z=y;Z=x;} int sz=Z/2+1; if(z<=sz) { for(n=z; n>=1 ;n--) { if(z%n==0) {if(Z%n==0) {k...
a.cc: In function 'int main()': a.cc:11:34: error: break statement not within loop or switch 11 | else if(x=y) {printf("%d",x);break;} | ^~~~~
s163904083
p02256
C++
#include<stdio.h> int main() { int x,y; scanf("%d %d",&x,&y); if(x==y) printf("%d\n",x); else { int z,Z,n,k; if(x<y) z=x,Z=y; else { z=y,Z=x; int r; for(;;) { r=Z%z; if(r==0) break; ...
a.cc: In function 'int main()': a.cc:24:2: error: expected '}' at end of input 24 | } | ^ a.cc:9:5: note: to match this '{' 9 | { | ^ a.cc:24:2: error: expected '}' at end of input 24 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s347371411
p02256
C++
#include<stdio.h> int main() { int x,y; scanf("%d %d",&x,&y); if(x==y) printf("%d\n",x); else { int z,Z,n,k; if(x<y) z=x,Z=y; else { z=y,Z=x; int r; for(;;) { r=Z%z; if(r==0) break; ...
a.cc: In function 'int main()': a.cc:25:2: error: expected '}' at end of input 25 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s211453631
p02256
C++
#include<stdio.h> int main() { int x,y; scanf("%d %d",&x,&y); if(x==y) printf("%d\n",x); else { int z,Z,n,k; if(x<y) z=x,Z=y; else { z=y,Z=x; int r; for(;;) { r=Z%z; if(r==0) break; ...
a.cc: In function 'int main()': a.cc:26:2: error: expected '}' at end of input 26 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s568943072
p02256
C++
int gcd(int x, int y) { if (x < y) { int tmp = x; x = y; y = tmp; } while (y > 0) { int r = x % y; x = y; y = r; } return x; } int main() { int x, y; std::cin >> x >> y; int ans = gcd(x, y); std::cout << ans << std::endl; return 0;...
a.cc: In function 'int main()': a.cc:19:10: error: 'cin' is not a member of 'std' 19 | std::cin >> x >> y; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | int gcd(int x, int y) a.cc:21:...
s671010618
p02256
C++
#include<bits/stdc++.h> #include<vector> #include<algorithm> using namespace std; /** * vector<int>ar(3); * for(auto&e:ar){ * scanf("%d",&e); * } * sort(ar.begin(),ar.end()) * int sum=accumulate(ar.begin(),ar.end(),0); ***/ int gcd(int a,int b){ int tmp; if(a<b){ tmp=a; a=b; ...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s816490671
p02256
C++
#include <iostream> using namespace std; int main(){ int n1,n2; vector<int> m1,m2; cin>>n1>>n2; int ans; if(n1<n2){ int temp=n2; n2=n1; n1=temp; } int a=n1%n2; for(int i=2;i<a/2+1;i++){ if(a%i==0){ if(n2%i==0&&n2>i){ ans=i; } } } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:3: error: 'vector' was not declared in this scope 6 | vector<int> m1,m2; | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include <iostream> +++ |+#include <vector> 2 | using...
s899608551
p02256
C++
import java.io.*; import java.util.StringTokenizer; class Main{ static final PrintWriter out=new PrintWriter(System.out); public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null&&!line.isEmpty(...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.StringTokenizer; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-...
s215898971
p02256
C++
// // main.cpp // ALDS1_1-B // // Created by Saicj on 2015/08/31. // Copyright (c) 2015??´ saicj. All rights reserved. // #include <iostream> #include <vector> int main() { int x, y; std::cin >> x >> y; std::vector<int> results; int count = 0; if (x > y) { count = y...
a.cc: In function 'int main()': a.cc:35:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 35 | std::sort(results.begin(), results.end()); | ^~~~ | qsort
s754457635
p02256
C++
#include <iostream> int main(){ int A=0; int B=0; int MAX=0; int OUT=0; if(A<B){ MAX=B; }else{ MAX=A; } cin >> A >> B ; for(int i=0;i<MAX;i++){ if(A%i==0){ if(B%i==0){ OUT=i; } } } cout <<OUT; }
a.cc: In function 'int main()': a.cc:17:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 17 | cin >> A >> B ; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ...
s434419508
p02256
C++
a = gets.chomp! a = a.split() for i in 0..1 a[i] = a[i].to_i end if a[0] < a[1] x = a[0] a[0] = a[1] a[1] = x end i = 0 while a[i] % a[i+1] != 0 a.push(a[i] % a[i+1]) i += 1 end puts a[-1]
a.cc:4:10: error: too many decimal points in number 4 | for i in 0..1 | ^~~~ a.cc:2:1: error: 'a' does not name a type 2 | a = gets.chomp! | ^
s775868678
p02256
C++
#include<iostream> using namespace std; int main(){ int c,d; cin>>c>>d; cout<<GCD(c,d); }
a.cc: In function 'int main()': a.cc:7:15: error: 'GCD' was not declared in this scope 7 | cout<<GCD(c,d); | ^~~
s907474323
p02256
C++
#include<iostream> using namespace std; int main(){ int c,d; cin>>c>>d; cout<<GCD(c,d); }
a.cc: In function 'int main()': a.cc:7:15: error: 'GCD' was not declared in this scope 7 | cout<<GCD(c,d); | ^~~
s616283319
p02256
C++
#include<iostream> using namespace std; int main(){ int c,d; cin>>c>>d; cout<<gcd(c,d); return 0; }
a.cc: In function 'int main()': a.cc:7:15: error: 'gcd' was not declared in this scope 7 | cout<<gcd(c,d); | ^~~
s700741428
p02256
C++
#include<iostream> using namespace std; int c,d;main(){cin>>c>>d;cout<<__gcd(c,d)<<endl;return 0;}
a.cc:3:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | int c,d;main(){cin>>c>>d;cout<<__gcd(c,d)<<endl;return 0;} | ^~~~ a.cc: In function 'int main()': a.cc:3:32: error: '__gcd' was not declared in this scope 3 | int c,d;main(){cin>>c>>d;cout<<__gcd(c,d)<<endl;r...
s295908209
p02256
C++
#include<iostream> using namespace std; int c,d;main(){cin>>c>>d;cout<<__gcd(c,d)<<endl;return 0;}
a.cc:3:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | int c,d;main(){cin>>c>>d;cout<<__gcd(c,d)<<endl;return 0;} | ^~~~ a.cc: In function 'int main()': a.cc:3:32: error: '__gcd' was not declared in this scope 3 | int c,d;main(){cin>>c>>d;cout<<__gcd(c,d)<<endl;r...
s635978668
p02256
C++
int gcd (int a, int b) { // a >= b return (b == 0) ? a : gcd(b, a%b); } int main() { int a, b; cin >> a >> b; (a > b) ? cout << gcd(a,b) : cout << gcd(b,a); cout << endl; }
a.cc: In function 'int main()': a.cc:8:3: error: 'cin' was not declared in this scope 8 | cin >> a >> b; | ^~~ a.cc:10:13: error: 'cout' was not declared in this scope 10 | (a > b) ? cout << gcd(a,b) : cout << gcd(b,a); | ^~~~ a.cc:12:11: error: 'endl' was not declared in this scope...
s119425798
p02256
C++
#include <bits/stdc++.h> int gcd(int a,int b){ if(a == b) return a; int temp = a-b; if(temp < b) swap(temp,b); return gcd(temp,b); } int main(){ int a,b; std::cin >> a >> b; if(a < b) swap(a,b); std::cout << gcd(a,b); }
a.cc: In function 'int gcd(int, int)': a.cc:6:14: error: 'swap' was not declared in this scope 6 | if(temp < b) swap(temp,b); | ^~~~ a.cc:6:14: note: suggested alternatives: In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++....
s197013691
p02256
C++
#include <iostream> using namespace std; int main() { ????????????long int x, y; long int n; long int d; cin >> x >> y; n = min(x, y); for (d = n; d > 1; d--){ if (x % d == 0 && y % d == 0) break; } cout << d << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:1: error: expected primary-expression before '?' token 7 | ????????????long int x, y; | ^ a.cc:7:2: error: expected primary-expression before '?' token 7 | ????????????long int x, y; | ^ a.cc:7:3: error: expected primary-expression before '?' token 7 | ???...
s812318442
p02256
C++
#include <iostream> using namespace std; int main() { long x,y,p,; cin >> x >>y; if(x < y) swap(x,y); while(1){ p = x % y; if (p == 0)break; swap (x,y); y = p; } cout << y << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: expected unqualified-id before ';' token 6 | long x,y,p,; | ^
s806930197
p02256
C++
#include <iostream> #include <algorithm> using namespace std; int main() { long x,y,p,; cin >> x >>y; if(x < y) swap(x,y); while(1){ p = x % y; if (p == 0)break; swap (x,y); y = p; } cout << y << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:16: error: expected unqualified-id before ';' token 8 | long x,y,p,; | ^
s526658351
p02256
C++
using System; using System.Collections.Generic; class Program { static void Main(string[] args) { Input CInput = new Input(); int[] input = new int[(int)Input.Define.MAX_ArraySize]; input = CInput.Line1_int(' ', 2); int x = 0, y = 0; if (input[0] == input[1]) ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:7:22: error: 'string' has not been declared 7 | static void Main(string[]...
s288173474
p02256
C++
#include <cstdio> #include <iostream> using namespace std; int main() { int x, y; cin >> x >> y; do { if(x>y) { x=x%y } else { y=y%x } } while(x!=y) cout << x; return 0; }
a.cc: In function 'int main()': a.cc:12:30: error: expected ';' before '}' token 12 | x=x%y | ^ | ; 13 | } | ~ a.cc:16:30: error: expected ';' before '}' token 16 | ...
s881443510
p02256
C++
while(x=!y) if(x>y){ x=x%y; if(x==0)x=x; } else{ y=y%x; if(y==0)y=y; }
a.cc:1:3: error: expected unqualified-id before 'while' 1 | while(x=!y) | ^~~~~ a.cc:6:5: error: expected unqualified-id before 'else' 6 | else{ | ^~~~
s237740839
p02256
C++
#include <stdio.h> int gcd(int x, int y) { if (y == 0) return x; if (x >= y) return gcd(y, x % y); else return gcd(x, y % x); } int main() { int x, y; scanf_s("%d %d", &x, &y); printf("%d\n", gcd(x, y)); }
a.cc: In function 'int main()': a.cc:12:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 12 | scanf_s("%d %d", &x, &y); | ^~~~~~~ | scanf
s363173586
p02256
C++
#include <bits/stdc++.h> using namespace std; int gcd(a,b) { if(a%b == 0) return b; else return gcd(b,a%b); } int main() { int a,b; cin >> a >> b; cout << gcd(a,b) << endl; return 0; }
a.cc:4:9: error: 'a' was not declared in this scope 4 | int gcd(a,b) { | ^ a.cc:4:11: error: 'b' was not declared in this scope 4 | int gcd(a,b) { | ^ a.cc:4:12: error: expression list treated as compound expression in initializer [-fpermissive] 4 | int gcd(a,b) { | ...
s162215638
p02256
C++
#include<stdio.h> #include<iostream> #include<algorithm> using namespace std; int main(){ int x,y; cin>>x>>y; int gcd=2; while(int i=2;i<max(x,y);i++){ if(x%i==0 && y%i==0 && i<gcd){ gcd=i; break; } } cout<<gcd<<endl; return 0; }
a.cc: In function 'int main()': a.cc:14:14: error: expected ')' before ';' token 14 | while(int i=2;i<max(x,y);i++){ | ~ ^ | ) a.cc:14:15: error: 'i' was not declared in this scope 14 | while(int i=2;i<max(x,y);i++){ | ^
s606621792
p02256
C++
#include<stdio.h> #include<iostream> #include<algorithm> using namespace std; int main(){ int x,y; int p=1; cin>>x>>y; while(1){ dx=x; x=y; y=dx%y; if(y==0)break; } cout<<y<<endl; return 0; }
a.cc: In function 'int main()': a.cc:16:1: error: 'dx' was not declared in this scope; did you mean 'x'? 16 | dx=x; | ^~ | x
s922922319
p02256
C++
#include<stdio.h> #include<iostream> using namespace std; int main(){ int x,y; int p=1; cin>>x>>y; while(1){ dx=x; x=y; y=dx%y; if(y==0)break; } cout<<y<<endl; return 0; }
a.cc: In function 'int main()': a.cc:15:1: error: 'dx' was not declared in this scope; did you mean 'x'? 15 | dx=x; | ^~ | x
s077503125
p02256
C++
int call(int,int); int main(){ int x,y; scanf("%d %d",&x,&y); printf("%d\n",call(x,y)); return 0; } int call(int x,int y){ if(x%y) return call(y,x%y); else return y; }
a.cc: In function 'int main()': a.cc:7:9: error: 'scanf' was not declared in this scope 7 | scanf("%d %d",&x,&y); | ^~~~~ a.cc:9:9: error: 'printf' was not declared in this scope 9 | printf("%d\n",call(x,y)); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cs...
s481735126
p02256
C++
#include<iostream> #include<cmath> using namespace std; void gcd(int x, int y){ int X = max(x,y); int Y = min(x,y); int mod = X % Y; if(mod == 0) return Y; else return gcd(Y, X % Y); } int main(){ int x, y; cin >> x >> y; cout << gcd(x,y) << "\n"; }
a.cc: In function 'void gcd(int, int)': a.cc:9:12: error: return-statement with a value, in function returning 'void' [-fpermissive] 9 | return Y; | ^ a.cc: In function 'int main()': a.cc:17:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} a...
s870833752
p02256
C++
#include <iostream> int main() { int a, b, c; cin >> a >> b; while(1) { c = a % b; if(c == 0) { cout << b << endl; break; } else{ a = b; b = c; } } return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin >> a >> b; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Li...
s586586372
p02256
C++
#include <stdio.h> int main() { int a, b, c; scanf ("%d %d", &a, &b); if (a = b) { printf ("%d", a); } else if (a > b) { while (b > 0) { c = a % b; a = b; b = c; } printf ("%d", a); } else if (a < b) { while (a > 0) { c = b % a; ...
a.cc:21:15: warning: missing terminating " character 21 | printf ("%d, b); | ^ a.cc:21:15: error: missing terminating " character 21 | printf ("%d, b); | ^~~~~~~~ a.cc: In function 'int main()': a.cc:22:4: error: expected primary-expression before '}' token 2...
s504772908
p02256
C++
#include <stdio.h> #include <algorithm> int main(void){ int x, y; scanf("%d, %d\n", x, y); gcd(x, y){ if (x < y) swap(x, y) while (y > 0){ r = x % y; x = y; y = r; } return x; } printf("%d\n", x);
a.cc: In function 'int main()': a.cc:8:3: error: 'gcd' was not declared in this scope 8 | gcd(x, y){ | ^~~ a.cc:19:19: error: expected '}' at end of input 19 | printf("%d\n", x); | ^ a.cc:4:15: note: to match this '{' 4 | int main(void){ | ^
s405141192
p02256
C++
#include<stdio.h> int main(){ int a,b,lar,sma; scanf("%d %d",&a,&b); if(a>=b){ lar=a; sma=b; }else{ lar=b; sma=a; } int ama=lar%sma; while(ama!=0){ lar=sma; sma=ama: } printf("%d",&sma); return 0; }
a.cc: In function 'int main()': a.cc:21:24: error: expected ';' before ':' token 21 | sma=ama: | ^ | ;
s546179692
p02256
C++
#include <stdio.h> #include <algorithm> int main(void){ int x, y; scanf("%d, %d\n", x, y); gcd(x, y){ if (x < y) swap(x, y); while (y > 0){ r = x % y; x = y; y = r; } return x; } printf("%d\n", x);
a.cc: In function 'int main()': a.cc:8:3: error: 'gcd' was not declared in this scope 8 | gcd(x, y){ | ^~~ a.cc:19:19: error: expected '}' at end of input 19 | printf("%d\n", x); | ^ a.cc:4:15: note: to match this '{' 4 | int main(void){ | ^
s112061378
p02256
C++
#include<stdio.h> int main(){ int a,b,lar,sma; scanf("%d %d",&a,&b); if(a>=b){ lar=a; sma=b; }else{ lar=b; sma=a; } int ama=lar%sma; while(ama!=0){ lar=sma; sma=ama: } printf("%d\n",&sma); return 0; }
a.cc: In function 'int main()': a.cc:21:24: error: expected ';' before ':' token 21 | sma=ama: | ^ | ;
s706689034
p02256
C++
#include <stdio.h> #include <algorithm> int main(void){ int x, y; scanf("%d, %d\n", x, y); gcd(x, y){ if (x < y) swap(x, y); while (y > 0){ r = x % y; x = y; y = r; return x; } } printf("%d\n", x);
a.cc: In function 'int main()': a.cc:8:3: error: 'gcd' was not declared in this scope 8 | gcd(x, y){ | ^~~ a.cc:20:19: error: expected '}' at end of input 20 | printf("%d\n", x); | ^ a.cc:4:15: note: to match this '{' 4 | int main(void){ | ^
s800760685
p02256
C++
#include<stdio.h> int main(){ int a,b,lar,sma; scanf("%d %d",&a,&b); if(a>=b){ lar=a; sma=b; }elseif(b>a){ lar=b; sma=a; } int ama=lar%sma; while(ama!=0){ lar=sma; sma=ama: } printf("%d\n",&sma); return 0; }
a.cc: In function 'int main()': a.cc:12:10: error: 'elseif' was not declared in this scope 12 | }elseif(b>a){ | ^~~~~~ a.cc:21:24: error: expected ';' before ':' token 21 | sma=ama: | ^ | ;
s854997321
p02256
C++
#include <stdio.h> int main() { int x, y, z, i; scanf("%d %d",&x ,&y); x= x % y; for(i=1;i<=y;i++){ if(x % i == 0 && y % i ==0) z=i; printf("%d\n",z); break; return 0; }
a.cc: In function 'int main()': a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:3:1: note: to match this '{' 3 | { | ^
s734189085
p02256
C++
#include <stdio.h> #include <algorithm> int main(void){ int x, y; scanf("%d, %d\n", x, y); gcd(x, y){ if (x < y) swap(x, y); while (y > 0){ r = x % y; x = y; y = r; return x; } } printf("%d\n", x); return 0; }
a.cc: In function 'int main()': a.cc:8:3: error: 'gcd' was not declared in this scope 8 | gcd(x, y){ | ^~~
s266480376
p02256
C++
#include<stdio.h> int main(){ int a,b,lar,sma,ama; scanf("%d %d",&a,&b); if(a>=b){ lar=a; sma=b; }elseif(b>a){ lar=b; sma=a; } while((ama=lar%sma)!=0){ lar=sma; sma=ama: } printf("%d\n",&sma); return 0; }
a.cc: In function 'int main()': a.cc:12:10: error: 'elseif' was not declared in this scope 12 | }elseif(b>a){ | ^~~~~~ a.cc:21:24: error: expected ';' before ':' token 21 | sma=ama: | ^ | ;
s576096925
p02256
C++
#include<stdio.h> int main(){ int a,b,lar,sma,ama; scanf("%d %d",&a,&b); if(a>=b){ lar=a; sma=b; }else if(b>a){ lar=b; sma=a; } while((ama=lar%sma)!=0){ lar=sma; sma=ama: } printf("%d\n",&sma); return 0; }
a.cc: In function 'int main()': a.cc:21:24: error: expected ';' before ':' token 21 | sma=ama: | ^ | ;
s639383681
p02256
C++
#include<stdio.h> int main(){ int a,b,lar,sma,ama; scanf("%d %d",&a,&b); if(a>=b){ lar=a; sma=b; }else if(b>a){ lar=b; sma=a; } while((ama=lar%sma)!=0){ lar=sma; sma=ama: } printf("%d\n",&sma); }
a.cc: In function 'int main()': a.cc:21:24: error: expected ';' before ':' token 21 | sma=ama: | ^ | ;
s907167167
p02256
C++
#include <stdio.h> int main(void) { int x, y, r, tmp; scanf("%d",&x) scanf("%d", &y); if(a<b){ tmp = x; x = y ; y = tmp; } r=a%b; while(r!=0){ x = y; y = r; r = x % y; } printf("%d",b); return 0 ; }
a.cc: In function 'int main()': a.cc:7:18: error: expected ';' before 'scanf' 7 | scanf("%d",&x) | ^ | ; 8 | scanf("%d", &y); | ~~~~~ a.cc:10:7: error: 'a' was not declared in this scope 10 | if(a<b){ | ^ a.cc:10:9: error: ...
s154236894
p02256
C++
#include <stdio.h> int main(void) { int x, y, r, tmp; scanf("%d",&x); scanf("%d", &y); if(a<b){ tmp = x; x = y ; y = tmp; } r=a%b; while(r!=0){ x = y; y = r; r = x % y; } printf("%d",b); return 0 ; }
a.cc: In function 'int main()': a.cc:10:7: error: 'a' was not declared in this scope 10 | if(a<b){ | ^ a.cc:10:9: error: 'b' was not declared in this scope 10 | if(a<b){ | ^ a.cc:15:7: error: 'a' was not declared in this scope 15 | r=a%b; | ^ a.cc:15:9: error: 'b...
s019563831
p02256
C++
#include <stdio.h> int main(void) { int x, y, r, tmp; scanf("%d",&x); scanf("%d",&y); if(a<b){ tmp = x; x = y ; y = tmp; } r=a%b; while(r!=0){ x = y; y = r; r = x % y; } printf("%d",y); return 0 ; }
a.cc: In function 'int main()': a.cc:9:7: error: 'a' was not declared in this scope 9 | if(a<b){ | ^ a.cc:9:9: error: 'b' was not declared in this scope 9 | if(a<b){ | ^ a.cc:14:7: error: 'a' was not declared in this scope 14 | r=a%b; | ^ a.cc:14:9: error: 'b' ...
s629092668
p02256
C++
#include <stdio.h> int main(void) { int x, y, r, tmp; scanf("%d",&x); scanf("%d",&y); if(a<b){ tmp = x; x = y ; y = tmp; } r=x%y; while(r!=0){ x = y; y = r; r = x % y; } printf("%d",y); return 0 ; }
a.cc: In function 'int main()': a.cc:9:7: error: 'a' was not declared in this scope 9 | if(a<b){ | ^ a.cc:9:9: error: 'b' was not declared in this scope 9 | if(a<b){ | ^
s442540787
p02256
C++
#include <stdio.h> #include <algorithm> int main(void){ int x, y, z; scanf("%d, %d\n", x, y); z = gcd(x, y); printf("%d\n", z); return 0; } int gcd(x, y){ if (x < y) swap(x, y); while (y > 0){ r = x % y; x = y; y = r; return x; } } return 0; }
a.cc: In function 'int main()': a.cc:7:7: error: 'gcd' was not declared in this scope 7 | z = gcd(x, y); | ^~~ a.cc: At global scope: a.cc:14:9: error: 'x' was not declared in this scope 14 | int gcd(x, y){ | ^ a.cc:14:12: error: 'y' was not declared in this scope 14 | int gcd(x, y...
s174824925
p02256
C++
#include <stdio.h> #include <algorithm> int main(void){ int x, y, z; scanf("%d, %d\n", x, y); z = gcd(x, y); printf("%d\n", z); return 0; } int gcd(x, y){ int r; if (x < y) swap(x, y); while (y > 0){ r = x % y; x = y; y = r; return x; } } return 0; }
a.cc: In function 'int main()': a.cc:7:7: error: 'gcd' was not declared in this scope 7 | z = gcd(x, y); | ^~~ a.cc: At global scope: a.cc:14:9: error: 'x' was not declared in this scope 14 | int gcd(x, y){ | ^ a.cc:14:12: error: 'y' was not declared in this scope 14 | int gcd(x, y...
s945355030
p02256
C++
#include <stdio.h> int main(void) { int x, y; scanf("%d %d", &x, &y); if(x > y){ while(y > 0){ r = x % y x = y y = r } printf("%d\n", x); } if(y > x){ while(x > 0){ r = y % x y = x x = r } printf("%d\n", x); } return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'r' was not declared in this scope 8 | r = x % y | ^ a.cc:16:9: error: 'r' was not declared in this scope 16 | r = y % x | ^
s505319176
p02256
C++
#include <stdio.h> int main(void) { int x, y, r; scanf("%d %d", &x, &y); if(x > y){ while(y > 0){ r = x % y x = y y = r } printf("%d\n", x); } if(y > x){ while(x > 0){ r = y % x y = x x = r } printf("%d\n", x); } return 0; }
a.cc: In function 'int main()': a.cc:8:18: error: expected ';' before 'x' 8 | r = x % y | ^ | ; 9 | x = y | ~ a.cc:16:18: error: expected ';' before 'y' 16 | r = y % x | ^ | ...
s850307324
p02256
C++
#include <stdio.h> #include <algorithm> int main(void){ int x, y, z; scanf("%d, %d\n", x, y); z = gcd(x, y); printf("%d\n", z); return 0; } int gcd(x, y){ int r; if (x < y) swap(x, y); while (y > 0){ r = x % y; x = y; y = r; } return x; } return ...
a.cc: In function 'int main()': a.cc:7:7: error: 'gcd' was not declared in this scope 7 | z = gcd(x, y); | ^~~ a.cc: At global scope: a.cc:14:9: error: 'x' was not declared in this scope 14 | int gcd(x, y){ | ^ a.cc:14:12: error: 'y' was not declared in this scope 14 | int gcd(x, y...
s805239569
p02256
C++
#include <stdio.h> int main(void) { int x, y, r; scanf("%d %d", &x, &y); if(x > y){ while(y > 0){ r = x % y x = y y = r } printf("%d\n", x); } if(y > x){ while(x > 0){ r = y % x y = x x = r } printf("%d\n", y); } return 0; }
a.cc: In function 'int main()': a.cc:8:18: error: expected ';' before 'x' 8 | r = x % y | ^ | ; 9 | x = y | ~ a.cc:16:18: error: expected ';' before 'y' 16 | r = y % x | ^ | ...
s515944972
p02256
C++
#include <stdio.h> #include <algorithm> int main(void){ int x, y, z; scanf("%d, %d\n", x, y); z = gcd(x, y); printf("%d\n", z); return 0; } int gcd(x, y){ int r; if (x < y) swap(x, y); while (y > 0){ r = x % y; x = y; y = r; } return x; }
a.cc: In function 'int main()': a.cc:7:7: error: 'gcd' was not declared in this scope 7 | z = gcd(x, y); | ^~~ a.cc: At global scope: a.cc:14:9: error: 'x' was not declared in this scope 14 | int gcd(x, y){ | ^ a.cc:14:12: error: 'y' was not declared in this scope 14 | int gcd(x, y...
s787662952
p02256
C++
#include<stdio.h> int main(){ int a,b,lar,sma,ama; scanf("%d %d",&a,&b); if(a>=b){ lar=a; sma=b; }else if(b>a){ lar=b; sma=a; } while((ama=lar%sma)!=0){ lar=sma; sma=ama: } printf("%d\n",&sma); return 0; }
a.cc: In function 'int main()': a.cc:21:24: error: expected ';' before ':' token 21 | sma=ama: | ^ | ;
s939650707
p02256
C++
#include <stdio.h> #include <algorithm> int gcd(int, int); int main(){ int x, y, z; scanf("%d, %d\n", x, y); z = gcd(x, y); printf("%d\n", z); return 0; } int gcd(int x,int y){ int r; if (x < y) swap(x, y); while (y > 0){ r = x % y; x = y; y = r; } ret...
a.cc: In function 'int gcd(int, int)': a.cc:19:9: error: 'swap' was not declared in this scope 19 | swap(x, y); | ^~~~ a.cc:19:9: note: suggested alternatives: In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, ...
s616185734
p02256
C++
#include <stdio.h> #include <algorithm> int gcd(int, int); int main(){ int x, y, z; scanf("%d %d", &x, &y); z = gcd(x, y); printf("%d\n", z); return 0; } int gcd(int x,int y){ int r; if (x > y) swap(x, y); while (y > 0){ r = x % y; x = y; y = r; } return...
a.cc: In function 'int gcd(int, int)': a.cc:19:6: error: 'swap' was not declared in this scope 19 | swap(x, y); | ^~~~ a.cc:19:6: note: suggested alternatives: In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, fr...
s915306852
p02256
C++
#include <stdio.h> #include <algorithm> int gcd(int, int); int main(){ int x, y, z; scanf("%d %d", &x, &y); z = gcd(x, y); printf("%d\n", z); return 0; } int gcd(int x,int y){ int r; if (x > y) swap(x, y) while (y > 0){ r = x % y; x = y; y = r; } return ...
a.cc: In function 'int gcd(int, int)': a.cc:19:6: error: 'swap' was not declared in this scope 19 | swap(x, y) | ^~~~ a.cc:19:6: note: suggested alternatives: In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, fro...
s244008921
p02256
C++
#include <stdio.h> #include <algorithm> int gcd(int, int); int main(){ int x, y, z; scanf("%d %d", &x, &y); z = gcd(x, y); printf("%d\n", z); return 0; } int gcd(int x,int y){ int r; if (x < y) swap(x, y); while (y > 0){ r = x % y; x = y; y = r; } return...
a.cc: In function 'int gcd(int, int)': a.cc:19:6: error: 'swap' was not declared in this scope 19 | swap(x, y); | ^~~~ a.cc:19:6: note: suggested alternatives: In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, fr...
s959446099
p02256
C++
#include <stdio.h> #include <algorithm> int gcd(int, int); int main(){ int x, y, z; scanf("%d %d", &x, &y); z = gcd(x, y); printf("%d\n", z); return 0; } int gcd( x, y){ int r; while (y > 0){ r = x % y; x = y; y = r; } return x; }
a.cc:16:10: error: 'int gcd' redeclared as different kind of entity 16 | int gcd( x, y){ | ^ a.cc:4:5: note: previous declaration 'int gcd(int, int)' 4 | int gcd(int, int); | ^~~ a.cc:16:10: error: 'x' was not declared in this scope 16 | int gcd( x, y){ | ^ a.cc:16:13: ...
s988714030
p02256
C++
#include <stdio.h> int main() { int x, y, z, i; scanf("%d %d",&x ,&y); if(x >= y){ x= x % y; } else{ z=x; x=y % x; y=z; } for(i=y;i>=1;i--){ if(x % i == 0 y % i == 0){ printf("%d\n",i); break; } } return 0; }
a.cc: In function 'int main()': a.cc:17:14: error: expected ')' before 'y' 17 | if(x % i == 0 y % i == 0){ | ~ ^~ | )
s545608800
p02256
C++
#include <stdio.h> int main() { int x, y, r, i; scanf("%d %d",&x ,&y); if(x >= y){ while0(r>0){ r= x % y; x=r; y=x; } else{ while(r>0){ r=y%x; y=x; x=r; } for(i=y;i>=1;i--){ if(x % i == 0 && y % i == 0){ printf("%d\n",i); break; } } return 0; }
a.cc: In function 'int main()': a.cc:7:1: error: 'while0' was not declared in this scope 7 | while0(r>0){ | ^~~~~~ a.cc:12:1: error: expected '}' before 'else' 12 | else{ | ^~~~ a.cc:6:11: note: to match this '{' 6 | if(x >= y){ | ^ a.cc:27:2: error: expected '}' at end of input ...
s191548409
p02256
C++
#include <stdio.h> int main() { int x, y, r, i; scanf("%d %d",&x ,&y); if(x >= y){ while0(r>0){ r= x % y; x=r; y=x; } else{ while(r>0){ r=y%x; y=x; x=r; }} for(i=y;i>=1;i--){ if(x % i == 0 && y % i == 0){ printf("%d\n",i); break; } } return 0; }
a.cc: In function 'int main()': a.cc:7:1: error: 'while0' was not declared in this scope 7 | while0(r>0){ | ^~~~~~ a.cc:12:1: error: expected '}' before 'else' 12 | else{ | ^~~~ a.cc:6:11: note: to match this '{' 6 | if(x >= y){ | ^
s174107469
p02256
C++
#include <stdio.h> int main() { int x, y, r, i; scanf("%d %d",&x ,&y); if(x >= y){ while0(r>0){ r= x % y; x=r; y=x; }} else{ while(r>0){ r=y%x; y=x; x=r; }} for(i=y;i>=1;i--){ if(x % i == 0 && y % i == 0){ printf("%d\n",i); break; } } return 0; }
a.cc: In function 'int main()': a.cc:7:1: error: 'while0' was not declared in this scope 7 | while0(r>0){ | ^~~~~~
s023296661
p02256
C++
#include <stdio.h> int main() { int x, y, r, i; scanf("%d %d",&x ,&y); if(x >= y){ while0(r>0){ r= x % y; x=r; y=x; }} else{ while(r>0){ r=y%x; y=x; x=r; }} for(i=y;i>=1;i--){ if(x % i == 0 && y % i == 0){ printf("%d\n",i); break; } } return 0; }
a.cc: In function 'int main()': a.cc:7:1: error: 'while0' was not declared in this scope 7 | while0(r>0){ | ^~~~~~
s599992952
p02256
C++
#include <stdio.h> int main() { int a,b,gcd; scanf ("%d %d ", &a, &b); if (a >= b) { gcd = a % b; } if (b >= a) { gcd = b % a; printf("%d\n", gcd); return 0; }
a.cc: In function 'int main()': a.cc:18:2: error: expected '}' at end of input 18 | } | ^ a.cc:3:12: note: to match this '{' 3 | int main() { | ^
s242296863
p02256
C++
include <stdio.h> int main() { int a,b,gcd; scanf ("%d %d", &a, &b); if (a >= b) { gcd = a % b; } if (b >= a) { gcd = b % a; printf("%d\n", gcd); return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include <stdio.h> | ^~~~~~~
s848326060
p02256
C++
#include <stdio.h> int main() { int a,b,d,gcd; scanf ("%d %d", &a, &b); if (a >= b) { d = a % b; if (d % b = 0) { gcd = d; } else { gcd = 1; } } if (b >= a) { d = b % a; if (d % a = 0) { gcd = d; } else { gcd = 1; } } printf("%d\n", gcd); return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: lvalue required as left operand of assignment 10 | if (d % b = 0) { | ~~^~~ a.cc:20:9: error: lvalue required as left operand of assignment 20 | if (d % a = 0) { | ~~^~~
s617022816
p02256
C++
#include <stdio.h> int main() { int a,b,d,gcd; scanf ("%d %d", &a, &b); if (a >= b) { d = a % b; if (b % d = 0) { gcd = d; } else { gcd = 1; } } if (b >= a) { d = b % a; if (a % d = 0) { gcd = d; } else { gcd = 1; } } printf("%d\n", gcd); return 0; }
a.cc: In function 'int main()': a.cc:10:9: error: lvalue required as left operand of assignment 10 | if (b % d = 0) { | ~~^~~ a.cc:20:9: error: lvalue required as left operand of assignment 20 | if (a % d = 0) { | ~~^~~
s729357775
p02256
C++
#include "stdafx.h" #include <iostream> #include <sstream> using namespace std; int gcd(int x, int y); int main() { string str; getline(cin, str); stringstream ss_size(str); int ary[2]; string buff; int cnt = 0; while (getline(ss_size, buff, ' ')) { stringstream ss(buff); ss >> ary[cnt]; cnt++; } /...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s068014344
p02256
C++
#include <iostream> using namespace std; int main() { int xi, yi, n, a[n], x, y; cin >>xi >>yi; if (xi<yi){x=yi; y=xi} else {x=xi; y=yi;} a[1]=x%y; if(a[1]!=0) { a[2]=y%a[1]; if(a[2]!=0) { for(;;) { a[n]=a[n-1]%a[n-2]; if(a[n-2]=0)break; } cout << a[n-1] <<'\n'; } else cou...
a.cc: In function 'int main()': a.cc:8:30: error: expected ';' before '}' token 8 | if (xi<yi){x=yi; y=xi} | ^ | ;
s695319191
p02256
C++
x, y = map(int, input().split()) while y>0: x, y = y, x%y print(x)
a.cc:1:1: error: 'x' does not name a type 1 | x, y = map(int, input().split()) | ^
s303581153
p02256
C++
#include<stdio.h> int gcd(int x, int y){ return (x%y>0 || x>Y) ? gcd(y, x%y) : y; } int main(){ int x, y; int w; scanf("%d %d", &x, &y); w = gcd(x, y); printf("%d\n", w); }
a.cc: In function 'int gcd(int, int)': a.cc:3:24: error: 'Y' was not declared in this scope 3 | return (x%y>0 || x>Y) ? gcd(y, x%y) : y; | ^
s378404298
p02256
C++
void swap(int *x, int *y) { int tmp; tmp = *x; *x = *y; *y = tmp; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s531799552
p02256
C++
void swap(int *x, int *y) { int tmp; tmp = *x; *x = *y; *y = tmp; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s594746994
p02256
C++
void swap(int *x, int *y) { int tmp; tmp = *x; *x = *y; *y = tmp; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s804164066
p02256
C++
void swap(int *x, int *y) { int tmp; tmp = *x; *x = *y; *y = tmp; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s356445280
p02256
C++
#Include <stdio.h> #include <stdlib.h> int main(){ int a,b,c,r,x,y,flag; scanf("%d%d",&a,&b); if(a == b){ printf("%d\n",a); exit(1); } else if(a > b){ flag = 0; c = b; } else{ c = a; flag = 1; } if(flag == 0) r = a % b; if(flag == 1) r = b % a; while(1){ x = c %...
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include? 1 | #Include <stdio.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:8:3: error: 'scanf' was not declared in this scope 8 | scanf("%d%d",&a,&b); | ^~~~~ a.cc:11:5: error: 'printf' was not declare...
s851037555
p02256
C++
#include <iostream> using namespace std; int GCD(int a, int b){ while (b) { temp = b; b = a % b; a = temp; } return a; } int main() { int i,j,k; cin>>i>>j; if (i>=j){ k=GCD(i,j); }else{ k=GCD(j,i); } cout<<k<<endl; return 0; }
a.cc: In function 'int GCD(int, int)': a.cc:5:9: error: 'temp' was not declared in this scope; did you mean 'tm'? 5 | temp = b; | ^~~~ | tm
s017784440
p02256
C++
#include <stdio.h> int main(void){ int x; int y; int i; scanf("%d %d",&x,&y); if(x>y){ int max=y; for(i=0;i<y;i++){ if(x%max==0&&y%max==0){ printf("%d\n",max); exit(0); } max--; } }else{ int max=x; for(i=0;i<x;i++){ if(x%max==0&&y%max==0){ printf("%d\...
a.cc: In function 'int main()': a.cc:13:1: error: 'exit' was not declared in this scope 13 | exit(0); | ^~~~ a.cc:2:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' 1 | #include <stdio.h> +++ |+#include <cstdlib> 2 | int main(void){ a.cc:22:1: ...
s194787085
p02256
C++
#include <cstdio> int main(void){ int x; int y; int i; scanf("%d %d",&x,&y); if(x>y){ int max=y; for(i=0;i<y;i++){ if(x%max==0&&y%max==0){ printf("%d\n",max); exit(0); } max--; } }else{ int max=x; for(i=0;i<x;i++){ if(x%max==0&&y%max==0){ printf("%d\n...
a.cc: In function 'int main()': a.cc:13:1: error: 'exit' was not declared in this scope 13 | exit(0); | ^~~~ a.cc:2:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' 1 | #include <cstdio> +++ |+#include <cstdlib> 2 | int main(void){ a.cc:22:1: e...
s300988874
p02256
C++
#include <bits/stdc++.h> using namespace std; __int64 gcd(__int64 a,__int64 b) { if(0==b) return a; return gcd(b, a%b); } int main() { __int64 a, b; scanf("%I64d %I64d", &a, &b); printf("%I64d\n", gcd(a,b)); return 0; }
a.cc:5:2: error: '__int64' does not name a type; did you mean '__int64_t'? 5 | __int64 gcd(__int64 a,__int64 b) | ^~~~~~~ | __int64_t a.cc: In function 'int main()': a.cc:13:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'? 13 | __int64 a, b; | ^~~~~...
s683377283
p02256
C++
#include <bits/stdc++.h> int gcd(int a,int b){ if(b==0)return a;else return gcd(y,x%y); } int main() { int a,b;cin>>a>>b; cout<<gcd(a,b)<<endl; }
a.cc: In function 'int gcd(int, int)': a.cc:3:56: error: 'y' was not declared in this scope 3 | int gcd(int a,int b){ if(b==0)return a;else return gcd(y,x%y); } | ^ a.cc:3:58: error: 'x' was not declared in this scope 3 | int gcd(int a,int b){ if(b==0...
s057301494
p02256
C++
#include <bits/stdc++.h> int gcd(int a,int b){ if(b==0)return a;else return gcd(b,a%b); } int main() { int a,b;cin>>a>>b; cout<<gcd(a,b)<<endl; }
a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | int a,b;cin>>a>>b; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream...
s416143925
p02256
C++
#include<iostream> using namespace std; int gcd(int x, int y) { if (y == 0) return x; if (x > y) gcd(y, x%y); } void main() { int x, y; cin >> x >> y; cout << gcd(x, y); }
a.cc:10:1: error: '::main' must return 'int' 10 | void main() | ^~~~ a.cc: In function 'int gcd(int, int)': a.cc:9:1: warning: control reaches end of non-void function [-Wreturn-type] 9 | } | ^
s835417262
p02256
C++
include <iostream> using namespace std; int main() { int ans; int x, y; cin >> x >> y; while (x % y != 0) { int tmp = x; x = y; y = tmp % y; } cout << y << endl; }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:8:3: error: 'cin' was not declared in this scope 8 | cin >> x >> y; | ^~~ a.cc:16:3: error: 'cout' was not declared in this scope 16 | cout << y << endl; | ^~~~ a.cc...
s472712379
p02256
C++
#include <cstdio> using namespace std; int gcd(x,y){ if(y>x){ int t = x; x = y; y = t; } if(y==0){ return x; }else{ return gcd(y,x%y); } } int main(){ int a,b; scanf("%d %d",&a,&b); printf("%d",gcd(a,b)); }
a.cc:4:9: error: 'x' was not declared in this scope 4 | int gcd(x,y){ | ^ a.cc:4:11: error: 'y' was not declared in this scope 4 | int gcd(x,y){ | ^ a.cc:4:12: error: expression list treated as compound expression in initializer [-fpermissive] 4 | int gcd(x,y){ | ...
s952436253
p02256
C++
#include <iostream> using namespase std; gcd(int a, int b){ if(b == 0) return a; return gcd(b , a%b); } int main(void){ int x, y; cin >> x >> y; cout << gcd(x,y) << endl; return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'namespase' 2 | using namespase std; | ^~~~~~~~~ a.cc:4:1: error: ISO C++ forbids declaration of 'gcd' with no type [-fpermissive] 4 | gcd(int a, int b){ | ^~~ a.cc: In function 'int main()': a.cc:13:5: error: 'cin' was not declared in thi...
s914148909
p02256
C++
#include <iostream> #include <algorithm> int main() { int x,y,maxi = 1; cin >> x >> y; if(x < y) swap(x,y); for(int d = 1; d <= (x%y); d++) { if(y % d == 0 && (x%y) % d == 0) maxi =d; } cout << maxi; return 0; }
a.cc: In function 'int main()': a.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin >> x >> y; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ...
s660363698
p02256
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define rrep(i,n) for (int i=n;^i;i--) #define ALL(v) v.begin(),v.end() // #define int ll #define eps 1e-9 #define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0])) template<class T> inline void chmax(T &a, const T &b) { if(a < b)...
a.cc:26:2: error: expected class-name at end of input 26 | ~ | ^ a.cc: In function 'int gcd(int, int)': a.cc:24:12: warning: control reaches end of non-void function [-Wreturn-type] 24 | gcd(b,a%b); | ~~~^~~~~~~
s641432836
p02256
C++
#include <iostream> #include <stdio.h> using namespace std; int main() { int x; int y; int big; int small; int tmp; scanf("%d%d",&x,&y); if(x>y){ big = x; small = y; }else{ big = y; small = x; } while(small != 0){ tmp = small; small = big % small; big = tmp; } printf("%d\n",big) return 0; }
a.cc: In function 'int main()': a.cc:24:27: error: expected ';' before 'return' 24 | printf("%d\n",big) | ^ | ; 25 | return 0; | ~~~~~~
s166755604
p02256
C++
#include<iostream> using namespace std; int main(){ int a[100000]={0},b[100000]={0},sa=0;sb=0,A; int x,y,n=1,; cin>>x; while(true){ if(x%n==0){ if(x/n<n) break; a[n]=1; a[x/n]=1; sa+=2; if(x/n==n) sa--; } if(x==n) break; n++; } n=1; cin>>y; while(true){ if(y%n==0){ if(y/n<n) break; b[n]=1; b[y/n]=1; sb+=2; if(y/n=...
a.cc: In function 'int main()': a.cc:4:38: error: 'sb' was not declared in this scope; did you mean 'sa'? 4 | int a[100000]={0},b[100000]={0},sa=0;sb=0,A; | ^~ | sa a.cc:4:43: error: 'A' was not declared in this scope 4 | int ...
s509193105
p02256
C++
#include<iostream> using namespace std; int USCLN(int a, int b) { a=Math.Abs(a); b=Math.Abs(b); if (a==0 ||b==0) return a+b; while (a!=b) { if(a>b) a=a-b; els...
a.cc: In function 'int USCLN(int, int)': a.cc:5:15: error: 'Math' was not declared in this scope 5 | a=Math.Abs(a); | ^~~~
s048463857
p02256
C++
#include<iostream> using namespace std; int a,b; gcd(int a,int b) { if(b==0) return a; return gcd(b,a%b); } int main() { cin>>a>>b; cout<<gcd(a,b); return 0; }
a.cc:4:1: error: ISO C++ forbids declaration of 'gcd' with no type [-fpermissive] 4 | gcd(int a,int b) | ^~~