submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s621428753
p00005
C
#include<stdio.h> int main(void) { long long a, b, sum, temp; while(scanf("%lld %lld",&a,&b) { if(a < b){ temp = a; a = b; b = temp; } sum = a * b; while(b != 0) { a %= b; temp = a; a = b; b = temp; } printf("%lld %lld\n",a,sum/a); } return 0; }
main.c: In function 'main': main.c:6:39: error: expected ')' before '{' token 6 | while(scanf("%lld %lld",&a,&b) | ~ ^ | ) 7 | { | ~ main.c:24:1: error: expected expression before '}' token 24 | } | ^
s521280412
p00005
C
#include<stdio.h> int max(int,int); int min(int,int); int main(){ int n,m; while(scanf("%d %d",&n,&m)!=EOF){ printf("%d %d\n",max(n,m),min(n,m)); } return 0; } int max(int n,int m){ int tmp,i,j,num=0; if(n>m){ tmp=n; n=m; m=tmp; } for(i=2;i<n;i++){ if(n%i==0&&m%i==0){ num=i; } } return num; } int min(int n,int m){ int i,j=1,num=0,tmp; for(i=1;;i++){ for(j;;j++){ if(i*m==j*n){ num=i*m; } if(m*i<n*j){ break; } } if(num!=0){ break; } } return num;
main.c: In function 'min': main.c:40:3: error: expected declaration or statement at end of input 40 | return num; | ^~~~~~
s008053849
p00005
C
#include <stdio.h> int gcd(int n1, int n2) { int n3; while (n1 != 0){ n3 = n2; n2 = n1; n1 = n3 % n2; } return n2; } int main(void) { int a[1000], b[1000]; int i; i = 0; while (scanf("%d%d", &a[i], &b[i]) != EOF){ i++; } for (j = 0; j < i; j++){ printf("%d %d\n", gcd(a[j], b[j]), (a[j] * b[j] /gcd(a[j], b[j]))); } return 0; }
main.c: In function 'main': main.c:26:8: error: 'j' undeclared (first use in this function) 26 | for (j = 0; j < i; j++){ | ^ main.c:26:8: note: each undeclared identifier is reported only once for each function it appears in
s829297676
p00005
C
#include <stdio.h> unsigned int gcd(unsigned int n1, unsigned int n2) { &#160; unsigned int n3; &#160; while (n1 != 0){ &#160; &#160; n3 = n2; &#160; &#160; n2 = n1; &#160; &#160; n1 = n3 % n2; &#160; } &#160; return n2; } int main(void) { &#160; unsigned int a, b; &#160; unsigned int i, j; &#160; i = 0; &#160; while (scanf("%d%d", &a, &b) != EOF){ &#160; &#160; printf("%d %d\n", gcd(a, b), (a / gcd(a, b) * b)); // bを後で掛けないとオーバーフローする。 &#160; } &#160; return 0; }
main.c: In function 'gcd': main.c:8:2: error: stray '#' in program 8 | &#160; unsigned int n3; | ^ main.c:8:1: error: lvalue required as unary '&' operand 8 | &#160; unsigned int n3; | ^ main.c:13:2: error: stray '#' in program 13 | &#160; while (n1 != 0){ | ^ main.c:13:1: error: lvalue required as unary '&' operand 13 | &#160; while (n1 != 0){ | ^ main.c:14:2: error: stray '#' in program 14 | &#160; &#160; n3 = n2; | ^ main.c:14:1: error: lvalue required as unary '&' operand 14 | &#160; &#160; n3 = n2; | ^ main.c:14:9: error: stray '#' in program 14 | &#160; &#160; n3 = n2; | ^ main.c:14:8: error: lvalue required as unary '&' operand 14 | &#160; &#160; n3 = n2; | ^ main.c:15:2: error: stray '#' in program 15 | &#160; &#160; n2 = n1; | ^ main.c:15:1: error: lvalue required as unary '&' operand 15 | &#160; &#160; n2 = n1; | ^ main.c:15:9: error: stray '#' in program 15 | &#160; &#160; n2 = n1; | ^ main.c:15:8: error: lvalue required as unary '&' operand 15 | &#160; &#160; n2 = n1; | ^ main.c:16:2: error: stray '#' in program 16 | &#160; &#160; n1 = n3 % n2; | ^ main.c:16:1: error: lvalue required as unary '&' operand 16 | &#160; &#160; n1 = n3 % n2; | ^ main.c:16:9: error: stray '#' in program 16 | &#160; &#160; n1 = n3 % n2; | ^ main.c:16:8: error: lvalue required as unary '&' operand 16 | &#160; &#160; n1 = n3 % n2; | ^ main.c:17:2: error: stray '#' in program 17 | &#160; } | ^ main.c:17:1: error: lvalue required as unary '&' operand 17 | &#160; } | ^ main.c:22:2: error: stray '#' in program 22 | &#160; return n2; | ^ main.c:22:1: error: lvalue required as unary '&' operand 22 | &#160; return n2; | ^ main.c: In function 'main': main.c:30:2: error: stray '#' in program 30 | &#160; unsigned int a, b; | ^ main.c:30:1: error: lvalue required as unary '&' operand 30 | &#160; unsigned int a, b; | ^ main.c:31:2: error: stray '#' in program 31 | &#160; unsigned int i, j; | ^ main.c:31:1: error: lvalue required as unary '&' operand 31 | &#160; unsigned int i, j; | ^ main.c:36:2: error: stray '#' in program 36 | &#160; i = 0; | ^ main.c:36:1: error: lvalue required as unary '&' operand 36 | &#160; i = 0; | ^ main.c:37:2: error: stray '#' in program 37 | &#160; while (scanf("%d%d", &a, &b) != EOF){ | ^ main.c:37:1: error: lvalue required as unary '&' operand 37 | &#160; while (scanf("%d%d", &a, &b) != EOF){ | ^ main.c:38:2: error: stray '#' in program 38 | &#160; &#160; printf("%d %d\n", gcd(a, b), (a / gcd(a, b) * b)); // bを後で掛けないとオーバーフローする。 | ^ main.c:38:1: error: lvalue required as unary '&' operand 38 | &#160; &#160; printf("%d %d\n", gcd(a, b), (a / gcd(a, b) * b)); // bを後で掛けないとオーバーフローする。 | ^ main.c:38:9: error: stray '#' in program 38 | &#160; &#160; printf("%d %d\n", gcd(a, b), (a / gcd(a, b) * b)); // bを後で掛けないとオーバーフローする。 | ^ main.c:38:8: error: lvalue required as unary '&' operand 38 | &#160; &#160; printf("%d %d\n", gcd(a, b), (a / gcd(a, b) * b)); // bを後で掛けないとオーバーフローする。 | ^ main.c:39:2: error: stray '#' in program 39 | &#160; } | ^ main.c:39:1: error: lvalue required as unary '&' operand 39 | &#160; } | ^ main.c:40:2: error: stray '#' in program 40 | &#160; return 0; | ^ main.c:40:1: error: lvalue required as unary '&' operand 40 | &#160; return 0; | ^
s384934415
p00005
C
#include<stdio.h> int gcd(long long, long long); int gcd(long long a, long long b) { if(b == 0) { return a; } else { return gcd(b, a % b); }; } int main(0 { long long a, b, temp, gcdr, lcmr; scanf("%lld %lld", &a, &b); if(a < b) { temp = b; b = a; a = temp; }; gcdr = gcd(a , b); lcmr = a * b / gcdr; printf("%lld %lld", gcdr, lcmr); return 0; }
main.c:12:10: error: expected declaration specifiers or '...' before numeric constant 12 | int main(0 { | ^
s864502999
p00005
C
#include <stdio.h> #include <math.h> int GCD(int x, int y){ int temp; if(x <= y){ temp = x; x = y; y = temp; } if(y == 0) return x; else{ temp = y; y = x % y; x = temp; return GCD(x, y); } } int LCM(int x, int y, int gcd){ return x * y / gcd; } int main(void){ //int n, i; int a, b; while(scanf("%d %d", &a, &b) == 2){ printf("%d %d\n", GCD(a, b), LCM(a, b, GCD(a,b))); } return 0;
main.c: In function 'main': main.c:33:5: error: expected declaration or statement at end of input 33 | return 0; | ^~~~~~
s448464922
p00005
C
#include <iostream> using namespace std; int GCD(int a, int b) { int temp; while(temp!=0) { temp=a%b; a=b; b=temp; } return a; } int main() { int a,b,lcm,gcd; while(1) { cin>>a>>b gcd=GCD(a,b); lcm=a*b/gcd; cout<<gcd<<" "<<lcm<<"\n"; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s087328570
p00005
C
#include<stdio.h> int main() { long m,n,t,h; while(scanf("%d%d",&m,&n)!=EOF) { t=gcd(m,n); h=m*(n/t); printf("%d %d\n",t,h); } return 0; } long gcd(int a,int b) { long g; if(!b)g=a; else g=gcd(b,a%b); return g; }
main.c: In function 'main': main.c:7:19: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration] 7 | t=gcd(m,n); | ^~~ main.c: At top level: main.c:13:6: error: conflicting types for 'gcd'; have 'long int(int, int)' 13 | long gcd(int a,int b) | ^~~ main.c:7:19: note: previous implicit declaration of 'gcd' with type 'int()' 7 | t=gcd(m,n); | ^~~
s320673114
p00005
C
#include <stdio.h> int cmp_max(int a, int b){ if(a < b){ return (b); }else{ return (a); } } int cmp_min(int a, int b){ if(a < b){ return (a); }else{ return (b); } } int main(){ long long int a, b,t; long long int result1, result2; long long int min, max; while(scanf("%lld %lld", &a, &b) != EOF){ result1 = result2 = 0; min = cmp_min(a, b); max = cmp_max(a, b); while((max % min) != 0){ t = min min = max % min; max = t; } result1 = min; result2 = a*b/result1; printf("%lld %lld\n", result1, result2); } return 0; }
main.c: In function 'main': main.c:27:14: error: expected ';' before 'min' 27 | t = min | ^ | ; 28 | min = max % min; | ~~~
s465310124
p00005
C
#include<stdio.h> int create_gcd(int,int); int main(){ int a,b,ab,gcd,lcm; while(scanf("%11d %11d",&a,&b) != EOF){ ab=a*b; gcd=create_gcd(a,b); lcm=ab/gcd; printf("%11d %11d\n",gcd,lcm); } return 0; } } int create_gcd(int a, int b){ int tmp; int gcd=0; if(a<=b){ while(1){ tmp=b%a; if(tmp==0){ gcd=a; break; } b=a; a=tmp; } }else if(a>b){ while(1){ tmp=a%b; if(tmp==0){ gcd=b; break; } a=b; b=tmp; } } return gcd; }
main.c:17:1: error: expected identifier or '(' before '}' token 17 | } | ^
s755599372
p00005
C
#include<stdio.h> int create_gcd(int,int); int main(){ int a,b,ab,gcd,lcm; while(scanf("%11d %11d",&a,&b) != EOF){ ab=a*b; gcd=create_gcd(a,b); lcm=ab/gcd; printf("%11d %11d\n",gcd,lcm); } return 0; } int create_gcd(int a, int b){ int tmp; if(a<b){ tmp=a; a=b; b=tmp; } if(b==0) return a; else return gcd(b,a%b); }
main.c: In function 'create_gcd': main.c:27:15: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration] 27 | else return gcd(b,a%b); | ^~~
s381780303
p00005
C
#include<stdio.h> int create_gcd(int,int); int main(){ int a,b; while(scanf("%d %d",&a,&b) != EOF){ printf("%d %d\n",create_gcd(a,b),a/gcd(a,b)*b); } return 0; } int create_gcd(int a, int b){ int tmp; if(a<b){ tmp=a; a=b; b=tmp; } if(b==0) return a; else return create_gcd(b,a%b); }
main.c: In function 'main': main.c:9:40: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration] 9 | printf("%d %d\n",create_gcd(a,b),a/gcd(a,b)*b); | ^~~
s234978241
p00005
C
#include <stdio.h> int gcd(int a,int b) { int t; if(a<b){ t=a;a=b;b=t; } while(b!=0){ r=a%b; a=b; b=r; } return a; } int lcm(int a,int b) { int i,t; if(a<b){ t=a;a=b;b=t; } for(i=1;;i++){ if((a*i)%b==0){ return a*i; } } } int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF){ printf("%d %d\n",gcd(a,b),lcm(a,b)); } return 0; }
main.c: In function 'gcd': main.c:11:25: error: 'r' undeclared (first use in this function) 11 | r=a%b; | ^ main.c:11:25: note: each undeclared identifier is reported only once for each function it appears in
s191619823
p00005
C
#include<stdio.h> #include<math.h> int main(){ unsigned long long int a, b, c, d; unsigned long long int i, j; if(a > b){ d = a; a = b; b = d; } while(scanf("%lld %lld", &a, &b) != EOF){ for(i = a; i < 200000000; i += a){ if(i < b) continue; if(i % b == 0){ d = i; break; } } for(i = a; i >= 1; i--){ if(a % i != 0 || b % i |= 0) continue; else c = i; } printf("%lld %lld\n", c, d); } return 0; }
main.c: In function 'main': main.c:21:48: error: lvalue required as left operand of assignment 21 | if(a % i != 0 || b % i |= 0) continue; | ^~
s294905619
p00005
C
#include<stdio.h> #include<math.h> int main(){ unsigned long long int a, b, c, d; unsigned long long int i, j; if(a > b){ d = a; a = b; b = d; } while(scanf("%lld %lld", &a, &b) != EOF){ for(i = a; i < 200000000; i += a){ if(i < b) continue; if(i % b == 0){ d = i; break; } } for(i = a; i >= 1; i--){ if(a % i != 0 || b % i |= 0){ continue; }else{ c = i; } } printf("%lld %lld\n", c, d); } return 0; }
main.c: In function 'main': main.c:21:48: error: lvalue required as left operand of assignment 21 | if(a % i != 0 || b % i |= 0){ | ^~
s451128338
p00005
C
#include <stdio.h> /* 二つの整数x,yの最大公約数を求める関数(x>=y) */ unsigned long gcdf(unsinged long vx,unsinged long vy) { return (!vy) ? vy : gcdf(vy,vx%vy); } /* 二つの整数x,yの最大公約数を求める関数(大きいほうを自動的に取り出すようにする。 */ unsigned long gcd(unsigned long vx,unsigned long vy) { return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx); } int main() { unsigned long x,y; while(scanf("%lu %lu",&x,&y)!=EOF){ printf("%lu %lu\n",gcd(x,y),x*y/(gcd(x,y))); } return 0; }
main.c:3:20: error: unknown type name 'unsinged'; did you mean 'unsigned'? 3 | unsigned long gcdf(unsinged long vx,unsinged long vy) | ^~~~~~~~ | unsigned main.c:3:37: error: unknown type name 'unsinged'; did you mean 'unsigned'? 3 | unsigned long gcdf(unsinged long vx,unsinged long vy) | ^~~~~~~~ | unsigned main.c: In function 'gcd': main.c:11:19: error: implicit declaration of function 'gcdf'; did you mean 'gcd'? [-Wimplicit-function-declaration] 11 | return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx); | ^~~~ | gcd
s268645985
p00005
C
#include <stdio.h> /* 二つの整数x,yの最大公約数を求める関数(x>=y) */ int gcdf(int vx,int vy) { return (!vy) ? vx : gcdf(vy,vx%vy); } /* 二つの整数x,yの最大公約数を求める関数(大きいほうを自動的に取り出すようにする。 */ int gcd(int vx,int vy) { return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx); } int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF){ printf("%d %d\n",gcd(a,b),(a*b)/(gcd(a,b)); } return 0; }
main.c: In function 'main': main.c:18:45: error: expected ')' before ';' token 18 | printf("%d %d\n",gcd(a,b),(a*b)/(gcd(a,b)); | ~ ^ | ) main.c:18:46: error: expected ';' before '}' token 18 | printf("%d %d\n",gcd(a,b),(a*b)/(gcd(a,b)); | ^ | ; 19 | } | ~
s383598174
p00005
C
#include <stdio.h> /* 二つの整数x,yの最大公約数を求める関数(x>=y) */ int gcdf(int vx,int vy) { return (!vy) ? vx : gcdf(vy,vx%vy); } /* 二つの整数x,yの最大公約数を求める関数(大きいほうを自動的に取り出すようにする。 */ int gcd(int vx,int vy) { return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx); } int main() { while(scanf("%d %d",&a,&b)!=EOF) int a=0,b=0; printf("%d %d\n",gcd(a,b),(a*b)/(gcd(a,b))); return 0; }
main.c: In function 'main': main.c:16:24: error: 'a' undeclared (first use in this function) 16 | while(scanf("%d %d",&a,&b)!=EOF) | ^ main.c:16:24: note: each undeclared identifier is reported only once for each function it appears in main.c:16:27: error: 'b' undeclared (first use in this function) 16 | while(scanf("%d %d",&a,&b)!=EOF) | ^ main.c:17:3: error: expected expression before 'int' 17 | int a=0,b=0; | ^~~
s721952144
p00005
C
#include <stdio.h> /* 二つの整数x,yの最大公約数を求める関数(x>=y) int gcdf(int vx,int vy) { return (!vy) ? vy : gcdf(vy,vx%vy); } /* 二つの整数x,yの最大公約数を求める関数(大きいほうを自動的に取り出すようにする。 */ int gcd(int vx,int vy) { return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx); } int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF) { printf("%d %d\n",gcd(a,b),(a/gcd(a,b))*b); } return 0; }
main.c: In function 'gcd': main.c:11:19: error: implicit declaration of function 'gcdf'; did you mean 'gcd'? [-Wimplicit-function-declaration] 11 | return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx); | ^~~~ | gcd
s387305692
p00005
C
#include<stdio.h> /* 二つの整数x,yの最大公約数を求める関数(x>=y) int gcdf(int vx,int vy) { return (!vy) ? vx : gcdf(vy,vx%vy); } /* 二つの整数x,yの最大公約数を求める関数(大きいほうを自動的に取り出すようにする。 */ int gcd(int vx,int vy) { return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx); } int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF){ printf("%d %d",gcd(a,b),(a/gcd(a,b))*b); } return 0; }
main.c: In function 'gcd': main.c:11:19: error: implicit declaration of function 'gcdf'; did you mean 'gcd'? [-Wimplicit-function-declaration] 11 | return (vx>vy) ? gcdf(vx,vy) : gcdf(vy,vx); | ^~~~ | gcd
s801897045
p00005
C
#include<stdio.h> int main(void){ int a,b,i; for(scanf("%d%d",&a,&b)!=EOF){ if(a<b){ i=a; a=b; b=i; } i=b; while((a%i)!=0 || (b%i)!=0 || i!=1;){ i--; } printf("%d %d\n",i,(a/i)*b); } return 0; }
main.c: In function 'main': main.c:4:33: error: expected ';' before ')' token 4 | for(scanf("%d%d",&a,&b)!=EOF){ | ^ main.c:4:33: error: expected expression before ')' token main.c:11:43: error: expected ')' before ';' token 11 | while((a%i)!=0 || (b%i)!=0 || i!=1;){ | ~ ^ | )
s113528564
p00005
C
#include<stdio.h> int main(void){ int a,b,i; for(scanf("%d%d",&a,&b)!=EOF){ if(a<b){ i=a; a=b; b=i; } i=b; while((a%i)!=0 || (b%i)!=0 || i!=1){ i--; } printf("%d %d\n",i,(a/i)*b); } return 0; }
main.c: In function 'main': main.c:4:33: error: expected ';' before ')' token 4 | for(scanf("%d%d",&a,&b)!=EOF){ | ^ main.c:4:33: error: expected expression before ')' token
s708629698
p00005
C
#include <stdio.h> int main(){ int a,b; int x,y,i,j; while(scanf("%d %d",&a,&b) != EOF){ if(a>=b){ for(i=2;i<=b,i++){ if(a%i==0 && b%i==0){ x=i; } } } else if(b>a){ for(i=2;i<=a,i++){ if(a%i==0 && b%i==0){ x=i; } } } if(a>=b){ for(i=1;i<11;i++){ for(j=1;j<11;j++){ if(a*i==b*j){ y=a*i; break; } } if(a*i==b*j)break; } } else if(b>a){ for(i=1;i<11;i++){ for(j=1;j<11;j++){ if(b*i==a*j){ y=a*i; break; } } if(a*i==b*j)break; } } printf("%d %d\n",x,y); } return 0; }
main.c: In function 'main': main.c:9:17: error: expected ';' before ')' token 9 | for(i=2;i<=b,i++){ | ^ | ; main.c:16:17: error: expected ';' before ')' token 16 | for(i=2;i<=a,i++){ | ^ | ;
s744653687
p00005
C
include <stdio.h> int main(void){ int n = 0, m = 0, r = 0, c = 0; while (scanf("%d %d",&m,&n) != EOF){ c = n * m; if(n > m){ r = n; n = m; m = r; } while (n > 0){ r = n; n = m % n; m = r; } printf("%d %d\n",m,(c / m)); } return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s846636759
p00005
C
#include <stdio.h> int main (void) { unsigned __int64 a , b , c, tmp, r; while ( scanf("%d %d",&a,&b) != EOF ) { r = a*b; if ( b > a ) { tmp = b; b = a; a = tmp; } while ( b > 0 ) { c = b; b = a % b; a = c; } printf("%d %d\n",a,(r / a)); } return 0; }
main.c: In function 'main': main.c:4:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a' 4 | unsigned __int64 a , b , c, tmp, r; | ^ main.c:4:26: error: 'a' undeclared (first use in this function) main.c:4:26: note: each undeclared identifier is reported only once for each function it appears in main.c:4:30: error: 'b' undeclared (first use in this function) 4 | unsigned __int64 a , b , c, tmp, r; | ^ main.c:4:34: error: 'c' undeclared (first use in this function) 4 | unsigned __int64 a , b , c, tmp, r; | ^ main.c:4:37: error: 'tmp' undeclared (first use in this function) 4 | unsigned __int64 a , b , c, tmp, r; | ^~~ main.c:4:42: error: 'r' undeclared (first use in this function) 4 | unsigned __int64 a , b , c, tmp, r; | ^
s947676441
p00005
C
#include <stdio.h> int main (void) { unsigned __int64 a , b , c, tmp, r; while ( scanf("%d %d",&a,&b) != EOF ) { r = a*b; if ( b > a ) { tmp = b; b = a; a = tmp; } while ( b > 0 ) { c = b; b = a % b; a = c; } printf("%d %d\n",a,(r / a)); } return 0; }
main.c: In function 'main': main.c:4:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a' 4 | unsigned __int64 a , b , c, tmp, r; | ^ main.c:4:26: error: 'a' undeclared (first use in this function) main.c:4:26: note: each undeclared identifier is reported only once for each function it appears in main.c:4:30: error: 'b' undeclared (first use in this function) 4 | unsigned __int64 a , b , c, tmp, r; | ^ main.c:4:34: error: 'c' undeclared (first use in this function) 4 | unsigned __int64 a , b , c, tmp, r; | ^ main.c:4:37: error: 'tmp' undeclared (first use in this function) 4 | unsigned __int64 a , b , c, tmp, r; | ^~~ main.c:4:42: error: 'r' undeclared (first use in this function) 4 | unsigned __int64 a , b , c, tmp, r; | ^
s542982382
p00005
C
#include <stdio.h> int main (void) { unsigned __int64 a = 0, b = 0, c = 0, tmp = 0, r = 0; while ( scanf("%d %d",&a,&b) != EOF ) { r = a*b; if ( b > a ) { tmp = b; b = a; a = tmp; } while ( b > 0 ) { c = b; b = a % b; a = c; } printf("%d %d\n",a,(r / a)); } return 0; }
main.c: In function 'main': main.c:4:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a' 4 | unsigned __int64 a = 0, b = 0, c = 0, tmp = 0, r = 0; | ^ main.c:4:26: error: 'a' undeclared (first use in this function) main.c:4:26: note: each undeclared identifier is reported only once for each function it appears in main.c:4:33: error: 'b' undeclared (first use in this function) 4 | unsigned __int64 a = 0, b = 0, c = 0, tmp = 0, r = 0; | ^ main.c:4:40: error: 'c' undeclared (first use in this function) 4 | unsigned __int64 a = 0, b = 0, c = 0, tmp = 0, r = 0; | ^ main.c:4:47: error: 'tmp' undeclared (first use in this function) 4 | unsigned __int64 a = 0, b = 0, c = 0, tmp = 0, r = 0; | ^~~ main.c:4:56: error: 'r' undeclared (first use in this function) 4 | unsigned __int64 a = 0, b = 0, c = 0, tmp = 0, r = 0; | ^
s613422948
p00005
C
#include <stdio.h> int main (void) { unsigned __int64 a; unsigned __int64 b; unsigned __int64 c; unsigned __int64 tmp; unsigned __int64 r; while ( scanf("%d %d",&a,&b) != EOF ) { r = a*b; if ( b > a ) { tmp = b; b = a; a = tmp; } while ( b > 0 ) { c = b; b = a % b; a = c; } printf("%d %d\n",a,(r / a)); } return 0; }
main.c: In function 'main': main.c:4:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a' 4 | unsigned __int64 a; | ^ main.c:4:26: error: 'a' undeclared (first use in this function) main.c:4:26: note: each undeclared identifier is reported only once for each function it appears in main.c:5:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'b' 5 | unsigned __int64 b; | ^ main.c:5:26: error: 'b' undeclared (first use in this function) main.c:6:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'c' 6 | unsigned __int64 c; | ^ main.c:6:26: error: 'c' undeclared (first use in this function) main.c:7:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'tmp' 7 | unsigned __int64 tmp; | ^~~ main.c:7:26: error: 'tmp' undeclared (first use in this function) main.c:8:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'r' 8 | unsigned __int64 r; | ^ main.c:8:26: error: 'r' undeclared (first use in this function)
s175155870
p00005
C
#include <stdio.h> int main (void) { unsigned __int64 a = 0; unsigned __int64 b = 0; unsigned __int64 c = 0; unsigned __int64 tmp = 0; unsigned __int64 r = 0; while ( scanf("%d %d",&a,&b) != EOF ) { r = a*b; if ( b > a ) { tmp = b; b = a; a = tmp; } while ( b > 0 ) { c = b; b = a % b; a = c; } printf("%d %d\n",a,(r / a)); } return 0; }
main.c: In function 'main': main.c:4:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a' 4 | unsigned __int64 a = 0; | ^ main.c:4:26: error: 'a' undeclared (first use in this function) main.c:4:26: note: each undeclared identifier is reported only once for each function it appears in main.c:5:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'b' 5 | unsigned __int64 b = 0; | ^ main.c:5:26: error: 'b' undeclared (first use in this function) main.c:6:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'c' 6 | unsigned __int64 c = 0; | ^ main.c:6:26: error: 'c' undeclared (first use in this function) main.c:7:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'tmp' 7 | unsigned __int64 tmp = 0; | ^~~ main.c:7:26: error: 'tmp' undeclared (first use in this function) main.c:8:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'r' 8 | unsigned __int64 r = 0; | ^ main.c:8:26: error: 'r' undeclared (first use in this function)
s811714792
p00005
C
#include <stdio.h> unsigned __int64 a = 0; unsigned __int64 b = 0; unsigned __int64 c = 0; unsigned __int64 tmp = 0; unsigned __int64 r = 0; int main (void) { while ( scanf("%d %d",&a,&b) != EOF ) { r = a*b; if ( b > a ) { tmp = b; b = a; a = tmp; } while ( b > 0 ) { c = b; b = a % b; a = c; } printf("%d %d\n",a,(r / a)); } return 0; }
main.c:3:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'a' 3 | unsigned __int64 a = 0; | ^ main.c:4:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'b' 4 | unsigned __int64 b = 0; | ^ main.c:5:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'c' 5 | unsigned __int64 c = 0; | ^ main.c:6:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'tmp' 6 | unsigned __int64 tmp = 0; | ^~~ main.c:7:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'r' 7 | unsigned __int64 r = 0; | ^ main.c: In function 'main': main.c:9:28: error: 'a' undeclared (first use in this function) 9 | while ( scanf("%d %d",&a,&b) != EOF ) { | ^ main.c:9:28: note: each undeclared identifier is reported only once for each function it appears in main.c:9:31: error: 'b' undeclared (first use in this function) 9 | while ( scanf("%d %d",&a,&b) != EOF ) { | ^ main.c:10:17: error: 'r' undeclared (first use in this function) 10 | r = a*b; | ^ main.c:12:9: error: 'tmp' undeclared (first use in this function) 12 | tmp = b; | ^~~ main.c:17:9: error: 'c' undeclared (first use in this function) 17 | c = b; | ^
s688613026
p00005
C
#include <stdio.h> int main (void) { __int64 a = 0; __int64 b = 0; __int64 c = 0; __int64 tmp = 0; __int64 r = 0; while ( scanf("%d %d",&a,&b) != EOF ) { r = a*b; if ( b > a ) { tmp = b; b = a; a = tmp; } while ( b > 0 ) { c = b; b = a % b; a = c; } printf("%d %d\n",a,(r / a)); } return 0; }
main.c: In function 'main': main.c:4:9: error: unknown type name '__int64'; did you mean '__int64_t'? 4 | __int64 a = 0; | ^~~~~~~ | __int64_t main.c:5:9: error: unknown type name '__int64'; did you mean '__int64_t'? 5 | __int64 b = 0; | ^~~~~~~ | __int64_t main.c:6:9: error: unknown type name '__int64'; did you mean '__int64_t'? 6 | __int64 c = 0; | ^~~~~~~ | __int64_t main.c:7:9: error: unknown type name '__int64'; did you mean '__int64_t'? 7 | __int64 tmp = 0; | ^~~~~~~ | __int64_t main.c:8:9: error: unknown type name '__int64'; did you mean '__int64_t'? 8 | __int64 r = 0; | ^~~~~~~ | __int64_t
s770389550
p00005
C
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string> #define elif else if #define ll long long #define pr printf #define sc scanf int gcd(ll int m,ll int n) { return m%n==0? n:gcd(n,m%n); } int main() { ll int a,b,g,l,m; while (scanf("%lld %lld",&a,&b)!=EOF) { g=gcd(a,b); l=a*b/g; printf("%lld %lld",g,l); } return 0; }
main.c:4:9: fatal error: string: No such file or directory 4 | #include<string> | ^~~~~~~~ compilation terminated.
s446887231
p00005
C
#include <stdio.h> #include <math.h> #include <stdlib.h> #include <string.h> #include <stack> #include <queue> #include <vector> #include <utility> #include <string> #include <sstream> #include <iostream> #include <set> #include <map> #include <algorithm> #include <memory.h> #include <functional> #include <numeric> #include <bits/stdc++.h> using namespace std; #define pi 2*acos(0.0) #define all(v) v.begin(),v.end() //input #define si(t) scanf("%d",&t) #define sl(t) scanf("%I64d",&t) #define sf(t) scanf("%f",&t) #define sd(t) scanf("%lf",&t) #define sc(c) scanf("%c",&c) #define sii(a,b) scanf("%d%d",&a,&b) #define sll(a,b) scanf("%I64d%I64d",&a,&b) #define sfi(t) scanf("%d",&t) #define sfii(a,b) scanf("%d %d",&a,&b) #define sfiii(a,b,c) scanf("%d %d %d",&a,&b,&c) #define sfll(t) scanf("%I64d",&t) #define sfllll(a,b) scanf("%I64d %I64d",&a,&b) #define sfllllll(a,b,c) scanf("%I64d %I64d %I64d",&a,&b,&c) #define sfd(t) scanf("%lf",&t) #define sfc(c) scanf("%c",&c) #define sfs(s) scanf("%s",s) //Output #define P(a) printf("%d\n",a) #define PL(a) printf("%I64d\n",a) #define PF(a) printf("%f\n",a) #define PDB(a) printf("%lf\n",a) #define PN(a) printf("%d ",a) #define PLN(a) printf("%I64d ",a) #define PFN(a) printf("%f ",a) #define PDBN(a) printf("%lf ",a) #define PP(a,b) printf("%d %d\n",a,b) #define PPN(a,b) printf("%d %d ",a,b) #define PPL(a,b) printf("%I64d %I64d\n",a,b) #define PPLN(a,b) printf("%I64d %I64d ",a,b) #define pfi(a) printf("%d\n",a) #define pfii(a,b) printf("%d %d\n",a,b) #define pfiii(a,b,c) printf("%d %d %d\n",a,b,c) #define pfll(a) printf("%I64d\n",a) #define pfllll(a,b) printf("%I64d %I64d\n",a,b) #define pfllllll(a,b,c) printf("%I64d %I64d %I64d\n",a,b,c) #define pfd(a) printf("%lf\n",a) #define pfs(a) printf("%s\n",a) #define pfis(a) printf("%d ",a) #define pflls(a) printf("%I64d ",a) #define pfds(a) printf("%lf ",a) #define CP(a) cout<<a<<endl #define CPN(a) cout<<a<<" " #define ff first #define se second #define pb push_back #define ppb pop_back #define mkp(a,b) make_pair(a,b) #define ST(v) sort(all(v)) #define sz(x) (int)x.size() #define gcd(a,b) __gcd(a,b) #define lcm(a,b) (a*(b/gcd(a,b))) #define max3(a,b,c) max(a,max(b,c)) #define min3(a,b,c) min(a,min(b,c)) #define maxall(v) *max_element(all(v)) #define minall(v) *min_element(all(v)) #define ms(a,n) memset(a, n, sizeof(a)) #define ms0(a) ms(a,0) #define amax(a,b) ( (a) = max( (a) , (b) ) ) #define amin(a,b) ( (a) = min( (a) , (b) ) ) #define sqr(a) ((a)*(a)) #define abs(x) (((x)<0)?-(x):(x)) #define cover(a,d) memset(a,d,sizeof(a)) #define popcount(i) __builtin_popcount(i) //count one #define parity(i) __builtin_parity(i) //evenparity 0 and odd parity 1 #define input freopen("in.txt","r",stdin) #define output freopen("out.txt","w",stdout) #define un(v) ST(v), (v).erase(unique(all(v)),v.end()) #define common(a,b) ST(a), ST(b), a.erase(set_intersection(all(a),all(b),a.begin()),a.end()) #define uncommon(a,b) ST(a), ST(b), a.erase(set_symmetric_difference(all(a),all(b),a.begin()),a.end()) typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; typedef pair<pii,int> piii; typedef pair<ll,ll> pll; typedef pair<string,int> psi; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<pii> vpii; typedef vector<string> vs; typedef set<int> si; typedef set<string> ss; typedef map<int,int> mii; typedef map<ll,ll> mll; typedef map<string,int> msi; //Test Case & New line #define Case(no) printf("Case %d: ",++no) #define nl puts("") //For Define #define forab(i,a,b) for(__typeof(b) i=(a);i<=(b);i++) #define for0(i,n) forab(i,0,(n)-1) #define for1(i,n) forab(i,1,n) #define rforba(i,b,a) for(__typeof(b) i=(b);i>=(a);i--) #define rfor0(i,n) rforba(i,(n)-1,0) #define rfor1(i,n) rforba(i,n,1) #define forstl(i,s) for(__typeof((s).end()) i=(s).begin(); i != (s).end(); i++) //Debug #define dbg(x) cout << #x << " -> " << (x) << endl; #define dbgsarr(i,a) cout<<#a<<"["<<i<<"] -> "<<a[i]<<" "<<endl; #define dbgarr(a,start,end) for(ll i=start;i<=end;i++) cout<<#a<<"["<<i<<"] -> "<<a[i]<<" "<<endl; #define dbgmat(mat,row,col) for(ll i=0;i<row;i++) {for(ll j=0;j<col;j++) cout<<mat[i][j]<<" ";cout<<endl;} #define dbgst(a,b,start,end) for(ll i=start;i<=end;i++) cout<<#a<<"["<<i<<"]."<<#b<<" -> "<<a[i].b<<" "<<endl; ////============ CONSTANT ===============//// #define mx7 10000007 #define mx6 1000006 #define mx5 100005 #define inf 1<<30 //infinity value #define eps 1e-9 #define mx (1000100) #define mod 1000000007 ////=====================================//// template <typename T>string NumberToString( T Number ){stringstream st;st << Number;return st.str();} int stringconvert(string s){int p; istringstream st(s); st>>p ; return p;} int SOD(int n){int sum=0;for(int i=1;i*i<=n;i++)sum+=(n%i)?0:((i*i==n)?i:i+n/i);return sum;} int main() { ll a,b; while(sll(a,b)==2) { printf("%lld %lld\n",gcd(a,b),lcm(a,b)); } return 0; }
main.c:5:10: fatal error: stack: No such file or directory 5 | #include <stack> | ^~~~~~~ compilation terminated.
s403843157
p00005
C
//GCD and LCM #include<stdio.h> __int64 GCD(__int64 m,__int64 n) { __int64 a=m,b=n,c; while(1) { c=a%b; if(c==0) { return b; } else if(c!=0) { a=b; b=c; } } } __int64 LCM(__int64 m,__int64 n) { return m*n/GCD(m,n); } int main() { __int64 a,b; while(scanf("%I64d %I64d",&a,&b)!=EOF) { printf("%I64d %I64d\n",GCD(a,b),LCM(a,b)); } return 0; }
main.c:3:1: error: unknown type name '__int64'; did you mean '__int64_t'? 3 | __int64 GCD(__int64 m,__int64 n) | ^~~~~~~ | __int64_t main.c:3:13: error: unknown type name '__int64'; did you mean '__int64_t'? 3 | __int64 GCD(__int64 m,__int64 n) | ^~~~~~~ | __int64_t main.c:3:23: error: unknown type name '__int64'; did you mean '__int64_t'? 3 | __int64 GCD(__int64 m,__int64 n) | ^~~~~~~ | __int64_t main.c:20:1: error: unknown type name '__int64'; did you mean '__int64_t'? 20 | __int64 LCM(__int64 m,__int64 n) | ^~~~~~~ | __int64_t main.c:20:13: error: unknown type name '__int64'; did you mean '__int64_t'? 20 | __int64 LCM(__int64 m,__int64 n) | ^~~~~~~ | __int64_t main.c:20:23: error: unknown type name '__int64'; did you mean '__int64_t'? 20 | __int64 LCM(__int64 m,__int64 n) | ^~~~~~~ | __int64_t main.c: In function 'main': main.c:26:9: error: unknown type name '__int64'; did you mean '__int64_t'? 26 | __int64 a,b; | ^~~~~~~ | __int64_t main.c:29:40: error: implicit declaration of function 'GCD' [-Wimplicit-function-declaration] 29 | printf("%I64d %I64d\n",GCD(a,b),LCM(a,b)); | ^~~ main.c:29:49: error: implicit declaration of function 'LCM' [-Wimplicit-function-declaration] 29 | printf("%I64d %I64d\n",GCD(a,b),LCM(a,b)); | ^~~
s773155705
p00005
C
#include <stdio.h> #define FOR(variable,a,b) for(variable=(a);variable<(b);variable++) int gcd(int m, int n) { if((0 == m) || (0 == n)) { return 0; } // method by Euclid while(m != n) { if(m > n) { m = m - n; } else { n = n - m; } } return m; } int lcm(int m, int n) { if((0 == m) || (0 == n)) { return 0; } return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n) } int main(){ // import phase int a, b; int gcd, lcm; // calclate phase while(scanf("%d %d", &a, %b) != EOF) { printf("%d %d\n", gcd(a, b), lcm(a,b)); } }
main.c: In function 'main': main.c:34:30: error: expected expression before '%' token 34 | while(scanf("%d %d", &a, %b) != EOF) { | ^ main.c:35:27: error: called object 'gcd' is not a function or function pointer 35 | printf("%d %d\n", gcd(a, b), lcm(a,b)); | ^~~ main.c:31:9: note: declared here 31 | int gcd, lcm; | ^~~ main.c:35:38: error: called object 'lcm' is not a function or function pointer 35 | printf("%d %d\n", gcd(a, b), lcm(a,b)); | ^~~ main.c:31:14: note: declared here 31 | int gcd, lcm; | ^~~
s236110486
p00005
C
#include <stdio.h> int yakusuu(int a,int b); int main(void){ int a,b,c; scanf("%d %d",&a,&b); c=yakusuu(a,b); printf("%d %d\n",c,(a/c)*(b/c)*c); retur 0; } int yakusuu(int a,int b){ int n=2,c=1; while(n<a && n<b){ if(a%n==0 && b%n==0){ a/=n; b/=n; m*=n; } } return c; }
main.c: In function 'main': main.c:10:1: error: 'retur' undeclared (first use in this function) 10 | retur 0; | ^~~~~ main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in main.c:10:6: error: expected ';' before numeric constant 10 | retur 0; | ^~ | ; main.c: In function 'yakusuu': main.c:19:1: error: 'm' undeclared (first use in this function) 19 | m*=n; | ^
s652425063
p00005
C
#include <stdio.h> int yakusuu(int a,int b); int main(void){ int a,b,c; scanf("%d %d",&a,&b); c=yakusuu(a,b); printf("%d %d\n",c,(a/c)*(b/c)*c); return 0; } int yakusuu(int a,int b){ int n=2,c=1; while(n<a && n<b){ if(a%n==0 && b%n==0){ a/=n; b/=n; m*=n; } } return c; }
main.c: In function 'yakusuu': main.c:19:1: error: 'm' undeclared (first use in this function) 19 | m*=n; | ^ main.c:19:1: note: each undeclared identifier is reported only once for each function it appears in
s443989545
p00005
C
#include <stdio.h> int yakusuu(int a,int b); unsigned int main(void){ unsigned int a,b; while(scanf("%d %d",&a,&b)!=EOF){ printf("%d %d\n",yakusuu(a,b),(a*b/yakusuu(a,b))); } return 0; } unsigned int yakusuu(int a,int b){ unsigned int n=2,c=1; while(n<=a && n<=b){ if(a%n==0 && b%n==0){ a/=n; b/=n; c*=n; } else{ n++; } } return c; }
main.c:13:14: error: conflicting types for 'yakusuu'; have 'unsigned int(int, int)' 13 | unsigned int yakusuu(int a,int b){ | ^~~~~~~ main.c:3:5: note: previous declaration of 'yakusuu' with type 'int(int, int)' 3 | int yakusuu(int a,int b); | ^~~~~~~
s569615158
p00005
C
#include<stdio.h> long KYK(long); long KBI(long); long KYK(long num[2]) { long i; for(i = num[1] ; i >= 1 ; i--) { if(0 == num[0] % i && 0 == num[1] % i) { return i; } } } long KBI(long num[2]) { long i = 1; while(1) { if(0 ==( num[0] * i ) % num[1]) { return i; } i++; } } int main(void) { long i,kobai,num[2],koyak,escape; while(scanf("%d %d",&num[0],&num[1]) != EOF ) { kobai = 0; koyak = 0; if(num[0] < num[1]) { escape = num[0]; num[0] = num[1]; num[1] = escape; } koyak = KYK(num); kobai = KBI(num); printf("%d %ld\n",koyak,kobai); } return 0; }
main.c:6:6: error: conflicting types for 'KYK'; have 'long int(long int *)' 6 | long KYK(long num[2]) | ^~~ main.c:3:6: note: previous declaration of 'KYK' with type 'long int(long int)' 3 | long KYK(long); | ^~~ main.c:19:6: error: conflicting types for 'KBI'; have 'long int(long int *)' 19 | long KBI(long num[2]) | ^~~ main.c:4:6: note: previous declaration of 'KBI' with type 'long int(long int)' 4 | long KBI(long); | ^~~
s670568058
p00005
C
#include<stdio.h> long KYK(long); long KBI(long); long KYK(long num[2]) { long i; for(i = num[1] ; i >= 1 ; i--) { if(0 == num[0] % i && 0 == num[1] % i) { return i; } } } long KBI(long num[2]) { long i = 1; while(1) { if(0 ==( num[0] * i ) % num[1]) { return i; } i++; } } int main(void) { long i,kobai,num[2],koyak,escape; while(scanf("%d %d",&num[0],&num[1]) != EOF ) { kobai = 0; koyak = 0; if(num[0] < num[1]) { escape = num[0]; num[0] = num[1]; num[1] = escape; } koyak = KYK(num); kobai = KBI(num); printf("%d %ld\n",koyak,kobai); } return 0; }
main.c:6:6: error: conflicting types for 'KYK'; have 'long int(long int *)' 6 | long KYK(long num[2]) | ^~~ main.c:3:6: note: previous declaration of 'KYK' with type 'long int(long int)' 3 | long KYK(long); | ^~~ main.c:19:6: error: conflicting types for 'KBI'; have 'long int(long int *)' 19 | long KBI(long num[2]) | ^~~ main.c:4:6: note: previous declaration of 'KBI' with type 'long int(long int)' 4 | long KBI(long); | ^~~
s432776566
p00005
C
#include<stdio.h> long KYK(long); long KBI(long); long KYK(long num[2]) { long i; for(i = num[1] ; i >= 1 ; i--) { if(0 == num[0] % i && 0 == num[1] % i) { return i; } } } long KBI(long num[2]) { long i = 1; while(1) { if(0 ==( num[0] * i ) % num[1]) { return i; } i++; } } int main(void) { long i,kobai,num[2],koyak,escape; while(scanf("%d %d",&num[0],&num[1]) != EOF ) { kobai = 0; koyak = 0; if(num[0] < num[1]) { escape = num[0]; num[0] = num[1]; num[1] = escape; } koyak = KYK(num); kobai = KBI(num); printf("%ld %ld\n",koyak,kobai); } return 0; }
main.c:6:6: error: conflicting types for 'KYK'; have 'long int(long int *)' 6 | long KYK(long num[2]) | ^~~ main.c:3:6: note: previous declaration of 'KYK' with type 'long int(long int)' 3 | long KYK(long); | ^~~ main.c:19:6: error: conflicting types for 'KBI'; have 'long int(long int *)' 19 | long KBI(long num[2]) | ^~~ main.c:4:6: note: previous declaration of 'KBI' with type 'long int(long int)' 4 | long KBI(long); | ^~~
s163637331
p00005
C
#include<stdio.h> long KYK(long); long KBI(long); long KYK(long num[2]) { long i; for(i = num[1] ; i >= 1 ; i--) { if(0 == num[0] % i && 0 == num[1] % i) { return i; } } } long KBI(long num[2]) { long i = 1; while(1) { if(0 ==( num[0] * i ) % num[1]) { return i; } i++; } } int main(void) { long i,kobai,num[2],koyak,escape; while(scanf("%d %d",&num[0],&num[1]) != EOF ) { kobai = 0; koyak = 0; if(num[0] < num[1]) { escape = num[0]; num[0] = num[1]; num[1] = escape; } koyak = KYK(num); kobai = KBI(num); printf("%ld %ld\n",koyak,kobai); } return 0; }
main.c:6:6: error: conflicting types for 'KYK'; have 'long int(long int *)' 6 | long KYK(long num[2]) | ^~~ main.c:3:6: note: previous declaration of 'KYK' with type 'long int(long int)' 3 | long KYK(long); | ^~~ main.c:19:6: error: conflicting types for 'KBI'; have 'long int(long int *)' 19 | long KBI(long num[2]) | ^~~ main.c:4:6: note: previous declaration of 'KBI' with type 'long int(long int)' 4 | long KBI(long); | ^~~
s440499092
p00005
C
#include<stdio.h> long kyk(long); long kbi(long); long kyk(long num[2]) { long i; for(i = num[1] ; i >= 1 ; i--) { if(0 == num[0] % i && 0 == num[1] % i) { return i; } } } long kbi(long num[2]) { long i = 1; while(1) { if(0 ==( num[0] * i ) % num[1]) { return i; } i++; } } int main(void) { long i,kobai,num[2],koyak,escape; while(scanf("%d %d",&num[0],&num[1]) != EOF ) { kobai = 0; koyak = 0; if(num[0] < num[1]) { escape = num[0]; num[0] = num[1]; num[1] = escape; } koyak = kyk(num); kobai = kbi(num); printf("%ld %ld\n",koyak,kobai); } return 0; }
main.c:6:6: error: conflicting types for 'kyk'; have 'long int(long int *)' 6 | long kyk(long num[2]) | ^~~ main.c:3:6: note: previous declaration of 'kyk' with type 'long int(long int)' 3 | long kyk(long); | ^~~ main.c:19:6: error: conflicting types for 'kbi'; have 'long int(long int *)' 19 | long kbi(long num[2]) | ^~~ main.c:4:6: note: previous declaration of 'kbi' with type 'long int(long int)' 4 | long kbi(long); | ^~~
s144386907
p00005
C
#include<stdio.h> long kyk(long num[2]); long kbi(long num[2]); long kbi(long num[2]) { long i = 1; while(1) { if(0 == % num[1]) { return (num[0] * i); } i++; } } long kyk(long num[2]) { long yak[4]; yak[0] = num[0]; yak[1] = num[1]; while(1) { yak[2] = yak[0] % yak[1]; if(0 == yak[2]) { return yak[1]; } yak[0] = yak[1]; yak[1] = yak[2]; } } int main(void) { long i,kobai,num[2],koyak,escape; while(scanf("%d %d",&num[0],&num[1]) != EOF ) { kobai = 0; koyak = 0; if(num[0] < num[1]) { escape = num[0]; num[0] = num[1]; num[1] = escape; } koyak = kyk(num); kobai = kbi(num); printf("%ld %ld\n",koyak,kobai); } return 0; }
main.c: In function 'kbi': main.c:12:26: error: expected expression before '%' token 12 | if(0 == % num[1]) | ^
s239101187
p00005
C
#include <stdio.h> int gcd(x, y){ if (y == 0) return x; return gcd(y, x % y); } int main(){ int i, j, n, m; while(scanf("%d %d", &n, &m) != EOF)){ g = gcd(n, m); printf("%d %d\n", g, n * m / g); } return 0; }
main.c: In function 'gcd': main.c:3:5: error: type of 'x' defaults to 'int' [-Wimplicit-int] 3 | int gcd(x, y){ | ^~~ main.c:3:5: error: type of 'y' defaults to 'int' [-Wimplicit-int] main.c: In function 'main': main.c:10:45: error: expected statement before ')' token 10 | while(scanf("%d %d", &n, &m) != EOF)){ | ^ main.c:11:17: error: 'g' undeclared (first use in this function) 11 | g = gcd(n, m); | ^ main.c:11:17: note: each undeclared identifier is reported only once for each function it appears in
s722119257
p00005
C
#include <stdio.h> int gcd(x, y){ return y > 0 ? gcd(y, x % y) : x; } int main(){ int n, m, g; while(scanf("%d %d", &n, &m) != EOF){ g = gcd(n, m); printf("%d %d\n", g, x / g * y); } return 0; }
main.c: In function 'gcd': main.c:3:5: error: type of 'x' defaults to 'int' [-Wimplicit-int] 3 | int gcd(x, y){ | ^~~ main.c:3:5: error: type of 'y' defaults to 'int' [-Wimplicit-int] main.c: In function 'main': main.c:11:38: error: 'x' undeclared (first use in this function) 11 | printf("%d %d\n", g, x / g * y); | ^ main.c:11:38: note: each undeclared identifier is reported only once for each function it appears in main.c:11:46: error: 'y' undeclared (first use in this function) 11 | printf("%d %d\n", g, x / g * y); | ^
s078726277
p00005
C
#include<stdio.h> int main(){ int a,b; while(scanf("%d %d",&a,&b)!=EOF){ if(a<b){ temp=a; a=b; b=temp; } a0=a; b0=b; while(a%b!=0){ temp=a0%b0; a0=b0; b0=temp; } printf("%d %d",b0,a*b/b0); } return 0; }
main.c: In function 'main': main.c:8:25: error: 'temp' undeclared (first use in this function) 8 | temp=a; | ^~~~ main.c:8:25: note: each undeclared identifier is reported only once for each function it appears in main.c:13:17: error: 'a0' undeclared (first use in this function); did you mean 'a'? 13 | a0=a; | ^~ | a main.c:14:17: error: 'b0' undeclared (first use in this function); did you mean 'b'? 14 | b0=b; | ^~ | b
s825943230
p00005
C
# include <stdio.h> _int64 gcd(_int64 a,_int64 b) { _int64 n,temp; if (a<b) { temp=a; a=b; b=temp; } n=a%b; while (n!=0) { a=b; b=n; n=a%b; } return b; } int main(void) { _int64 a,b; while (scanf("%I64d %I64d",&a,&b)!=EOF) { printf("%I64d %I64d\n",gcd(a,b),(a*b)/gcd(a,b)); } return 0; }
main.c:2:1: error: unknown type name '_int64'; did you mean '__int64_t'? 2 | _int64 gcd(_int64 a,_int64 b) | ^~~~~~ | __int64_t main.c:2:12: error: unknown type name '_int64'; did you mean '__int64_t'? 2 | _int64 gcd(_int64 a,_int64 b) | ^~~~~~ | __int64_t main.c:2:21: error: unknown type name '_int64'; did you mean '__int64_t'? 2 | _int64 gcd(_int64 a,_int64 b) | ^~~~~~ | __int64_t main.c: In function 'main': main.c:23:9: error: unknown type name '_int64'; did you mean '__int64_t'? 23 | _int64 a,b; | ^~~~~~ | __int64_t main.c:27:40: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration] 27 | printf("%I64d %I64d\n",gcd(a,b),(a*b)/gcd(a,b)); | ^~~
s864181723
p00005
C
# include <stdio.h> int main() { int n1, n2, prod, gcd, lcm ; while(scanf("%d%d",&a,&b)!=EOF) { prod = n1 * n2 ; while(n1 != n2) { if(n1 > n2) n1 = n1 - n2 ; if(n2 > n1) n2 = n2 - n1 ; } gcd = n1 ; lcm = prod / gcd ; printf("%d ", gcd) ; printf("%d", lcm); } return 0; }
main.c: In function 'main': main.c:6:26: error: 'a' undeclared (first use in this function) 6 | while(scanf("%d%d",&a,&b)!=EOF) | ^ main.c:6:26: note: each undeclared identifier is reported only once for each function it appears in main.c:6:29: error: 'b' undeclared (first use in this function) 6 | while(scanf("%d%d",&a,&b)!=EOF) | ^
s132372235
p00005
C
/* --GCD and LCM-- */ #include <stdio.h> int main(void) { int a; int b; int i; int j; int k; scanf ("%d %d", &a, &b); for (i = 2; i <= 2000000000; i++) { if (a % i = 0 && b % i = 0) { maxc = i; break; } } for (j = 1; j < 2000000000; j++) { for (k = 0; k < 2000000000; k++) { if (a * j = b * k) { minc = a * j; break; } } } printf("%d %d\n", maxc, minc); return 0; }
main.c: In function 'main': main.c:17:32: error: lvalue required as left operand of assignment 17 | if (a % i = 0 && b % i = 0) { | ^ main.c:18:13: error: 'maxc' undeclared (first use in this function) 18 | maxc = i; | ^~~~ main.c:18:13: note: each undeclared identifier is reported only once for each function it appears in main.c:25:23: error: lvalue required as left operand of assignment 25 | if (a * j = b * k) { | ^ main.c:26:17: error: 'minc' undeclared (first use in this function) 26 | minc = a * j; | ^~~~
s505367030
p00005
C
// //GCD and LCM-- // #include <stdio.h> int main(void) { int a; int b; int i; int j; int k; scanf ("%d %d", &a, &b); for (i = 2; i <= 2000000000; i++) { if (a % i = 0 && b % i = 0) { maxc = i; break; } } for (j = 1; j < 2000000000; j++) { for (k = 0; k < 2000000000; k++) { if (a * j = b * k) { minc = a * j; break; } } } printf("%d %d\n", maxc, minc); return 0; }
main.c: In function 'main': main.c:18:32: error: lvalue required as left operand of assignment 18 | if (a % i = 0 && b % i = 0) { | ^ main.c:19:13: error: 'maxc' undeclared (first use in this function) 19 | maxc = i; | ^~~~ main.c:19:13: note: each undeclared identifier is reported only once for each function it appears in main.c:26:23: error: lvalue required as left operand of assignment 26 | if (a * j = b * k) { | ^ main.c:27:17: error: 'minc' undeclared (first use in this function) 27 | minc = a * j; | ^~~~
s955203748
p00005
C++
#include <iostream> using namespace std; using namespace std; int gcd(int a, int b) { } int main(void){ int a,b; while (cin >> a >> b) { int lcm = cout << gcd(a,b) <" " << lcm << endl; } return 0; }
a.cc: In function 'int gcd(int, int)': a.cc:8:1: warning: no return statement in function returning non-void [-Wreturn-type] 8 | } | ^ a.cc: In function 'int main()': a.cc:17:28: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator<<' 17 | cout << gcd(a,b) <" " << lcm << endl; | ~~~ ^~ ~~~ | | | | | int | const char [2]
s041046414
p00005
C++
#include <stdio.h> using namespace std; int gcd(int num1,int num2) { if (num2 == 0) { return num1; }return gcd(num2, num1 % num2); } int lcm(int num1,int num2) { return num1 / gcd(num1, num2) * num2; } int main() { long a, b; while (scanf_s("%d %d",&a,&b)!=EOF) { printf("%d %d\n", gcd(a, b),lcm(a,b)); } }
a.cc: In function 'int main()': a.cc:16:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 16 | while (scanf_s("%d %d",&a,&b)!=EOF) { | ^~~~~~~ | scanf
s593870000
p00005
C++
#include <stdio.h> using namespace std; int gcd(unsigned long num1,unsigned long num2) { if (num2 == 0) { return num1; }return gcd(num2, num1 % num2); } int lcm(unsigned long n1, unsigned long n2) { return n1 * n2 / gcd(n1, n2); } int main() { unsigned long a, b; while (~scanf_s("%d %d",&a,&b)) { printf("%d %d\n", gcd(a, b),lcm(a,b)); } }
a.cc: In function 'int main()': a.cc:16:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 16 | while (~scanf_s("%d %d",&a,&b)) { | ^~~~~~~ | scanf
s667729099
p00005
C++
using namespace std; // GCD template<class T> inline T gcd(T a, T b) { return (a == b) ? a : gcd(b % a, a); } // LCM template<class T> inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; } int main() { long long a, b; while (cin >> a >> b) { cout << gcd(a, b) << " " << lcm(a, b) << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:12: error: 'cin' was not declared in this scope 15 | while (cin >> a >> b) { | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:16:9: error: 'cout' was not declared in this scope 16 | cout << gcd(a, b) << " " << lcm(a, b) << endl; | ^~~~ a.cc:16:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:16:50: error: 'endl' was not declared in this scope 16 | cout << gcd(a, b) << " " << lcm(a, b) << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std;
s354735118
p00005
C++
#include <iostream> using namespace std; int GCD(int a, int b) { if(a%b == 0) return b; GCD(b, a%b); }
a.cc: In function 'int GCD(int, int)': a.cc:9:5: warning: control reaches end of non-void function [-Wreturn-type] 9 | GCD(b, 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
s573214201
p00005
C++
#include<stdio.h> #include<math.h> #include<algorithm> using namespace std; long long int a, b; long long int gcd() { long long int min = a,other=b; if (b < a){ min = b; other = a; } int i; for (i = 1; i <= sqrt(long double(min)); i++) { if (min%i == 0) { if (other % (min / i) == 0) return min / i; } } for (i = sqrt(long double(min)); i >= 1; i--) { if (min%i == 0) { if (other % i == 0) return i; } } } int main() { while (scanf("%lld %lld",&a,&b)==2) { long long int g = gcd(); printf("%lld ", g); printf("%lld\n", (a / g)*(b / g)*g); } }
a.cc: In function 'long long int gcd()': a.cc:13:31: error: expected primary-expression before 'long' 13 | for (i = 1; i <= sqrt(long double(min)); i++) | ^~~~ a.cc:22:23: error: expected primary-expression before 'long' 22 | for (i = sqrt(long double(min)); i >= 1; i--) | ^~~~ a.cc:31:1: warning: control reaches end of non-void function [-Wreturn-type] 31 | } | ^
s688400263
p00005
C++
#include<stdio.h> #include<math.h> #include<algorithm> using namespace std; long long int a, b; long long int gcd() { long long int min = a,other=b; if (b < a){ min = b; other = a; } long long int i; for (i = 1; i <= sqrt(long double(min)); i++) { if (min%i == 0) { if (other % (min / i) == 0) return min / i; } } for (i = sqrt(long double(min)); i >= 1; i--) { if (min%i == 0) { if (other % i == 0) return i; } } } int main() { while (scanf("%lld %lld",&a,&b)==2) { long long int g = gcd(); printf("%lld ", g); printf("%lld\n", (a / g)*(b / g)*g); } }
a.cc: In function 'long long int gcd()': a.cc:13:31: error: expected primary-expression before 'long' 13 | for (i = 1; i <= sqrt(long double(min)); i++) | ^~~~ a.cc:22:23: error: expected primary-expression before 'long' 22 | for (i = sqrt(long double(min)); i >= 1; i--) | ^~~~ a.cc:31:1: warning: control reaches end of non-void function [-Wreturn-type] 31 | } | ^
s359000663
p00005
C++
#include <cstdio> #include <algorithm> int main() { int x, y; while (~scanf("%d%d", &x, &y)){ int gcd = __gcd(x, y); printf("%d %d\n", gcd, x / gcd * y); } }
a.cc: In function 'int main()': a.cc:8:27: error: '__gcd' was not declared in this scope; did you mean 'std::__gcd'? 8 | int gcd = __gcd(x, y); | ^~~~~ | std::__gcd In file included from /usr/include/c++/14/algorithm:61, from a.cc:2: /usr/include/c++/14/bits/stl_algo.h:1137:5: note: 'std::__gcd' declared here 1137 | __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n) | ^~~~~
s808551834
p00005
C++
#include<stdio.h> a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",a,b); }
a.cc:2:1: error: 'a' does not name a type 2 | a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",a,b); | ^ a.cc:2:7: error: expected constructor, destructor, or type conversion before '(' token 2 | a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",a,b); | ^
s453529963
p00005
C++
#include<stdio.h> main(a,b){while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b); }
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token 2 | main(a,b){while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b); | ^
s877547222
p00005
C++
#include<stdio.h> int main(){int a,b;while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);return 0;}
a.cc: In function 'int main()': a.cc:2:63: error: '__gcd' was not declared in this scope; did you mean '__gid_t'? 2 | int main(){int a,b;while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);return 0;} | ^~~~~ | __gid_t
s128480180
p00005
C++
#include<cstdio> #include<algorithm> int main(){int a,b;while(2=scanf("%d%d",&a,&b))printf("%d %d\n",std::__gcd(a,b),std::__gcd(a,b)*b);return 0;}
a.cc: In function 'int main()': a.cc:3:26: error: lvalue required as left operand of assignment 3 | int main(){int a,b;while(2=scanf("%d%d",&a,&b))printf("%d %d\n",std::__gcd(a,b),std::__gcd(a,b)*b);return 0;} | ^
s561681270
p00005
C++
#include <iostream> using namespace std; int gcd(int a, int b){ //a < b ユークリッドの互除法 if(a==0) return b; return gcd(b%a,a) } //lcm = a*b/gcd int main(){ int a,b; while(cin >> a >> b){ int g = gcd(a,b); cout << g << " " << a*b/g; } return 0; }
a.cc: In function 'int gcd(int, int)': a.cc:7:20: error: expected ';' before '}' token 7 | return gcd(b%a,a) | ^ | ; 8 | } | ~
s640469833
p00005
C++
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; int main(){ long long a,b,s,m,ta,tb,tmp; while(cin>>a>>b){ ta=a,tb=b; s=0,m=0; if(a<b)swap(a,b); else while(true){ if(a==0||b==0)cout<<"a#"; tmp=a; a=b; b=tmp%a; if(a%b==0){ m=b; break; } if(a<b){ //cout<<a<<" "<<b<<endl; m=1; break; } s=(ta*tb)/m; cout<<m<<" "<<s<<endl; } }
a.cc: In function 'int main()': a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s920819356
p00005
C++
#include<iostream> #include<algorithm> using namespace std; #define long long ll; int main(){ ll a,b,ta,tb; while(cin>>a>>b){ ta=a;tb=b; if(a<b)swap(a,b); while(1){ ll tmp=b; b=a%b; a=tmp; //cout<<a<<b<<endl; if(b==0)break; } cout<<a<<" "<<ta*tb/a<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: 'll' was not declared in this scope 6 | ll a,b,ta,tb; | ^~ a.cc:8:20: error: 'a' was not declared in this scope 8 | while(cin>>a>>b){ | ^ a.cc:8:23: error: 'b' was not declared in this scope 8 | while(cin>>a>>b){ | ^ a.cc:9:9: error: 'ta' was not declared in this scope; did you mean 'tm'? 9 | ta=a;tb=b; | ^~ | tm a.cc:9:14: error: 'tb' was not declared in this scope; did you mean 'tm'? 9 | ta=a;tb=b; | ^~ | tm a.cc:12:19: error: expected ';' before 'tmp' 12 | ll tmp=b; | ^~~~ | ; a.cc:14:19: error: 'tmp' was not declared in this scope; did you mean 'tm'? 14 | a=tmp; | ^~~ | tm
s409567879
p00005
C++
//PCK2003//// #include<iostream> #include<algorithm> using namespace std; #define long long ll; int main(){ long long a,b,ta,tb; while(cin>>a>>b){ ta=a;tb=b; if(a<b)swap(a,b); while(1){ long long tmp=b; b=a%b; a=tmp; //cout<<a<<b<<endl; if(b==0)break; } cout<<a<<" "<<ta*tb/a<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:19: error: redeclaration of 'long int ll' 5 | #define long long ll; | ^~ a.cc:7:6: note: in expansion of macro 'long' 7 | long long a,b,ta,tb; | ^~~~ a.cc:5:19: note: 'long int ll' previously declared here 5 | #define long long ll; | ^~ a.cc:7:1: note: in expansion of macro 'long' 7 | long long a,b,ta,tb; | ^~~~ a.cc:7:12: error: 'a' was not declared in this scope 7 | long long a,b,ta,tb; | ^ a.cc:7:14: error: 'b' was not declared in this scope 7 | long long a,b,ta,tb; | ^ a.cc:7:16: error: 'ta' was not declared in this scope; did you mean 'tm'? 7 | long long a,b,ta,tb; | ^~ | tm a.cc:7:19: error: 'tb' was not declared in this scope; did you mean 'tm'? 7 | long long a,b,ta,tb; | ^~ | tm a.cc:5:19: error: redeclaration of 'long int ll' 5 | #define long long ll; | ^~ a.cc:13:22: note: in expansion of macro 'long' 13 | long long tmp=b; | ^~~~ a.cc:5:19: note: 'long int ll' previously declared here 5 | #define long long ll; | ^~ a.cc:13:17: note: in expansion of macro 'long' 13 | long long tmp=b; | ^~~~ a.cc:13:28: error: 'tmp' was not declared in this scope; did you mean 'tm'? 13 | long long tmp=b; | ^~~ | tm
s132610571
p00005
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ long long int a,b,ans; while(cin>>a>>b){ for(int i=2;i<=(min(a,b);i++){ if(a%i==0 && b%i==0)ans=i; } cout<<ans<<ans*(a/ans)*(b/ans)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:41: error: expected ')' before ';' token 8 | for(int i=2;i<=(min(a,b);i++){ | ~ ^ | )
s937715024
p00005
C++
# -*- coding: utf-8 -*- import sys def gcd(a,b): while a%b: a,b = b,a%b return b def lcm(a,b): return a*b/gcd(a,b) for s in sys.stdin: a,b = map(int,s.split()) a,b = max(a,b),min(a,b) print gcd(a,b),lcm(a,b)
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- coding: utf-8 -*- | ^ a.cc:2:1: error: 'import' does not name a type 2 | import sys | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
s144068249
p00005
C++
# -*- coding: utf-8 -*- import sys import fractions def lcm(a,b): return a / fractions.gcd(a,b) * b for s in sys.stdin: a,b = map(int,s.split()) gcd_ab = fractions.gcd(a,b) lcm_ab = lcm(a,b) print gcd_ab,lcm_ab
a.cc:1:3: error: invalid preprocessing directive #- 1 | # -*- coding: utf-8 -*- | ^ a.cc:2:1: error: 'import' does not name a type 2 | import sys | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
s593960429
p00005
C++
#include<iostream> #include<cstdio> #include<vector> #include<algorithm> #include<cmath> #include<queue> #include<stack> using namespace std; #define int long long int gcd(int a,int b){ if(b==0) return a; else gcd(b,a%b); } unsigned main(){ int A,B; while(cin>>A>>B){ printf("%d %d\n",gcd(A,B),A*B/gcd(A,B)); } return 0; }
cc1plus: error: '::main' must return 'int' a.cc: In function 'long long int gcd(long long int, long long int)': a.cc:13:17: warning: control reaches end of non-void function [-Wreturn-type] 13 | else gcd(b,a%b); | ~~~^~~~~~~
s749986329
p00005
C++
#include<iostream> #include<cstdio> #include<vector> #include<algorithm> #include<cmath> #include<queue> #include<stack> using namespace std; #define int long long int gcd(int a,int b){ if(b==0) return a; else gcd(b,a%b); } unsigned main(){ int A,B; while(cin>>A>>B){ printf("%lld %lld\n",gcd(A,B),A*B/gcd(A,B)); } return 0; }
cc1plus: error: '::main' must return 'int' a.cc: In function 'long long int gcd(long long int, long long int)': a.cc:13:17: warning: control reaches end of non-void function [-Wreturn-type] 13 | else gcd(b,a%b); | ~~~^~~~~~~
s633037007
p00005
C++
import java.util.Scanner; class Main { public static long a, b; public static void main(String[] args) { Scanner cin = new Scanner(System.in); while(cin.hasNext()){ a = cin.nextLong(); b = cin.nextLong(); solve(); } } public static void solve() { if(a < b){ Long tmp = a; a = b; b = a; } Long g = gcd(a, b); System.out.printf("%d %d", g, a * b / g); } public static Long gcd(Long x, Long y){ if(y == 0){ return x; } return gcd(y, x % y); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:15: error: expected ':' before 'static' 4 | public static long a, b; | ^~~~~~~ | : a.cc:5:15: error: expected ':' before 'static' 5 | public static void main(String[] args) { | ^~~~~~~ | : a.cc:5:33: error: 'String' has not been declared 5 | public static void main(String[] args) { | ^~~~~~ a.cc:5:42: error: expected ',' or '...' before 'args' 5 | public static void main(String[] args) { | ^~~~ a.cc:14:15: error: expected ':' before 'static' 14 | public static void solve() { | ^~~~~~~ | : a.cc:23:15: error: expected ':' before 'static' 23 | public static Long gcd(Long x, Long y){ | ^~~~~~~ | : a.cc:23:23: error: 'Long' does not name a type; did you mean 'long'? 23 | public static Long gcd(Long x, Long y){ | ^~~~ | long a.cc:29:2: error: expected ';' after class definition 29 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:6:17: error: 'Scanner' was not declared in this scope 6 | Scanner cin = new Scanner(System.in); | ^~~~~~~ a.cc:7:23: error: 'cin' was not declared in this scope 7 | while(cin.hasNext()){ | ^~~ a.cc: In static member function 'static void Main::solve()': a.cc:16:25: error: 'Long' was not declared in this scope; did you mean 'long'? 16 | Long tmp = a; | ^~~~ | long a.cc:20:17: error: 'Long' was not declared in this scope; did you mean 'long'? 20 | Long g = gcd(a, b); | ^~~~ | long a.cc:21:17: error: 'System' was not declared in this scope 21 | System.out.printf("%d %d", g, a * b / g); | ^~~~~~ a.cc:21:44: error: 'g' was not declared in this scope 21 | System.out.printf("%d %d", g, a * b / g); | ^
s056748296
p00005
C++
#include <cstdio> #include <cstring> #include <algorithm> #include <iostream> using namespace std; int gcd(int a, int b) { return b > 0 ? gcd(b, a % b) : a; } int main() { int a, b; while (scanf("%d%d", &a, &b) != EOF) { printf("%d %lld", gcd(a, b), (ll)a / gcd(a, b) * b); } return 0; }
a.cc: In function 'int main()': a.cc:14:39: error: 'll' was not declared in this scope 14 | printf("%d %lld", gcd(a, b), (ll)a / gcd(a, b) * b); | ^~
s430275631
p00005
C++
#include <iostream> using std; int main(){ long a,b; a=0;b=0; cin >> a >> b; if(a<b) { long c; c=a; a=b; b=c; } long answer; long d,e,f; for(;;){ if(e==f){ answer = a*b/f; break; } d=e-f; e=f; f=d; } cout<<f<<" "<<answer<<endl; return 0; }
a.cc:3:7: error: expected nested-name-specifier before 'std' 3 | using std; | ^~~ a.cc: In function 'int main()': a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | 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; ///< Linked to standard input | ^~~ a.cc:26:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 26 | cout<<f<<" "<<answer<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:26:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 26 | cout<<f<<" "<<answer<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s116612565
p00005
C++
#include<iostream> using namespace std; int main(){ while(true){ int a = -1;int b = 0;int i = 1;int g = 0;int seki = 1; cin >> a >> b; seki = a*b; if(a == -1){ break; } if(a < b){ i=a; a=b; b=i; } for(i = 1;i <= 50;i++){ if(b == 1){ g = a; break; } else { a = a%b; i=a; a=b; b=i; } } cout >> g >> " " >> seki/g >> endl; } return 0; }
a.cc: In function 'int main()': a.cc:30:6: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 30 | cout >> g >> " " >> seki/g >> endl; | ~~~~ ^~ ~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:30:6: note: candidate: 'operator>>(int, int)' (built-in) 30 | cout >> g >> " " >> seki/g >> endl; | ~~~~~^~~~ a.cc:30:6: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:30:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 30 | cout >> g >> " " >> seki/g >> endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:30:1: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 30 | cout >> g >> " " >> seki/g >> endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:30:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 30 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:30:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 30 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:30:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 30 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:30:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 30 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:30:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 30 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:30:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 30 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:30:9: required from here 30 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s034940100
p00005
C++
#include<iostream> using namespace std; int main(){ int a = -1;int b = 0;int i = 1;int g = 0;int seki = 1; cin >> a >> b; seki = a*b; if(a == -1){ break; } if(a < b){ i=a; a=b; b=i; } for(i = 1;i <= 50;i++){ if(b == 1){ g = a; break; } else { a = a%b; i=a; a=b; b=i; } } cout >> g >> " " >> seki/g >> endl; return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: break statement not within loop or switch 9 | break; | ^~~~~ a.cc:29:6: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 29 | cout >> g >> " " >> seki/g >> endl; | ~~~~ ^~ ~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:29:6: note: candidate: 'operator>>(int, int)' (built-in) 29 | cout >> g >> " " >> seki/g >> endl; | ~~~~~^~~~ a.cc:29:6: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:29:1: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 29 | cout >> g >> " " >> seki/g >> endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:29:9: required from here 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s576620932
p00005
C++
#include<iostream> using namespace std; int main(){ int a = -1;int b = 0;int i = 1;int g = 0;int seki = 1; cin >> a >> b >>; seki = a*b; if(a == -1){ break; } if(a < b){ i=a; a=b; b=i; } for(i = 1;i <= 50;i++){ if(b == 1){ g = a; break; } else { a = a%b; i=a; a=b; b=i; } } cout >> g >> " " >> seki/g >> endl; return 0; }
a.cc: In function 'int main()': a.cc:6:28: error: expected primary-expression before ';' token 6 | cin >> a >> b >>; | ^ a.cc:9:17: error: break statement not within loop or switch 9 | break; | ^~~~~ a.cc:29:6: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 29 | cout >> g >> " " >> seki/g >> endl; | ~~~~ ^~ ~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:29:6: note: candidate: 'operator>>(int, int)' (built-in) 29 | cout >> g >> " " >> seki/g >> endl; | ~~~~~^~~~ a.cc:29:6: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:29:1: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 29 | cout >> g >> " " >> seki/g >> endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:29:9: required from here 29 | cout >> g >> " " >> seki/g >> endl; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s400516926
p00005
C++
#include<iostream> using namespace std; int main(){ int a = -1;int b = 0;int i = 1;int g = 0;int seki = 1; cin >> a >> b >>; seki = a*b; if(a == -1){ break; } if(a < b){ i = a; a = b; b = i; } for(i = 1;i <= 50;i++){ if(b == 1){ g = a; break; } else { a = a%b; i = a; a = b; b = i; } } cout >> g >> " " >> seki / g >> endl; return 0; }
a.cc: In function 'int main()': a.cc:6:28: error: expected primary-expression before ';' token 6 | cin >> a >> b >>; | ^ a.cc:9:17: error: break statement not within loop or switch 9 | break; | ^~~~~ a.cc:29:6: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 29 | cout >> g >> " " >> seki / g >> endl; | ~~~~ ^~ ~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:29:6: note: candidate: 'operator>>(int, int)' (built-in) 29 | cout >> g >> " " >> seki / g >> endl; | ~~~~~^~~~ a.cc:29:6: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> g >> " " >> seki / g >> endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:29:1: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 29 | cout >> g >> " " >> seki / g >> endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> g >> " " >> seki / g >> endl; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki / g >> endl; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki / g >> endl; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout >> g >> " " >> seki / g >> endl; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki / g >> endl; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:29:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout >> g >> " " >> seki / g >> endl; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:29:9: required from here 29 | cout >> g >> " " >> seki / g >> endl; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s279298387
p00005
C++
#include<cstdio> typedef unsigned long long ll; int gcd(int a,int b) { if(b==0)return a; else return gcd(b,a%b); } int main() { ll n,m; while(scanf("%d%d",&n,&m)==2) { ll d = gcd(n,m),ll ans = n/d*m; printf("%lld %lld\n",d,n*m/d); } return 0; }
a.cc: In function 'int main()': a.cc:13:36: error: expected initializer before 'ans' 13 | ll d = gcd(n,m),ll ans = n/d*m; | ^~~
s403817906
p00005
C++
#include<stdio.h> #include<iostream> using namespace std; int main(){ long long int a,b,A,B; while(cin>>a>>b){ A=a;B=b; while (b) { int tmp = a % b; a = b; b = tmp; } b=A*B/a cout<<a<<" "<<b<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:8: error: expected ';' before 'cout' 17 | b=A*B/a | ^ | ; 18 | cout<<a<<" "<<b<<endl; | ~~~~
s215487489
p00005
C++
#include<iostream> using namespace std; int main(){ long int gcd[200],num1,num2,lcm[200]; int a,b; int i=0; while(cin >> a >> b){ num1 = a; num2 = b; if( a<b ){ num2 = a; num1 = b; } while( (gcd[i]=num1%num2) != 0){ num1 = num2; num2 = ggd[i]; } gcd[i] = num2; lcm[i] = a / gcd[i] * b; i++; } for(int j=0; j<i; j++) cout << gcd[j] <<" "<< lcm[j] << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:20:32: error: 'ggd' was not declared in this scope; did you mean 'gcd'? 20 | num2 = ggd[i]; | ^~~ | gcd
s777865392
p00005
C++
#include<iostream> int main(){ int a,b; while( cin >> a >> b ){ int num1 = a; int num2 = b; if( a<b ){ num2 = a; num1 = b; } while( (int gcd = num1%num2) != 0){ num1 = num2; num2 = gcd; } gcd = num2; int lcm = a / gcd * b; cout << gcd <<" "<< lcm << "\n"; } return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | while( 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; ///< Linked to standard input | ^~~ a.cc:15:25: error: expected primary-expression before 'int' 15 | while( (int gcd = num1%num2) != 0){ | ^~~ a.cc:15:25: error: expected ')' before 'int' 15 | while( (int gcd = num1%num2) != 0){ | ~^~~ | ) a.cc:18:18: error: expected ')' before 'gcd' 18 | } | ^ | ) 19 | gcd = num2; | ~~~ a.cc:15:22: note: to match this '(' 15 | while( (int gcd = num1%num2) != 0){ | ^ a.cc:19:17: error: 'gcd' was not declared in this scope 19 | gcd = num2; | ^~~ a.cc:20:31: error: 'gcd' was not declared in this scope 20 | int lcm = a / gcd * b; | ^~~ a.cc:21:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 21 | cout << gcd <<" "<< lcm << "\n"; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s795255621
p00005
C++
#include<iostream> int main(){ int a,b; while( std::cin >> a >> b ){ int num1 = a; int num2 = b; if( a<b ){ num2 = a; num1 = b; } while( (int gcd = num1%num2) != 0){ num1 = num2; num2 = gcd; } gcd = num2; int lcm = a / gcd * b; std::cout << gcd <<" "<< lcm << "\n"; } return 0; }
a.cc: In function 'int main()': a.cc:15:25: error: expected primary-expression before 'int' 15 | while( (int gcd = num1%num2) != 0){ | ^~~ a.cc:15:25: error: expected ')' before 'int' 15 | while( (int gcd = num1%num2) != 0){ | ~^~~ | ) a.cc:18:18: error: expected ')' before 'gcd' 18 | } | ^ | ) 19 | gcd = num2; | ~~~ a.cc:15:22: note: to match this '(' 15 | while( (int gcd = num1%num2) != 0){ | ^ a.cc:19:17: error: 'gcd' was not declared in this scope 19 | gcd = num2; | ^~~ a.cc:20:31: error: 'gcd' was not declared in this scope 20 | int lcm = a / gcd * b; | ^~~
s019094650
p00005
C++
#include <iostream> int main(){ u_int a, b; while(std::cin >> a >> b){ u_int minmul; //least common multiple u_int maxdivi = 1; //greatest common divisor u_int small; if(a > b) small = b; else small = a; for(int i = 2; i <= small; i++){ if(a % i == 0 && b % i == 0){ maxdivi = maxdivi * i; i = 2; } } minmul = a * b / maxdivi; std::cout << maxdivi << minimul << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:26:33: error: 'minimul' was not declared in this scope; did you mean 'minmul'? 26 | std::cout << maxdivi << minimul << std::endl; | ^~~~~~~ | minmul
s527563512
p00005
C++
#include<iostream> int main(){ long int a, b, r; while(std::cin >> a >> b){ long int product = a*b; // GCD if(a < b){ long int temp = a; a = b; b = temp; } while((r = a%b) != 0){ a = b; b = r; } // LCM long int lcm = product / b; // show std::cout << b << " " << lcm << std::endl; } return 0; }}
a.cc:28:2: error: expected declaration before '}' token 28 | }} | ^
s159591836
p00005
C++
#include<stdio.h> using namespace std; int max(int x, int y){ int r; while((r = x % y) != 0){ x = y; y = r; } return y; } long long int small(long long int x,long long int y, int r){ if(x * y % r == 0) return x * y / r; else return x * y; } int main(){ int x,y,r; while((scanf("%ld %ld",&x,&y)) != EOF){ if(x < y){ int num = y; y = x; x = num; } cout << max(x,y) << " " << small(x,y,max(x,y)) << endl; } }
a.cc: In function 'int main()': a.cc:31:17: error: 'cout' was not declared in this scope 31 | cout << max(x,y) << " " << small(x,y,max(x,y)) << endl; | ^~~~ a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<stdio.h> +++ |+#include <iostream> 2 | a.cc:31:67: error: 'endl' was not declared in this scope 31 | cout << max(x,y) << " " << small(x,y,max(x,y)) << endl; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include<stdio.h> +++ |+#include <ostream> 2 |
s582901213
p00005
C++
#include <iostream> using namespace std; int gcd(int a, int b) { return a % b ? gcd(b, a % b) : b; } int lcm(int a, int b) { return a / gcd(a,b) * b; } int main() { int a, b; while(con >> a >> b) { cout << gcd(a,b) << " " << lcm(a,b) << endl; }
a.cc: In function 'int main()': a.cc:13:7: error: 'con' was not declared in this scope 13 | while(con >> a >> b) { | ^~~ a.cc:15:2: error: expected '}' at end of input 15 | } | ^ a.cc:11:12: note: to match this '{' 11 | int main() { | ^
s457718604
p00005
C++
#include <cstdio> using namespace std; int a, b, d, e; int gcd(int x, int y) { if (x<y) { x+=y; y=x-y; x-=y; } if (y==0) return x; else return gcd(y, x%y) } int lcm(int x, int y) { return (long long)x*y/d; } int main() { while (scanf("%d%d", &a, &b)!=EOF) { d = gcd(a,b); e = lcm(a, b); printf("%lld %lld\n", d, e); } }
a.cc: In function 'int gcd(int, int)': a.cc:15:27: error: expected ';' before '}' token 15 | return gcd(y, x%y) | ^ | ; 16 | } | ~
s009167349
p00005
C++
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNextInt()){ int a=sc.nextInt(); int b=sc.nextInt(); int c=gcd(a,b); int d=a*b/c; System.out.printf("%d %d%n",c,d); } } public static int gcd(int x,int y){ int max=Math.max(x,y); int min=Math.min(x,y); if(max%min==0){return min;} return gcd(min,max%min); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:7: error: expected ':' before 'static' 4 | public static void main(String[] args){ | ^~~~~~~ | : a.cc:4:25: error: 'String' has not been declared 4 | public static void main(String[] args){ | ^~~~~~ a.cc:4:34: error: expected ',' or '...' before 'args' 4 | public static void main(String[] args){ | ^~~~ a.cc:14:7: error: expected ':' before 'static' 14 | public static int gcd(int x,int y){ | ^~~~~~~ | : a.cc:20:2: error: expected ';' after class definition 20 | } | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:5:1: error: 'Scanner' was not declared in this scope 5 | Scanner sc=new Scanner(System.in); | ^~~~~~~ a.cc:6:7: error: 'sc' was not declared in this scope 6 | while(sc.hasNextInt()){ | ^~ a.cc:11:1: error: 'System' was not declared in this scope 11 | System.out.printf("%d %d%n",c,d); | ^~~~~~ a.cc: In static member function 'static int Main::gcd(int, int)': a.cc:15:9: error: 'Math' was not declared in this scope 15 | int max=Math.max(x,y); | ^~~~
s659192575
p00005
C++
// B.cpp #include <iostream> using namespace std; int gcd(int, int); int lcm(int, int); int main(void) { int a, b; cin >> a >> b; cout << gcd(a, b) << " " << lcm(a, b) << endl; return 0; } int gcd(int a, int b) { int max, min, res; res = 1; if(a > b){ max = a, min = b; } if(a =< b){ max = b, min = a; } if(min == 0) return max; while(res) { res = max % min; max = min; min = res; } return max; } int lcm(int a, int b) { return a / gcd(a, b) * b; }
a.cc: In function 'int gcd(int, int)': a.cc:26:15: error: expected primary-expression before '<' token 26 | if(a =< b){ | ^
s764614271
p00005
C++
#include<iostream> #include<argolithm> int main(void) { unsigned int a, b, g, l; while( std::cin >> a >> b ){ g = gcd( a, b ); l = a * b / g; std::cout << g << std::endl; std::cout << l << std::endl; } return 0; } int gcd( int a, int b ){ int n, i; unsigned int tmp[4]; tmp[0] = std::max( a, b ); tmp[1] = std::mix( a, b ); for( n = 0;; n++ ){ for( i = 1;(tmp[( n + 2 ) % 3 ] = tmp[ n % 3 ] - tmp[( n + 1 ) % 3 ] * i ) >= tmp[( n + 1 ) % 3]; i++ ){ if( tmp[( n + 2 ) % 3 ] == 0 ){ return tmp[( n + 1 ) % 3 ]; } } if( n > 2000000000 ){ return -1; } } return -1; }
a.cc:2:9: fatal error: argolithm: No such file or directory 2 | #include<argolithm> | ^~~~~~~~~~~ compilation terminated.
s203552647
p00005
C++
#include<iostream> #include<argolithm> int gcd( unsigned int, unsigned int ); int main(void) { unsigned int a, b, g, l; while( std::cin >> a >> b ){ g = gcd( a, b ); l = a * b / g; std::cout << g << std::endl; std::cout << l << std::endl; } return 0; } int gcd( unsigned int a, unsigned int b ){ int n, i; unsigned int tmp[4]; tmp[0] = std::max( a, b ); tmp[1] = std::mix( a, b ); for( n = 0;; n++ ){ for( i = 1;(tmp[( n + 2 ) % 3 ] = tmp[ n % 3 ] - tmp[( n + 1 ) % 3 ] * i ) >= tmp[( n + 1 ) % 3]; i++ ){ if( tmp[( n + 2 ) % 3 ] == 0 ){ return tmp[( n + 1 ) % 3 ]; } } if( n > 2000000000 ){ return -1; } } return -1; }
a.cc:2:9: fatal error: argolithm: No such file or directory 2 | #include<argolithm> | ^~~~~~~~~~~ compilation terminated.
s472776811
p00005
C++
#include<iostream> #include<argorithm> int gcd( unsigned int, unsigned int ); int main(void) { unsigned int a, b, g, l; while( std::cin >> a >> b ){ g = gcd( a, b ); l = a * b / g; std::cout << g << std::endl; std::cout << l << std::endl; } return 0; } int gcd( unsigned int a, unsigned int b ){ int n, i; unsigned int tmp[4]; tmp[0] = std::max( a, b ); tmp[1] = std::mix( a, b ); for( n = 0;; n++ ){ for( i = 1;(tmp[( n + 2 ) % 3 ] = tmp[ n % 3 ] - tmp[( n + 1 ) % 3 ] * i ) >= tmp[( n + 1 ) % 3]; i++ ){ if( tmp[( n + 2 ) % 3 ] == 0 ){ return tmp[( n + 1 ) % 3 ]; } } if( n > 2000000000 ){ return -1; } } return -1; }
a.cc:2:9: fatal error: argorithm: No such file or directory 2 | #include<argorithm> | ^~~~~~~~~~~ compilation terminated.
s934203706
p00005
C++
#include<iostream> #include<algorithm> int gcd( unsigned int, unsigned int ); int main(void) { unsigned int a, b, g, l; while( std::cin >> a >> b ){ g = gcd( a, b ); l = a * b / g; std::cout << g << std::endl; std::cout << l << std::endl; } return 0; } int gcd( unsigned int a, unsigned int b ){ int n, i; unsigned int tmp[4]; tmp[0] = std::max( a, b ); tmp[1] = std::mix( a, b ); for( n = 0;; n++ ){ for( i = 1;(tmp[( n + 2 ) % 3 ] = tmp[ n % 3 ] - tmp[( n + 1 ) % 3 ] * i ) >= tmp[( n + 1 ) % 3]; i++ ){ if( tmp[( n + 2 ) % 3 ] == 0 ){ return tmp[( n + 1 ) % 3 ]; } } if( n > 2000000000 ){ return -1; } } return -1; }
a.cc: In function 'int gcd(unsigned int, unsigned int)': a.cc:24:23: error: 'mix' is not a member of 'std'; did you mean 'min'? 24 | tmp[1] = std::mix( a, b ); | ^~~ | min
s428121148
p00005
C++
//#define _USE_MATH_DEFINES #include <iostream> //#include <stdio.h> //#include <iomanip> //#include <vector> //#include <string> //#include <algorithm> //#include <functional> //#include <cmath> using namespace std; long gcd(long a, long b){ long A, B, R; if (a > b){ A = a; B = b; } else{ A = b; B = a; } while (1){ R = A % B; if (R == 0){ return B; } else{ A = B; B = R; } } } long lcm(long a, long b){ long A, B; A = a; B = b; while (1){ if (A > B){ B = ceil((float)A / (float)b) * b; } else{ A = ceil((float)B / (float)a) * a; } if (A == B) return A; } } int main(){ int n; long a, b; long gcd_a, lcm_a; while (cin >> a >> b){ gcd_a = gcd(a, b); lcm_a = lcm(a, b); cout << gcd_a << " " << lcm_a << endl; } return 0; }
a.cc: In function 'long int lcm(long int, long int)': a.cc:45:29: error: 'ceil' was not declared in this scope 45 | B = ceil((float)A / (float)b) * b; | ^~~~ a.cc:48:29: error: 'ceil' was not declared in this scope 48 | A = ceil((float)B / (float)a) * a; | ^~~~
s671374988
p00005
C++
#include<cstdio> int g(int x,int y){return y?g(y,x%y):x;} int main(){ int x,y; while(~scanf("%d%d",&x,&y))printf("%d %d\n",g(x,y),a*b/g(x,y)); }
a.cc: In function 'int main()': a.cc:5:52: error: 'a' was not declared in this scope 5 | while(~scanf("%d%d",&x,&y))printf("%d %d\n",g(x,y),a*b/g(x,y)); | ^ a.cc:5:54: error: 'b' was not declared in this scope 5 | while(~scanf("%d%d",&x,&y))printf("%d %d\n",g(x,y),a*b/g(x,y)); | ^
s753558837
p00005
C++
#include<cstdio> int g(int x,int y){return y?g(y,x%y):x;} int main(){ int x,y; while(cin>>x>>y)printf("%d %d\n",g(x,y),x*y/g(x,y)); }
a.cc: In function 'int main()': a.cc:5:7: error: 'cin' was not declared in this scope 5 | while(cin>>x>>y)printf("%d %d\n",g(x,y),x*y/g(x,y)); | ^~~
s199586335
p00005
C++
#include<iostream> using namespace std; int main(){ int a, b, c, d,r,s,h; for (cin >> a >> b){ //c h = a; s = b; { r = h % s; if (r == 0) { c = s; break; } h = s; s = r; } //d h = a; s = b; if (a < b){ for (;;){ if ((b % a) == 0){ d = b; break; } b = b + s; } } else if (a >= b){ for (;;){ if ((a % b) == 0){ d = a; break; } a = a + h; } } cout << c << " " << d << endl; } }
a.cc: In function 'int main()': a.cc:7:27: error: expected ';' before ')' token 7 | for (cin >> a >> b){ | ^ | ; a.cc:44:1: error: expected primary-expression before '}' token 44 | } | ^ a.cc:43:10: error: expected ';' before '}' token 43 | } | ^ | ; 44 | } | ~ a.cc:44:1: error: expected primary-expression before '}' token 44 | } | ^ a.cc:43:10: error: expected ')' before '}' token 43 | } | ^ | ) 44 | } | ~ a.cc:7:13: note: to match this '(' 7 | for (cin >> a >> b){ | ^ a.cc:44:1: error: expected primary-expression before '}' token 44 | } | ^
s365033381
p00005
C++
import sys for line in sys.stdin: a, b = map(int, line.split()) c = a * b while b: a, b = b, a % b print(str(a) + ' ' + str(c / a))
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'