submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s147666358 | p00005 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int gcd(int a,int b)
{
if (b == 0)return a;
else
return gcd(b, a %b);
}
int main()
{
int a, b;
while (scanf_s("%d%d", &a, &b))
{
int g = gcd(a, b);
int lcm = a / g*b;
printf("%d %d\n", g, lcm);
}
} | a.cc: In function 'int main()':
a.cc:15:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
15 | while (scanf_s("%d%d", &a, &b))
| ^~~~~~~
| scanf
|
s105171420 | p00005 | C++ | #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (i... | a.cc: In function 'int main()':
a.cc:53:36: error: 'x' was not declared in this scope
53 | while(cin >> a >> b) cout << gcd(x, y) << " " << lcm(x, y) << endl;
| ^
a.cc:53:39: error: 'y' was not declared in this scope
53 | while(cin >> a >> b) cout << gcd(x, y) << " " <... |
s257176947 | p00005 | C++ | def gcd(a,b)
return a if b == 0
gcd(b,a%b)
end
def lcm(a,b)
return a * b / gcd(a,b)
end
while line = gets
a,b = line.split.map(&:to_i)
p "#{gcd(a,b)} #{lcm(a,b)}"
end | a.cc:1:1: error: 'def' does not name a type
1 | def gcd(a,b)
| ^~~
|
s880404210 | p00005 | C++ | def gcd(a,b)
if b==0
a
else
gcd(b,a%b)
end
def lcm(a,b){a * b / gcd(a,b)}
while line = gets
a,b = line.split.map(&:to_i)
print gcd(a,b)," ",lcm(a,b),"\n"
end | a.cc:1:1: error: 'def' does not name a type
1 | def gcd(a,b)
| ^~~
a.cc:8:1: error: expected unqualified-id before 'while'
8 | while line = gets
| ^~~~~
|
s878900054 | p00005 | C++ | #include <stdio.h>
int gcd(__int64 a,__int64 b){
return b==0?a:gcd(b,a%b);
}
__int64 a,b;
int main()
{
while(scanf("%ld%ld",&a,&b) != EOF){
printf("%ld\n%ld\n",gcd(a,b),a * b / gcd(a,b));
}
return 0;
} | a.cc:2:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
2 | int gcd(__int64 a,__int64 b){
| ^~~~~~~
| __int64_t
a.cc:2:19: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
2 | int gcd(__int64 a,__int64 b){
| ... |
s187705013 | p00005 | C++ | #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
??
int main() {
????????int n, m;
????????while (2 == scanf("%d%d", &n, &m)) {
????????????????printf("%d %d\n", __gcd(n, m), n / __gcd(n, m) * m);
????????}
????????return 0;
} | a.cc:5:1: error: expected unqualified-id before '?' token
5 | ??
| ^
|
s183530265 | p00005 | C++ | #include <iostream>
using namespace std;
int main(){
int a,a2,i=1,j=1,b,b2;
cin>>a>>b;
while(1){
a2=a*i;
b2=b*j;
if(a2==b2)break;
else if(a2<b2)#include <iostream>
using namespace std;
int main(){
int a,a2,i=1,j=1,b,b2;
cin>>a>>b;
while(1){
a2=a*i;
b2=b*j;
if(a2==b2)break;
... | a.cc:10:19: error: stray '#' in program
10 | else if(a2<b2)#include <iostream>
| ^
a.cc:19:19: error: stray '#' in program
19 | else if(a2<b2)#include <iostream>
| ^
a.cc:28:19: error: stray '#' in program
28 | else if(a2<b2)#include <iostream>
... |
s322768974 | p00005 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b,gcd,lcm,tmp,r;
while(cin>>num_a>>num_b){
a=num_a,b=num_b;
if(a<b){
tmp = a;
a = b;
b = tmp;
}
r=a%b;
while(r!=0){
a = b;
b = r;
r = a % b;
}
gcd = b;
lcm = (num_a*num_b)/gcd;
cout<<gcd<<" "<<lcm<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:12: error: 'num_a' was not declared in this scope
5 | while(cin>>num_a>>num_b){
| ^~~~~
a.cc:5:19: error: 'num_b' was not declared in this scope
5 | while(cin>>num_a>>num_b){
| ^~~~~
|
s242060842 | p00005 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <string>
#include <iomanip>
#include <math.h>
#include <limits>
using namespace std;
typedef unsigned long long ullong;
class cgl
{
public:
ullong gcd(ullong, ullong);
ullong lcm(ullong, ullong, ullong);
};
u... | a.cc: In function 'int main()':
a.cc:45:21: error: 'fin' was not declared in this scope; did you mean 'sin'?
45 | if (fin.fail()) break;
| ^~~
| sin
|
s046433599 | p00005 | C++ | #include <iostream>
#include <stdio.h>
using namespace std;
__int64 gcd(__int64 a, __int64 b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
int main()
{
__int64 a, b, t;
while (scanf("%I64d%I64d", &a, &b) != EOF)
{
if (a < b)
t = gcd(b, a);
else
t = gcd(a, b);
printf("%I64d %I64d\n", t, a * b / ... | a.cc:6:1: error: '__int64' does not name a type; did you mean '__int64_t'?
6 | __int64 gcd(__int64 a, __int64 b)
| ^~~~~~~
| __int64_t
a.cc: In function 'int main()':
a.cc:15:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
15 | __int64 a, b, t;
| ^~... |
s663800234 | p00005 | C++ | #include<stdio.h>
#include<stdlib.h>
int main()
{
log long int num1,num2,num;
while(scanf("%lld %lld",num1,&num2)!=EOF){
num=num1*num2;
while(num1 !=num2)
if(num1>num2)
num1=num1-num2;
else
num2=num2-num1;
}
printf("%lld %dll\n",num1,num/num1);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:3: error: 'log' was not declared in this scope; did you mean 'long'?
6 | log long int num1,num2,num;
| ^~~
| long
a.cc:7:27: error: 'num1' was not declared in this scope
7 | while(scanf("%lld %lld",num1,&num2)!=EOF){
| ^~... |
s415545489 | p00005 | C++ | #include<stdio.h>
#include<math.h>
int main()
{
long long a,b,g,l,m,n,t;
while(scanf("%lld%lld,&a,&b")!=EOF);
{
m=a;
n=b;
if(a==0) g=b;
else if(b==0)
g=b;
else
{
while(n!=0)
}
}
return 0;
}
... | a.cc: In function 'int main()':
a.cc:22:13: error: expected primary-expression before '}' token
22 | }
| ^
a.cc: At global scope:
a.cc:27:1: error: expected declaration before '}' token
27 | }
| ^
|
s207935167 | p00005 | C++ | #include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int d(int n,int m)
{
int t;
while(m!=0)
{
if(n<m) {t=n;n=m;m=t;}
t=m;
m=n%m;
n=t;
}
return n;
}
int main()
{
int t,n,m;
while( scanf("%d %d",&n,&m))
{
t=d(n,m);
lo... | a.cc: In function 'int main()':
a.cc:24:15: error: 'k' was not declared in this scope
24 | cout<<k<<" "<<l<<endl;
| ^
|
s231940926 | p00005 | C++ |
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b){
int x=a,y=b;
while(true){
if(x==y)
break;
if(x>y)
x-=y;
... | a.cc:2:1: error: expected unqualified-id before numeric constant
2 | 2
| ^
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a... |
s721109757 | p00005 | C++ | // GCDandLCM.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//
#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;
double eucAlg(int a,int b);
int main(int argc, char* argv[])
{
double a,b; //??\??????
double c, d; //??????
while(cin >... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s756872054 | p00005 | C++ | import java.util.*;
class Main {
public static int gcd(int a, int b) {
return b == 0 ? a : gcd(b, a % b);
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNext()) {
int a = scanner.nextInt();
int b = scanner.nextInt();
int g = gcd(a, b);
System... | 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:15: error: expected ':' before 'static'
4 | public static int gcd(int a, int b) {
| ^~~~~~~
| :
a.cc:7:15... |
s213725174 | p00005 | C++ | #include<iostream>
using namespace std;
int gcd(int a,int b){
while(a>0&&b>0){
if(a>b)
a%=b;
else
b%=a;
}
if(a==0)
return b;
else
return a;
}
int main(){
int a,b;
while(cin>>a>>b){
int c=gcd(a,b);
lcm=a*b/c;
cout<<c<... | a.cc: In function 'int main()':
a.cc:19:9: error: 'lcm' was not declared in this scope
19 | lcm=a*b/c;
| ^~~
|
s509166175 | p00005 | C++ | #include<iostream>
using namespace std;
int a,b;
int gcd(int x,int y){
a=x;
b=y;
while(a>0&&b>0){
if(a>b)
a%=b;
else
b%=a;
}
if(a==0)
return b;
else if(b==0)
return a;
}
int main(){
while(cin>>x>>y){
int c=gcd(x,y);
... | a.cc: In function 'int main()':
a.cc:20:16: error: 'x' was not declared in this scope
20 | while(cin>>x>>y){
| ^
a.cc:20:19: error: 'y' was not declared in this scope
20 | while(cin>>x>>y){
| ^
a.cc: In function 'int gcd(int, int)':
a.cc:17:1: warning: control ... |
s238603430 | p00005 | C++ | #include<iostream>
#include<stdio.h>
using namespace std;
typedef __int64 ll;
ll gcd(ll a,ll b){
return (b==0)?a:gcd(b,a%b);
}
ll lcm(ll a,ll b){
return a/gcd(a,b)*b;
}
int main(){
ll a,b;
while(scanf("%I64d %I64d",&a,&b)!=EOF){
cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
}
return 0;
} | a.cc:4:9: error: '__int64' does not name a type; did you mean '__int64_t'?
4 | typedef __int64 ll;
| ^~~~~~~
| __int64_t
a.cc:5:1: error: 'll' does not name a type
5 | ll gcd(ll a,ll b){
| ^~
a.cc:8:1: error: 'll' does not name a type
8 | ll lcm(ll a,ll b){
| ^~
a.cc:... |
s110678745 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int a; int b){
if(b>0){
return gcd(b, a%b);
}
else{
return a;
}
}
int lcm(int a, int b){
return ((a/gcd(a,b)) *b);
}
int main(){
int a, b;
while(cin >> a >> b){
cout << gcd(a,b) << " " << lem(a,b) << endl;
}
} | a.cc:5:14: error: expected ')' before ';' token
5 | int gcd(int a; int b){
| ~ ^
| )
a.cc:5:21: error: expected initializer before ')' token
5 | int gcd(int a; int b){
| ^
a.cc: In function 'int lcm(int, int)':
a.cc:15:23: error: too many arguments t... |
s599733578 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int a; int b){
if(b>0){
return gcd(b, a%b);
}
else{
return a;
}
}
int lcm(int a, int b){
return ((a/gcd(a,b)) *b);
}
int main(){
int a, b;
while(cin >> a >> b){
cout << gcd(a,b) << " " << lcm(a,b) << endl;
}
} | a.cc:5:14: error: expected ')' before ';' token
5 | int gcd(int a; int b){
| ~ ^
| )
a.cc:5:21: error: expected initializer before ')' token
5 | int gcd(int a; int b){
| ^
a.cc: In function 'int lcm(int, int)':
a.cc:15:23: error: too many arguments t... |
s731974013 | p00005 | C++ | #include <math.h>
#include <algorithm>
#include <iomanip>
using namespace std;
int main(){
long long int x, y;
while (cin >> x >> y) {
long long int a, b, c;
a = max(x, y);
b = min(x, y);
c = a % b;
while (c) {
a = b;
b = c;
c = a % b;
}
cout << b << ' ' << x * y / b << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:16: error: 'cin' was not declared in this scope
8 | while (cin >> x >> y) {
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include <iomanip>
+++ |+#include <io... |
s588589040 | p00005 | C++ | #include<cstdio>
#include<iostream>
#include <algorithm>
using namespace std;
int main() {
long a, b;
while (cin >> a >> b) {
cout << __gcd(a, b) << " " << a * b / gcd(a, b) << endl;
}
} | a.cc: In function 'int main()':
a.cc:11:55: error: 'gcd' was not declared in this scope
11 | cout << __gcd(a, b) << " " << a * b / gcd(a, b) << endl;
| ^~~
|
s912851466 | p00005 | C++ | #include<cstdio>
#include<iostream>
#include <algorithm>
using namespace std;
int main() {
long int a, b;
while (cin >> a >> b) {
cout << __gcd(a, b) << " " << a * b / gcd(a, b) << endl;
}
} | a.cc: In function 'int main()':
a.cc:10:55: error: 'gcd' was not declared in this scope
10 | cout << __gcd(a, b) << " " << a * b / gcd(a, b) << endl;
| ^~~
|
s446752936 | p00005 | C++ | #include<cstdio>
#include<iostream>
#include <algorithm>
using namespace std;
int main() {
long int a, b;
while (cin >> a >> b) {
cout << __gcd(a, b) << " " << a / gcd(a, b) * b << endl;
}
} | a.cc: In function 'int main()':
a.cc:10:51: error: 'gcd' was not declared in this scope
10 | cout << __gcd(a, b) << " " << a / gcd(a, b) * b << endl;
| ^~~
|
s707937723 | p00005 | C++ | using System;
using System.Linq;
public class Test {
public static int gcd(int x, int y) {
if(y == 0) return x;
return gcd(y, x % y);
}
public static int lcm(int x, int y) {
return x / gcd(x, y) * y;
}
public static void Main() {
string buf;
while(!string.IsNullOrEmpty(buf = Console.ReadLine())) {
str... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Linq;
| ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Test {
| ^~~~~~
|
s016274321 | p00005 | C++ | #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m;
while (2 == scanf("%d%d", &n, &m)) {
printf("%d %d\n", __gcd(n, m), n / __lcm(n, m));
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:44: error: '__lcm' was not declared in this scope
9 | printf("%d %d\n", __gcd(n, m), n / __lcm(n, m));
| ^~~~~
|
s614533548 | p00005 | C++ | #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m;
while (2 == scanf("%d%d", &n, &m)) {
printf("%d %d\n", __gcd(n, m), n / __lcm(n, m));
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:44: error: '__lcm' was not declared in this scope
9 | printf("%d %d\n", __gcd(n, m), n / __lcm(n, m));
| ^~~~~
|
s532417580 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,x;
long long c;
cin >> a >> b;
c=a*b;
if(a>=b){
x=a;
a=b;
b=x%b;
}
else if(a<b){
b=a%b;
}
while(b>0){
x=a;
a=b;
b=x%b;
}
cout << a << " " << c/a << endl;
re... | a.cc: In function 'int main()':
a.cc:22:5: error: 'retern' was not declared in this scope; did you mean 'extern'?
22 | retern 0;
| ^~~~~~
| extern
|
s765126570 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,x;
long long c;
cin >> a >> b;
c=a*b;
if(a>=b){
x=a;
a=b;
b=x%b;
}
else if(a<b){
b=a%b;
}
while(b>0){
x=a;
a=b;
b=x%b;
}
cout << a << " " << c/a << endl;
re... | a.cc: In function 'int main()':
a.cc:22:5: error: 'retern' was not declared in this scope; did you mean 'extern'?
22 | retern 0;
| ^~~~~~
| extern
|
s006427305 | p00005 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b)
{
return b>0?gcd(b,a%b):a;
}
ll lcm(ll a,ll b)
{
return a/gcd(a,b)*b;
}
int main()
{
ll a,b;
while ((cin>>a>>b)>0)
{
ll GCD=gcd(a,b);
cout<<GCD<<" "<<a/GCD*b<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:16:23: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
16 | while ((cin>>a>>b)>0)
| ~~~~~~~~~~~^~
| | |
| | int
... |
s899779768 | p00005 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a, b, min ,max, gcd, lcm;
while(cin >> a >> b){
min = min(a, b);
max = max(a, b);
for(int i = 0; i < min; i++){
if(min % i == 0 && max % i == 0) gcd = i;
}
while(1){
int i = 1;
if( (max * i) % min == 0) {
lc... | a.cc: In function 'int main()':
a.cc:10:26: error: 'min' cannot be used as a function
10 | min = min(a, b);
| ~~~^~~~~~
a.cc:11:26: error: 'max' cannot be used as a function
11 | max = max(a, b);
| ~~~^~~~~~
a.cc:27:2: error: ... |
s756815191 | p00005 | C++ | #include<iostream>
#include<cmath>
using namespace std;
int main(){
int a, b, min ,max, gcd, lcm;
while(cin >> a >> b){
min = min(a, b);
max = max(a, b);
for(int i = 0; i < min; i++){
if(min % i == 0 && max % i == 0) gcd = i;
}
while(1){
int i = 1;
if( (max * i) % min == 0) {
lcm = ... | a.cc: In function 'int main()':
a.cc:10:26: error: 'min' cannot be used as a function
10 | min = min(a, b);
| ~~~^~~~~~
a.cc:11:26: error: 'max' cannot be used as a function
11 | max = max(a, b);
| ~~~^~~~~~
a.cc:27:2: error: ... |
s716090284 | p00005 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a, b, min ,max, gcd, lcm;
while(cin >> a >> b){
min = min(a, b);
max = max(a, b);
for(int i = 0; i < min; i++){
if(min % i == 0 && max % i == 0) gcd = i;
}
while(1){
int i = 1;
if( (max * i) % min == 0) {
lc... | a.cc: In function 'int main()':
a.cc:10:26: error: 'min' cannot be used as a function
10 | min = min(a, b);
| ~~~^~~~~~
a.cc:11:26: error: 'max' cannot be used as a function
11 | max = max(a, b);
| ~~~^~~~~~
|
s851821001 | p00005 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
int a, b, min ,max, gcd, lcm;
while(cin >> a >> b){
min = min(a, b);
max = max(a, b);
for(int i = 0; i < min; i++){
if(min % i == 0 && max % i == 0) gcd = i;
}
while(1){
int i = 1;
if( (max * i) % mi... | a.cc: In function 'int main()':
a.cc:11:26: error: 'min' cannot be used as a function
11 | min = min(a, b);
| ~~~^~~~~~
a.cc:12:26: error: 'max' cannot be used as a function
12 | max = max(a, b);
| ~~~^~~~~~
|
s601053258 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a, b;
while(cin >> a >> b){
int max = max(a,b);
int min = min(a,b);
int gcd = 0, lcm = 0;
for(int i = 0; i < min; i++){
if(max % i == 0)
gcd = i;
}
int j = 1;
while(1){
if((max * j) % min == 0){
... | a.cc: In function 'int main()':
a.cc:8:18: error: 'max' cannot be used as a function
8 | int max = max(a,b);
| ~~~^~~~~
a.cc:9:18: error: 'min' cannot be used as a function
9 | int min = min(a,b);
| ~~~^~~~~
a.cc:25:9: error: 'i' was not declared in this scope
... |
s019900515 | p00005 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a, b;
while(cin >> a >> b){
int max = max(a,b);
int min = min(a,b);
int gcd = 0, lcm = 0;
for(int i = 0; i < min; i++){
if(max % i == 0)
gcd = i;
}
int j = 1;
while(1){
if((max ... | a.cc: In function 'int main()':
a.cc:9:18: error: 'max' cannot be used as a function
9 | int max = max(a,b);
| ~~~^~~~~
a.cc:10:18: error: 'min' cannot be used as a function
10 | int min = min(a,b);
| ~~~^~~~~
a.cc:26:9: error: 'i' was not declared in this scope
... |
s145257136 | p00005 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
int a, b;
while(cin >> a >> b){
int max = max(a,b);
int min = min(a,b);
int gcd = 0, lcm = 0;
for(int i = 0; i < min; i++){
if(max % i == 0)
gcd = i;
}
int j = 1;
while(1)... | a.cc: In function 'int main()':
a.cc:10:18: error: 'max' cannot be used as a function
10 | int max = max(a,b);
| ~~~^~~~~
a.cc:11:18: error: 'min' cannot be used as a function
11 | int min = min(a,b);
| ~~~^~~~~
a.cc:28:9: error: 'i' was not declared in this scope
... |
s752564478 | p00005 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
int a, b;
while(cin >> a >> b){
int max = max(a, b);
int min = min(a, b);
long gcd = 0, lcm = 0;
for(int i = 0; i < min; i++){
if(max % i == 0)
gcd = i;
}
int j = 1;
while... | a.cc: In function 'int main()':
a.cc:10:18: error: 'max' cannot be used as a function
10 | int max = max(a, b);
| ~~~^~~~~~
a.cc:11:18: error: 'min' cannot be used as a function
11 | int min = min(a, b);
| ~~~^~~~~~
a.cc:28:9: error: 'i' was not declared in this sco... |
s047712870 | p00005 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
int a, b;
while(cin >> a >> b){
int max = max(a, b);
int min = min(a, b);
long gcd = 0, lcm = 0;
for(int i = 0; i < min; i++){
if(max % i == 0)
gcd = i;
}
int j = 1;
while... | a.cc: In function 'int main()':
a.cc:10:18: error: 'max' cannot be used as a function
10 | int max = max(a, b);
| ~~~^~~~~~
a.cc:11:18: error: 'min' cannot be used as a function
11 | int min = min(a, b);
| ~~~^~~~~~
|
s962122688 | p00005 | C++ | #include<iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main() {
int a, b, c=1, GCD, LCM , d,???e;
while (cin >> a >> b) {
d = a;
e = b;
while (c) {
c = a % b;
if (c == 0) {
GCD = b;
break;
}
else {
a = b;
b = c;
}
}
d /= GCD;
e /= GCD;
LCM ... | a.cc: In function 'int main()':
a.cc:10:37: error: expected unqualified-id before '?' token
10 | int a, b, c=1, GCD, LCM , d,???e;
| ^
a.cc:14:17: error: 'e' was not declared in this scope
14 | e = b;
| ^
|
s931529483 | p00005 | C++ | #include<stdio.h>
int main(){
long a,b,m,l;
while(scanf("%d %d",&a,%b)!=EOF){
m = a%b;
l = a*b;
while(m){
a = b;
b = m;
m = a%b;
}
printf("%d %d\n",b,l/b);
}
} | a.cc: In function 'int main()':
a.cc:4:26: error: expected primary-expression before '%' token
4 | while(scanf("%d %d",&a,%b)!=EOF){
| ^
|
s147944529 | p00005 | C++ | //0005
#include <bits/stdc++.h>
using namespace std;
int main(){
double a,b;
while(cin>>a>>b){
cout<<gcd(a,b)<<" "<<a / gcd(a,b) * b <<endl;
}
return 0;
} | In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
from a.cc:2:
/usr/include/c++/14/numeric: In instantiation of 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = double; _Nn = double; common_type_t<_Mn, _Nn> = double]':
a.cc:9:18: required from here
... |
s285018898 | p00005 | C++ | //0005
#include <bits/stdc++.h>
using namespace std;
int main(){
double a,b;
while(cin>>a>>b){
cout<<__gcd(a,b)<<" "<<a / __gcd(a,b) * b <<endl;
}
return 0;
} | In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of '_EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement) [with _EuclideanRing... |
s858062143 | p00005 | C++ | def get_input():
while True:
try:
yield ''.join(raw_input())
except EOFError:
break
if __name__ == '__main__':
a = list(get_input())
for n in a:
inl=n.split()
num=inl[0]+inl[1]
l=list(num)
time=0
for i in l:
time+=1
print time | a.cc:4:19: error: empty character constant
4 | yield ''.join(raw_input())
| ^~
a.cc:8:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
8 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a t... |
s359522767 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int x,int y){
if(x%y==0) return n;
else{
int z=x%y
return gcd(y,z);
}
}
int main()
{
int a,b;
int g;
long int l;
cin >> a >> b;
if(a>b) g=gcd(a,b);
else if(a<b) g=gcd(b,a);
else g=a;
l=a*b/g;
cout << g << " " << l << " " << endl;
... | a.cc: In function 'int gcd(int, int)':
a.cc:5:21: error: 'n' was not declared in this scope
5 | if(x%y==0) return n;
| ^
a.cc:8:5: error: expected ',' or ';' before 'return'
8 | return gcd(y,z);
| ^~~~~~
|
s059340251 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int x,int y){
if(x%y==0) return n;
else{
int z=x%y
return gcd(y,z);
}
}
int main()
{
int a,b;
int g;
long int l;
cin >> a >> b;
if(a>b) g=gcd(a,b);
else if(a<b) g=gcd(b,a);
else g=a;
l=a*b/g;
cout << g << " " << l << " " << endl;
... | a.cc: In function 'int gcd(int, int)':
a.cc:5:21: error: 'n' was not declared in this scope
5 | if(x%y==0) return n;
| ^
a.cc:8:5: error: expected ',' or ';' before 'return'
8 | return gcd(y,z);
| ^~~~~~
|
s214938205 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int x,int y){
if(x%y==0) return n;
else{
int z=x%y
return gcd(y,z);
}
}
int main()
{
int a,b;
int g;
long int l;
cin >> a >> b;
if(a>b) g=gcd(a,b);
else if(a<b) g=gcd(b,a);
else g=a;
l=a*b/g;
cout << g << " " << l << " " << endl;
... | a.cc: In function 'int gcd(int, int)':
a.cc:5:21: error: 'n' was not declared in this scope
5 | if(x%y==0) return n;
| ^
a.cc:8:5: error: expected ',' or ';' before 'return'
8 | return gcd(y,z);
| ^~~~~~
|
s328055591 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int x,int y){
if(x%y==0) return y;
else{
int z=x%y
return gcd(y,z);
}
}
int main()
{
int a,b;
int g;
long int l;
cin >> a >> b;
if(a>b) g=gcd(a,b);
else if(a<b) g=gcd(b,a);
else g=a;
l=a*b/g;
cout << g << " " << l << " " << endl;
... | a.cc: In function 'int gcd(int, int)':
a.cc:8:5: error: expected ',' or ';' before 'return'
8 | return gcd(y,z);
| ^~~~~~
a.cc:7:9: warning: control reaches end of non-void function [-Wreturn-type]
7 | int z=x%y
| ^
|
s554801298 | p00005 | C++ | #include <iostream> //std::cout, std::cin
#include <string> //std::string,std::to_string(C++11)
#include <vector> //std::vector
#include <valarray> //std::valarray
#include <algorithm> //std::sort
#include <ctime> //localtime_s
#include <cstdlib> //abs
#include <cmath> //abs,std::pow,sqrt,sin,cos,round,f... | a.cc: In function 'int main()':
a.cc:47:31: error: expected primary-expression before 'unsigned'
47 | LCM.push_back(unsigned long long(a)*unsigned long long(b) / GCD.back());
| ^~~~~~~~
|
s661868116 | p00005 | C++ |
File Edit Options Buffers Tools C++ Help
const int MAX = (int)1e5 + 5;
template<typename T>
T gcd(T a, T b)
{
T c;
while (a != 0) {
c = a; a = b%a; b = c;
}
return b;
}
template<typename T>
T lcm(T m, T n)
{
return ... | a.cc:47:1: error: 'File' does not name a type
47 | File Edit Options Buffers Tools C++ Help
| ^~~~
a.cc: In function 'int main()':
a.cc:67:3: error: 'll' was not declared in this scope
67 | ll a, b;
| ^~
a.cc:68:9: error: 'cin' was not declared in this scope
68 | while(cin >> a >> b) {
... |
s285375183 | p00005 | C++ |
File Edit Options Buffers Tools C++ Help
const int MAX = (int)1e5 + 5;
template<typename T>
T gcd(T a, T b)
{
T c;
while (a != 0) {
c = a; a = b%a; b = c;
}
return b;
}
template<typename T>
T lcm(T m, T n)
{
return ... | a.cc:47:1: error: 'File' does not name a type
47 | File Edit Options Buffers Tools C++ Help
| ^~~~
a.cc: In function 'int main()':
a.cc:67:3: error: 'll' was not declared in this scope
67 | ll a, b;
| ^~
a.cc:68:9: error: 'cin' was not declared in this scope
68 | while(cin >> a >> b) {
... |
s162673519 | p00005 | C++ | #include<stdio.h>
#include<string.h>
int GCD(int x,int y)
{
if(y==0)
return x;
return GCD(y,x%y);
}
int LCM(int x,int y)
{
return x * y / GCD(x,y);
}
int main(void)
{
int a,b;
while(scanf("%d %d",&a,&b) != EOF)
{
if(a<b){
int k = b;
b = a;
a = k;
}
printf("%d %d\n",GCD(a,b),L... | a.cc:34:5: error: redefinition of 'int GCD(int, int)'
34 | int GCD(int x,int y)
| ^~~
a.cc:4:5: note: 'int GCD(int, int)' previously defined here
4 | int GCD(int x,int y)
| ^~~
a.cc:41:5: error: redefinition of 'int LCM(int, int)'
41 | int LCM(int x,int y)
| ^~~
a.cc:11:5: note: ... |
s714727322 | p00005 | C++ | #include<iostream>
using namespace std;
int GCD(int n,int m){
if(n<m){
int t;
t = m;
m = n;
n = t;
}
int i;
while(n%m != 0){
i = n%m;
n = m;
m = i;
}
return m;
}
int main(){
int n,m,i=0,a[50],b[50];
while(cin >> n >> m){
a[i] = GCD(n,m);
b[i] = n*m/GCD(n,m);
... | a.cc: In function 'int main()':
a.cc:29:1: error: expected primary-expression before '?' token
29 | ???return 0;
| ^
a.cc:29:2: error: expected primary-expression before '?' token
29 | ???return 0;
| ^
a.cc:29:3: error: expected primary-expression before '?' token
29 | ???return 0;
| ^
a.c... |
s359544681 | p00005 | C++ | #include<iostream>
using namespace std;
int GCD(int n,int m){
if(n<m){
int t;
t = m;
m = n;
n = t;
}
int i;
while(n%m != 0){
i = n%m;
n = m;
m = i;
}
return m;
}
int main(){
int n,m,i=0,a[50],b[50];
while(cin >> n >> m){
a[i] = GCD(n,m);
b[i] = n*m/GCD(n,m);
... | a.cc: In function 'int main()':
a.cc:29:1: error: expected primary-expression before '?' token
29 | ???return 0;
| ^
a.cc:29:2: error: expected primary-expression before '?' token
29 | ???return 0;
| ^
a.cc:29:3: error: expected primary-expression before '?' token
29 | ???return 0;
| ^
a.c... |
s375335802 | p00005 | C++ | #include <stdio.h>
#include <iostream>
#include <math.h>
int u(int a, int b);
int l(int a, int b);
int main(){
int a, b;
int gcd, lcm;
while(scanf("%d", &a)!=EOF){
scanf("%d", &b);
gcd = u(a, b);
lcd = l(a, b);
std::cout << a << " " << b << std::endl;
}
return 0;
}
int u(int a, int b)... | a.cc: In function 'int main()':
a.cc:15:5: error: 'lcd' was not declared in this scope; did you mean 'lcm'?
15 | lcd = l(a, b);
| ^~~
| lcm
|
s683112218 | p00005 | C++ | #include <stdio.h>
#include <math.h>
int u(int a, int b);
int l(int a, int b);
int main(){
int a, b;
int gcd, lcm;
while(scanf("%d", &a)!=EOF){
scanf("%d", &b);
//gcd = u(a, b);
/ lcm = l(a, b);
//printf("%d %d\n",gcd, lcm);
//std::cout << gcd << " " << lcm << std::endl;
}
return 0;
}
i... | a.cc: In function 'int main()':
a.cc:14:3: error: expected primary-expression before '/' token
14 | / lcm = l(a, b);
| ^
|
s506870609 | p00005 | C++ | #include <stdio.h>
#include <math.h>
int u(int a, int b);
int l(int a, int b, int gcd);
int main(){
int a, b;
int gcd, lcm;
while(scanf("%d", &a)!=EOF){
scanf("%d", &b);
gcd = u(a, b);
lcm = l(a, b, gcd);
std::cout << gcd << " " << lcm << std::endl;
}
return 0;
}
int u(int a, int b){
... | a.cc: In function 'int main()':
a.cc:15:10: error: 'cout' is not a member of 'std'
15 | std::cout << gcd << " " << lcm << std::endl;
| ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <math.h>
+++ |+#inc... |
s478482007 | p00005 | C++ | #include <stdio.h>
#include <math.h>
int u(int a, int b);
int l(int a, int b, int gcd);
int main(){
int a, b;
int gcd, lcm;
while(scanf("%d", &a)!=EOF){
scanf("%d", &b);
gcd = u(a, b);
lcm = l(a, b, gcd);
std::cout << gcd << " " << lcm << std::endl;
}
return 0;
}
int u(int a, int b){
... | a.cc: In function 'int main()':
a.cc:15:10: error: 'cout' is not a member of 'std'
15 | std::cout << gcd << " " << lcm << std::endl;
| ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <math.h>
+++ |+#inc... |
s766357858 | p00005 | C++ | #include <stdio.h>
#include <math.h>
int u(int a, int b);
int l(int a, int b, int gcd);
int main(){
int a, b;
int gcd, lcm;
while(scanf("%d", &a)!=EOF){
scanf("%d", &b);
gcd = u(a, b);
lcm = l(a, b, gcd);
std::cout << gcd << " " << lcm << std::endl;
}
return 0;
}
int u(int a, int b){
... | a.cc: In function 'int main()':
a.cc:15:10: error: 'cout' is not a member of 'std'
15 | std::cout << gcd << " " << lcm << std::endl;
| ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <math.h>
+++ |+#inc... |
s224614669 | p00005 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b;
while(cin >> a >> b){
int gcd = a, lcm;
while(a%gcd != 0 || b%gcd != 0) gcd--;
lcm = (a\gcd)*(b\gcd)*gcd;
cout << gcd <<" "<< lcm << endl;
}
} | a.cc:9:25: error: stray '\' in program
9 | lcm = (a\gcd)*(b\gcd)*gcd;
| ^
a.cc:9:33: error: stray '\' in program
9 | lcm = (a\gcd)*(b\gcd)*gcd;
| ^
a.cc: In function 'int main()':
a.cc:9:25: error: expected ')' b... |
s525718565 | p00005 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b;
while(cin >> a >> b){
int gcd = a, lcm;
while(a%gcd != 0 || b%gcd != 0) gcd--;
lcm = (a\gcd)*(b\gcd)*gcd;
cout << gcd <<" "<< lcm << endl;
}
return 0;
} | a.cc:9:25: error: stray '\' in program
9 | lcm = (a\gcd)*(b\gcd)*gcd;
| ^
a.cc:9:33: error: stray '\' in program
9 | lcm = (a\gcd)*(b\gcd)*gcd;
| ^
a.cc: In function 'int main()':
a.cc:9:25: error: expected ')' b... |
s769457057 | p00005 | C++ | #include<iostream>
long long gcd (long long a, b) {
if(a < b) {
int foo = a;
a = b;
b = foo;
}
if(a % b == 0) {
return b;
}else {
return gcd(b, a % b);
}
}
int main() {
long long a ,b;
while (scanf("%ld", &a) != EOF) {
scanf("%ld", &b);
long long g = gcd(a, b);
printf(... | a.cc:4:29: error: 'b' has not been declared
4 | long long gcd (long long a, b) {
| ^
a.cc: In function 'long long int gcd(long long int, int)':
a.cc:5:10: error: 'b' was not declared in this scope
5 | if(a < b) {
| ^
a.cc:11:10: error: 'b' was not declared in t... |
s010058310 | p00005 | C++ | #include<iostream>
#include<cstdio>
long long gcd (long long a, b) {
if(a < b) {
int foo = a;
a = b;
b = foo;
}
if(a % b == 0) {
return b;
}else {
return gcd(b, a % b);
}
}
int main() {
long long a ,b;
while (scanf("%ld", &a) != EOF) {
scanf("%ld", &b);
long long g = gcd(a,... | a.cc:4:29: error: 'b' has not been declared
4 | long long gcd (long long a, b) {
| ^
a.cc: In function 'long long int gcd(long long int, int)':
a.cc:5:10: error: 'b' was not declared in this scope
5 | if(a < b) {
| ^
a.cc:11:10: error: 'b' was not declared in t... |
s937408199 | p00005 | C++ | //
// main.c
// c
//
// Created by ????????? on 2016/12/10.
// Copyright ?? 2016??´ ?????????. All rights reserved.
//
#include <stdio.h>
#include "0005.h"
int main(){
long long a, b, r, lcm, x, y;
while (scanf("%lld %lld",&a,&b) != EOF) {
x=a;
y=b;
for (;;) {
r=x%y;
... | a.cc:10:10: fatal error: 0005.h: No such file or directory
10 | #include "0005.h"
| ^~~~~~~~
compilation terminated.
|
s488082940 | p00005 | C++ | import sys
def gcd(inta, intb):
large = max(inta, intb)
small = min(inta,intb)
mod = large % small
if mod ==0:
return small
else:
return gcd(small, mod)
def lcm(inta, intb, intgcd):
return (inta * intb // intgcd)
sets = sys.stdin.readlines()
for line in sets:
a, b ... | 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'
|
s668513967 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
unsigned int a,b,c;
int g[50],l[50];
int p;
for(int i=0;i<50;i++;){
cin>>a>>b;
p=a*b;
while(b!=0){
c=b;
b=a%b;
a=c;
}
g[i]=a;
l[i]=p/g[i];
}
for(int i=0;i<50;i... | a.cc: In function 'int main()':
a.cc:8:25: error: expected ')' before ';' token
8 | for(int i=0;i<50;i++;){
| ~ ^
| )
a.cc:8:26: error: expected primary-expression before ')' token
8 | for(int i=0;i<50;i++;){
| ^
a.... |
s205903517 | p00005 | C++ | #include<iostream>
using namespace std;
int Gcd(int a,int b){
int c,d;
if(b>a){
d=a;
a=b;
b=d;
}
while(b!=0){
c=b;
b=a%b;
a=c;
}
int g=a;
return(g);
}
int main(){
int m,n;
long p;
int k;
while(cin>>m>>n){
p=m*n;
... | a.cc:30:1: error: expected declaration before '}' token
30 | }
| ^
|
s395446953 | p00005 | C++ | #include<iostream>
using namespace std;
int Gcd(int a,int b){
int c,d;
if(b>a){
d=a;
a=b;
b=d;
}
while(b!=0){
c=b;
b=a%b;
a=c;
}
int g=a;
return(g);
}
int main(){
int m,n;
long p;
int k;
while(cin>>m>>n){
p=m*n;
... | a.cc:30:1: error: expected declaration before '}' token
30 | }
| ^
|
s780461674 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b;cin>>a>>b;cout<<__gcd(a,b)<<" "<<a/__gcd(a,b)*b<<endl;return 0;
} | a.cc: In function 'int main()':
a.cc:4:25: error: '__gcd' was not declared in this scope
4 | int a,b;cin>>a>>b;cout<<__gcd(a,b)<<" "<<a/__gcd(a,b)*b<<endl;return 0;
| ^~~~~
|
s152794360 | p00005 | C++ | // ConsoleApplication17.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//
#include "stdafx.h"
#include "iostream"
using namespace std;
void keisann(int a, int b) {
long long ac = a;
long long bc = b;
bool d = true;
do {
a = a%b;
if (a == 0) {
cout << b << "... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s700048089 | p00005 | C++ |
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <s... | a.cc: In function 'int main()':
a.cc:31:21: error: 'saisho' was not declared in this scope
31 | A = saisho(a,b);
| ^~~~~~
a.cc:32:21: error: 'saidai' was not declared in this scope
32 | B = saidai(a, b);
| ^~~~~~
|
s937177859 | p00005 | C++ | #include<iostream>
using namespace std;
int gcd(int a,int b){
if(b==0) return a;
return gcd(b,a%d);
}
int main(){
while(true){
int a,b;
cin >> a >> b;
if(cin.eof()) break;
int g = gcd(a,b);
cout << g << ' ' << a/g*b << endl;
}
return 0;
} | a.cc: In function 'int gcd(int, int)':
a.cc:7:24: error: 'd' was not declared in this scope
7 | return gcd(b,a%d);
| ^
|
s439027307 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int a,int b){
if(b==0)
return a;
return gcd(b,a%b);
}
int main(){
while(true){
int a,b;
cin>a>>b;
if(cin.eof())
break;
cout<<n_prime[n]<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:20: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
14 | cin>a>>b;
| ~~~^~~~~
| | |
| | int
| std::istrea... |
s845121069 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int a,int b){
if(b==0)
return a;
return gcd(b,a%b);
}
int main(){
while(true){
int a,b;
cin>a>>b;
if(cin.eof())
break;
int g=gcd(a,b);
cout<<g<<' '<<a/g*b<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:20: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
14 | cin>a>>b;
| ~~~^~~~~
| | |
| | int
| std::istrea... |
s627476226 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int a,int b){
if(b==0)
return a;
return gcd(b,a%b);
}
int main(){
while(true){
int a,b;
cin>a>>b;
if(cin.eof())
break;
int g=gcd(a,b);
cout<<g<<' '<<a/g*b<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:20: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
14 | cin>a>>b;
| ~~~^~~~~
| | |
| | int
| std::istrea... |
s596505806 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int m,int n){
if(b==0)
return m;
return gcd(n,m%n);
}
int main(){
while(true){
int a,b;
cin>a>>b;
if(cin.eof())
break;
int g=gcd(a,b);
cout<<g<<' '<<a/g*b<<endl;
}
return 0;
} | a.cc: In function 'int gcd(int, int)':
a.cc:5:12: error: 'b' was not declared in this scope
5 | if(b==0)
| ^
a.cc: In function 'int main()':
a.cc:14:20: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
14 | cin>... |
s098891506 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int m,int n){
if(b==0)
return m;
return gcd(n,m%n);
}
int main(){
while(true){
int a,b;
cin>>a>>b;
if(cin.eof())
break;
int g=gcd(a,b);
cout<<g<<' '<<a/g*b<<endl;
}
return 0;
} | a.cc: In function 'int gcd(int, int)':
a.cc:5:12: error: 'b' was not declared in this scope
5 | if(b==0)
| ^
|
s471482762 | p00005 | C++ | #include <iostream>
using namespace std;
int gcd(int x,int y);
int main(){
while(true){
int a,b;
cin >> a >> b;
if(cin.eof())
break;
int c=gcd(a,b);
cout << ' ' << a/c*b << endl;
}
return 0;
}
int gcd(int x,int y){
if(b==0)
return x;
return gcd(b,a%b);
} | a.cc: In function 'int gcd(int, int)':
a.cc:19:7: error: 'b' was not declared in this scope
19 | if(b==0)
| ^
a.cc:21:15: error: 'b' was not declared in this scope
21 | return gcd(b,a%b);
| ^
a.cc:21:17: error: 'a' was not declared in this scope
21 | return gcd(b,a%b);
... |
s125871500 | p00005 | C++ | include <iostream>
int GCD(int a, int b) {
while (b!=0) {
int r = a%b;
a = b;
b = r;
}
return a;
}
int main() {
int a,b;
while (std::cin>>a>>b) {
int gcd = GCD(a,b);
int lcm = a*b/gcd;
std::cout << gcd << ' ' << lcm << std::endl;
}
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:14: error: 'cin' is not a member of 'std'
12 | while (std::cin>>a>>b) {
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable b... |
s408518567 | p00005 | C++ | #include <iostream>
int GCD(int a, int b) {
while (b != 0) {
int r = a%b;
a = b;
b = r;
}
return a;
}
int main() {
int a, b;
while (std::cin >> a >> b) {
int gcd = GCD(a, b);
int lcm = round((double)a/gcd*b);
std::cout << gcd << ' ' << lcm << std::endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:27: error: 'round' was not declared in this scope
14 | int lcm = round((double)a/gcd*b);
| ^~~~~
|
s649902377 | p00005 | C++ | ~/5416061-aoj-0005.rb | a.cc:1:2: error: expected class-name before '/' token
1 | ~/5416061-aoj-0005.rb
| ^
|
s810666428 | p00005 | C++ | ruby 5416061-aoj-0005.rb | a.cc:1:1: error: 'ruby' does not name a type
1 | ruby 5416061-aoj-0005.rb
| ^~~~
|
s626605101 | p00005 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>
using namespace std;
typedef long long int lld;
const lld mod = 1e9+7;
const lld INF = 1e9;
//const lld MAXN = 1e9;
int main()
{
lld a,b;
while(cin >> ... | a.cc: In function 'int main()':
a.cc:22:28: error: expected ')' before ';' token
22 | while(cin >> a >> b;)
| ~ ^
| )
a.cc:22:29: error: expected primary-expression before ')' token
22 | while(cin >> a >> b;)
| ... |
s835790183 | p00005 | C++ | #include <iostream>
#include <string>
#include <vector>
class GcdAndLcm
{
public:
GcdAndLcm() : m_gcd(0), m_lcm(0) {}
void Run();
private:
void readData();
void GetData(std::string s, int& v1, int& v2);
int calcGcd(int m, int n);
int calcLcm(int m, int n);
void Show();
private:
std::... | a.cc: In member function 'void GcdAndLcm::GetData(std::string, int&, int&)':
a.cc:51:10: error: 'strncpy' is not a member of 'std'
51 | std::strncpy(tmp, s.c_str(), pos);
| ^~~~~~~
a.cc:53:10: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
53 | std::memset(tmp, 0x00, size... |
s447893574 | p00005 | C++ | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
//typedef struct
//{
// int left_val;
// int right_val;
//};
class GcdAndLcm
{
public:
GcdAndLcm() : m_gcd(0), m_lcm(0) {}
void Run();
private:
void readData();
void GetData(std::string s, int& v1, int& v2);
int calc... | a.cc: In member function 'void GcdAndLcm::GetData(std::string, int&, int&)':
a.cc:57:10: error: 'strncpy' is not a member of 'std'
57 | std::strncpy(tmp, s.c_str(), pos);
| ^~~~~~~
a.cc:59:10: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
59 | std::memset(tmp, 0x00, size... |
s491235792 | p00005 | C++ | #include <bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
int i,a,b,c;
while(cin>>a>>b){
if(a==b){
cout<<a<<" "<<a<<endl;
}
else{
if(a<b){
i=b-a;
}
else{
i=a-b;
}
for( int j=i;j>0;i-=2){
i... | a.cc: In function 'int main()':
a.cc:26:5: error: 're' was not declared in this scope
26 | re
| ^~
a.cc:26:7: error: expected '}' at end of input
26 | re
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s079011600 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,g,x,y,L;
while(i>50){
cin>>a>>b;
a=x;b=y;
while(1){
if(x<y){y-x;}
else if(x>y){x-y;}
else if(x==y){x=g;break;}
}
L=(a*b)/g;
cout<<g<<" "<<L<<endl;
++i;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:7: error: 'i' was not declared in this scope
5 | while(i>50){
| ^
|
s793579525 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,x,y,L,i=0;
while(cin>>a>>b){
x=a;y=b;
while(1){
if(x<y){y=y-x;}
else if(x>y){x=x-y;}
else if(x==y){break;}
}
L=(a*b)/g;
cout<<x<<" "<<L<<endl;
x=0;y=0;
++i;
if(i==49){break;}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:12:9: error: 'g' was not declared in this scope
12 | L=(a*b)/g;
| ^
|
s979014030 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,x,y,L,i=0;
while(i=0;i<=50;++i{
cin>>a>>b;
x=a;y=b;
while(1){
if(x<y){y=y-x;}
else if(x>y){x=x-y;}
else if(x==y){break;}
}
L=(a*b)/x;
if(x==1){cout<<y<<" "<<y<<endl;}
else{cout<<y<<" "<<L<<endl;}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:10: error: expected ')' before ';' token
5 | while(i=0;i<=50;++i{
| ~ ^
| )
a.cc:5:20: error: expected ';' before '{' token
5 | while(i=0;i<=50;++i{
| ^
| ;
|
s400756215 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,x,y,L,i=0;
while(i=0;i<=50;++i){
cin>>a>>b;
x=a;y=b;
while(1){
if(x<y){y=y-x;}
else if(x>y){x=x-y;}
else if(x==y){break;}
}
L=(a*b)/x;
if(x==1){cout<<y<<" "<<y<<endl;}
else{cout<<y<<" "<<L<<endl;}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:10: error: expected ')' before ';' token
5 | while(i=0;i<=50;++i){
| ~ ^
| )
a.cc:5:20: error: expected ';' before ')' token
5 | while(i=0;i<=50;++i){
| ^
| ;
|
s875605396 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,x,y,L,i=0;
while(i=0;i<=50;++i){
cin>>a>>b;
x=a;y=b;
while(1){
if(x<y){y=y-x;}
else if(x>y){x=x-y;}
else if(x==y){break;}
}
L=(a*b)/x;
if(x==1){cout<<y<<" "<<y<<endl;}
else{cout<<y<<" "<<L<<endl;}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:10: error: expected ')' before ';' token
5 | while(i=0;i<=50;++i){
| ~ ^
| )
a.cc:5:20: error: expected ';' before ')' token
5 | while(i=0;i<=50;++i){
| ^
| ;
|
s030688854 | p00005 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,x,y,L,i;
while(cin>>a>>b){
x=a;y=b;
while(1){
if(x<y){y=y-x;x=x-y;}
else if(x==y){break;}
else{x=x-y;y=y-x;}
}
L=(a*b)/x;
cout<<y<<" "<<L<<endl;
++i
if(i<=50){break;}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:4: error: expected ';' before 'if'
14 | ++i
| ^
| ;
15 | if(i<=50){break;}
| ~~
a.cc: At global scope:
a.cc:18:3: error: expected unqualified-id before 'return'
18 | return 0;
| ^~~~~~
a.cc:19:1: error: expected declaration before '}' ... |
s363262011 | p00005 | C++ | #include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int a,b,x,y,L;
while(cin>>a>>b){
x=a;y=b;
while(1){
if(x==y){break;}
else if(x==0)break;
else if(y==0)break;
else if(x<y){y=y-x;x=x-y;}
else{x=x-y;y=y-x;}
}
(float)L=((float)a*(float)b)/(float)x;
cout<<y<<" ";printf("%f",L);cout<<endl;
}
... | a.cc: In function 'int main()':
a.cc:15:1: error: lvalue required as left operand of assignment
15 | (float)L=((float)a*(float)b)/(float)x;
| ^~~~~~~~
|
s141128856 | p00005 | C++ | import sys
def main():
for line in sys.stdin:
a,b = map(int, line.split())
if a > b:
a,b = b,a
p = a * b #product
while True:
hoge = a
a = b % a
b = hoge
if a == 0:
gcd = b
break
lcm... | a.cc:7:19: error: stray '#' in program
7 | p = a * b #product
| ^
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'
|
s048003418 | p00005 | C++ | #include<stdio.h>
#include<iostream>
#include<iomanip>
#define ll long long
#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;
ll lcm(ll a, ll b) {
return a * (b / __algo_gcd(a, b));
}
void solver() {
ll a,b;
while(cin>>a>>b){
cout<<__algo_gcd(a,b)<<" "<<lcm(a,b)<<endl;
}
}
int... | a.cc: In function 'long long int lcm(long long int, long long int)':
a.cc:10:21: error: '__algo_gcd' was not declared in this scope
10 | return a * (b / __algo_gcd(a, b));
| ^~~~~~~~~~
a.cc: In function 'void solver()':
a.cc:16:15: error: '__algo_gcd' was not declared in this scope
1... |
s477087614 | p00005 | C++ | #include<stdio.h>
#include<iostream>
#include<iomanip>
#define ll long long
#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;
ll gcd(ll a, ll b) {
if (a < b) swap(a, b);
return b == 0 ? a : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
return a * (b / gcd(a, b));
}
void solver() {
ll a, b;
... | a.cc: In function 'void solver()':
a.cc:22:17: error: '__algo_gcd' was not declared in this scope
22 | cout << __algo_gcd(a, b) << " " << lcm(a, b) << endl;
| ^~~~~~~~~~
|
s150213711 | p00005 | C++ | nclude <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
unsigned long long a,b,c,d,e,f,maxx=0,data,minn=0,data2,m=0,n=0;
while (scanf("%llu %llu",&a,&b)!=EOF){
data=max(a,b)
for (;;){
if (a%data==0 && b%data==0){
maxx=data;
break;
}
data-=1;
}... | a.cc:1:1: error: 'nclude' does not name a type
1 | nclude <iostream>
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:5:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu... |
s887643697 | p00005 | C++ | #include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
int a,b,a1,b1,c;
while(scanf("%d%d",&a,&b)!=EOF)
{
if(a<b)
{
a1=b;
b1=a;
}
else
{
a1=a;
b1=b;
}
while(1)
{
r=a1%b1;
if(r==0)
break;
else
{
a1=b1;
b1=r;
}
... | a.cc: In function 'int main()':
a.cc:23:25: error: 'r' was not declared in this scope
23 | r=a1%b1;
| ^
a.cc:32:23: error: 'r' was not declared in this scope
32 | cout<<r<<" "<<a*b/r<<endl;
| ^
|
s813991630 | p00005 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int GCD(const int& a, const int& b) {
if (b == 0) {
return a;
}
return GCD(b, a%b);
}
int main() {
int gcd;
for (int a, b; cin >> a >> b) {
gcd = GCD(a, b);
cout << gcd << " " << a * b / gcd << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:37: error: expected ';' before ')' token
15 | for (int a, b; cin >> a >> b) {
| ^
| ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.