submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s748745054 | p02256 | C++ | #include <iostream>
#include <list>
#include<vector>
#include <utility>
using namespace std;
#define B
#ifdef B
int main(void) {
int x, y;
cin >> x >> y;
while (x != y)
{
if (x > y)
x -= y;
else
y -= x;
}
cout << x <<endl;
return 0;
} | a.cc:9: error: unterminated #ifdef
9 | #ifdef B
|
s398293724 | p02256 | C++ | #include <iostream>
using namespace std;
int gcd(x,y){
if(x == y){
return x;
}else if(x > y){
return gcd(y,x%y);
}else{
return gcd(x,y%x);
}
}
int main(){
int a,b;
cin >> a >> b;
cout << gcd(a,b) << endl;
} | a.cc:5:9: error: 'x' was not declared in this scope
5 | int gcd(x,y){
| ^
a.cc:5:11: error: 'y' was not declared in this scope
5 | int gcd(x,y){
| ^
a.cc:5:12: error: expression list treated as compound expression in initializer [-fpermissive]
5 | int gcd(x,y){
| ... |
s415816485 | p02256 | C++ | #include <iostream>
using namespace std;
int gcd(x,y){
if(x == y){
return x;
}else if(x > y){
return gcd(y,x%y);
}else{
return gcd(x,y%x);
}
}
int main(){
int a,b;
cin >> a >> b;
cout << gcd(a,b) << endl;
} | a.cc:5:9: error: 'x' was not declared in this scope
5 | int gcd(x,y){
| ^
a.cc:5:11: error: 'y' was not declared in this scope
5 | int gcd(x,y){
| ^
a.cc:5:12: error: expression list treated as compound expression in initializer [-fpermissive]
5 | int gcd(x,y){
| ... |
s362955754 | p02256 | C++ | // ALDS1_1_B_GreatestCommonDivisor.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//
#include "stdafx.h"
#include<iostream>
#include<algorithm>
using namespace std;
int GCD(int x, int y)
{
if (y > x)
{
swap(x, y);
}
while (y > 0)
{
int a = x % y;
x = y;
y... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s817169452 | p02256 | C++ | #include<isotream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
if (a < b) int c = a; a = b; b = c;
int n;
for (int i = 1; i < a / 2; i++){
if (a%i == 0 && b%i == 0) n = i;
}
cout << n << endl;
} | a.cc:1:9: fatal error: isotream: No such file or directory
1 | #include<isotream>
| ^~~~~~~~~~
compilation terminated.
|
s978539380 | p02256 | C++ |
#include<iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
if (a < b) int c = a; a = b; b = c;
int n=0;
for (int i = 1; i < a / 2; i++){
if (a%i == 0 && b%i == 0) n = i;
}
cout << n << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:42: error: 'c' was not declared in this scope
9 | if (a < b) int c = a; a = b; b = c;
| ^
|
s262873002 | p02256 | C++ | #include<iostream>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
if (a < b) int c = a; a = b; b = c;
int n=0;
for (int i = 1; i < a / 2; i++){
if (a%i == 0 && b%i == 0) n = i;
}
cout << n << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:42: error: 'c' was not declared in this scope
8 | if (a < b) int c = a; a = b; b = c;
| ^
|
s910764888 | p02256 | C++ |
#include<iostream>
using namespace std;
int god(x, y)
{
if (a < b){
c = a; a = b; b = c;
}
for (int i = b; i >= 1; i--;){
if (a%i == 0 && b%i == 0)
n = i;
}
return n;
}
int main()
{
int a, b;
cin >> a >> b;
int c;
int n=god(x, y);
cout << n << endl;
return 0;
} | a.cc:5:9: error: 'x' was not declared in this scope
5 | int god(x, y)
| ^
a.cc:5:12: error: 'y' was not declared in this scope
5 | int god(x, y)
| ^
a.cc:5:13: error: expression list treated as compound expression in initializer [-fpermissive]
5 | int god(x, y)
| ... |
s953074641 | p02256 | C++ | #include<iostream>
using namespace std;
int god(int x, int y)
{
if (a < b){
c = a; a = b; b = c;
}
for (int i = b; i >= 1; i--;){
if (a%i == 0 && b%i == 0)
n = i;
}
return n;
}
int main()
{
int a, b;
cin >> a >> b;
int c;
int n=god(x, y);
cout << n << endl;
return 0;
} | a.cc: In function 'int god(int, int)':
a.cc:6:13: error: 'a' was not declared in this scope
6 | if (a < b){
| ^
a.cc:6:17: error: 'b' was not declared in this scope
6 | if (a < b){
| ^
a.cc:7:17: error: 'c' was not declared in this scope
7 | ... |
s495850551 | p02256 | C++ |
#include<iostream>
using namespace std;
int god(int a, int b)
{
int c;
if (a < b){
c = a;
a = b;
b = c;
}
for (int i = b; i >= 1; i--;){
if (a%i == 0 && b%i == 0)
n = i;
}
return n;
}
int main()
{
int a, b;
cin >> a >> b;
int n=god(a, b);
cout << n << endl;
return 0;
} | a.cc: In function 'int god(int, int)':
a.cc:13:36: error: expected ')' before ';' token
13 | for (int i = b; i >= 1; i--;){
| ~ ^
| )
a.cc:13:37: error: expected primary-expression before ')' token
13 | for (int i = b;... |
s309299635 | p02256 | C++ |
#include<iostream>
using namespace std;
int god(int a, int b)
{
int c,n;
if (a < b){
c = a;
a = b;
b = c;
}
for (int i = b; i >= 1; i--;){
if (a%i == 0 && b%i == 0)
n = i;
}
return n;
}
int main()
{
int a, b;
cin >> a >> b;
int n=god(a, b);
cout << n << endl;
return 0;
} | a.cc: In function 'int god(int, int)':
a.cc:13:36: error: expected ')' before ';' token
13 | for (int i = b; i >= 1; i--;){
| ~ ^
| )
a.cc:13:37: error: expected primary-expression before ')' token
13 | for (int i = b;... |
s428372849 | p02256 | C++ | #include <bits/stdc++.h>
using namespace std;
int gcd(int a,int b) {
if (a<b) {
swap(a,b);
}
if (b==0) {
return a;
}
return gcd(b,a%b);
}
int main() {
int x, y;
cin >> x >> y;
printf("%d\n",gcd(x,y));
return 0; | a.cc: In function 'int main()':
a.cc:17:12: error: expected '}' at end of input
17 | return 0;
| ^
a.cc:13:12: note: to match this '{'
13 | int main() {
| ^
|
s393399440 | p02256 | C++ | def gcd(x, y):
if x<y:
return gcd(y, x)
while x%y!=0:
r = x%y
x, y = y, r
return r
iinfo = map(int, input().split())
print(gcd[info0], info[1])) | a.cc:1:1: error: 'def' does not name a type
1 | def gcd(x, y):
| ^~~
|
s071134557 | p02256 | C++ | #include <stdio.h>
void insertionsort(int A[],int count);
void swap(int *p_form,int *p_to);
int A[1000000000];
int main(){
int x,y,z,i,j,count,ans;
scanf("%d %d",&x,&y);
if(x==y){
printf("%d\n",x);
} else {
count=0;
if(x<y){
z=x;
x=y;
y=z;
}
for(i=1;i<=y;i++){
if(y%i=... | a.cc: In function 'void insertionsort(int*, int)':
a.cc:41:13: error: 'sum' was not declared in this scope
41 | for(i=0;i<sum;i++){
| ^~~
|
s877297287 | p02256 | C++ | #include <stdio.h>
void insertionsort(int A[],int count);
void swap(int *p_form,int *p_to);
int A[1000000000];
int main(){
int x,y,z,i,j,count,ans;
scanf("%d %d",&x,&y);
if(x==y){
printf("%d\n",x);
} else {
count=0;
if(x<y){
z=x;
x=y;
y=z;
}
for(i=1;i<=y;i++){
if(y%i=... | a.cc: In function 'void insertionsort(int*, int)':
a.cc:41:13: error: 'sum' was not declared in this scope
41 | for(i=0;i<sum;i++){
| ^~~
|
s236417745 | p02256 | C++ | #include <stdio.h>
int main()
{
int a, b, ans;
int a_divisor[1000000000], b_divisor[1000000000];
int i, j
scanf("%d%d", &a, &b);
for(i = 1; i < a; i++){
if(a%i == 0){
a_divisior += [a/i];
}
}
for(i = 1; i < b; i++){
if(b%i == 0){
b_divisi... | a.cc: In function 'int main()':
a.cc:8:5: error: expected initializer before 'scanf'
8 | scanf("%d%d", &a, &b);
| ^~~~~
a.cc:12:13: error: 'a_divisior' was not declared in this scope; did you mean 'a_divisor'?
12 | a_divisior += [a/i];
| ^~~~~~~~~~
| ... |
s101348970 | p02256 | C++ | #include "stdafx.h"
#include "iostream"
using namespace std;
int del(int a, int b)
{
if (b == 0) return a;
else return del(b,a%b);
}
int main()
{
int a, b;
cin >> a >> b;
if (a > b)
{
int s = a;
a = b;
b = s;
}
cout << del(a, b);
return 0;
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s210683915 | p02256 | C++ | #include "stdafx.h"
#include "iostream"
using namespace std;
int del(int a, int b)
{
if (b == 0 || a==0) return a;
else return del(b,a%b);
}
int main()
{
int a, b;
cin >> a >> b;
if (a > b)
{
int s = a;
a = b;
b = s;
}
cout << del(a, b);
return 0;
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s495070712 | p02256 | C++ | #include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
using namespace std;
int main () {
int x, y, ans;
cin >> x >> y;
while (1) {
if (x >= y) {
ans = y;
x = x % y;
if (x == 0) {
... | a.cc: In function 'int main()':
a.cc:19:15: error: expected '(' before '{' token
19 | } else if {
| ^
| (
a.cc: At global scope:
a.cc:27:3: error: 'cout' does not name a type
27 | cout << ans << endl;
| ^~~~
a.cc:28:3: error: expected unqualified-id before 're... |
s515760972 | p02256 | C++ | #include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
using namespace std;
int main () {
int x, y, ans;
cin >> x >> y;
while (1) {
if (x >= y) {
ans = y;
x = x % y;
if (x == 0) {
... | a.cc:27:3: error: 'cout' does not name a type
27 | cout << ans << endl;
| ^~~~
a.cc:28:3: error: expected unqualified-id before 'return'
28 | return 0;
| ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
29 | }
| ^
|
s685470125 | p02256 | C++ | #include<studio.h>
int gcd (int x,int y){
if(x<y){
int t=x;
x=y;
y=t;
}
int a;
while(y>0){
a=x%y;
x=y;
y=r;
}
return x;
} | a.cc:1:9: fatal error: studio.h: No such file or directory
1 | #include<studio.h>
| ^~~~~~~~~~
compilation terminated.
|
s732360146 | p02256 | C++ | #include <iostream>
using namespace std;
int GCD(int x, int y) {
if (y == 0) return x;
return GCD(y, x%y);
}
int main() {
int n, x;
cin >> x >> y;
cout << GCD( x, y ) << endl;
} | a.cc: In function 'int main()':
a.cc:11:17: error: 'y' was not declared in this scope
11 | cin >> x >> y;
| ^
|
s970931651 | p02256 | C++ | #include <stdio.h>
int main (void)
{
int x,y,s,r;
scanf("%d %d\n",&x,&y);
if(x < y){
s = x;
x = y;
y = s;
}
r = x % y;
while(r! = 0){
x = y;
b = r;
r = x;
}
printf("%d\n",y);
return 0;
} | a.cc: In function 'int main()':
a.cc:17:8: error: expected ')' before '!' token
17 | while(r! = 0){
| ~ ^
| )
a.cc:17:10: error: expected primary-expression before '=' token
17 | while(r! = 0){
| ^
|
s156133169 | p02256 | C++ | import java.util.Scanner;
public class Ex1 {
public static void main(String[] args) {
Scanner x = new Scanner(System.in);
int a = x.nextInt(), b = x.nextInt();
}
static int gcd(int a, int b){
while (b != 0){
int remainder = a % b;
a = b;
b = remai... | 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:2:1: error: expected unqualified-id before 'public'
2 | public class Ex1 {
| ^~~~~~
|
s611983931 | p02256 | C++ | // ALDS_1_1_B.cpp
// Greatest Common Divisor
#include <cstdio>
using namespace std;
int gcd(int a, int b)
{
if a >= b
return gcd(b, a % b);
else
return gcd(a, b % a);
}
int main()
{
int a, b;
scanf("%d %d", &a, &b);
int c = gcd(a, b);
printf("%d\n", c);
return 0;
} | a.cc: In function 'int gcd(int, int)':
a.cc:9:12: error: expected '(' before 'a'
9 | if a >= b
| ^
| (
a.cc:11:9: error: 'else' without a previous 'if'
11 | else
| ^~~~
|
s195792331 | p02256 | C++ | #include <iostream>
using namespace std;
void main()
{
int x = 24;
int y = 18;
int temp;
for(int i = 2; i<y; i++)
{
if(x%i == 0 >> y%i == 0)
{
//cout<<i<<endl;
temp = i;
} ... | a.cc:4:5: error: '::main' must return 'int'
4 | void main()
| ^~~~
|
s423990225 | p02256 | C++ | #include <cmath>
#include <iostream>
using namespace std;
int nod(int a, int b)
{
int max;
max = 1;
int min;
if (a >= b)
min = b;
else
min = a;
for (int j = 1; j <= min; j++)
{
if (a%j == 0 && b%j == 0)
max = j;
}
return max;
}
int main()
{
int a,b;
cin >> a >> b;
cout << nod(a,b);
return 0;
}#include <cmath>
#include ... | a.cc:26:2: error: stray '#' in program
26 | }#include <cmath>
| ^
a.cc:26:3: error: 'include' does not name a type
26 | }#include <cmath>
| ^~~~~~~
a.cc:29:5: error: redefinition of 'int nod(int, int)'
29 | int nod(int a, int b)
| ^~~
a.cc:4:5: note: 'int nod(int, int)' previously defi... |
s570621310 | p02256 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int x=scan.nextInt();
int y=scan.nextInt();
int GCD=0;
while(x%y!=0){
if(x>=y){
x=x%y;
GCD=x;
}
else{
y=y%x;
GCD=y;
}
}
System.out.println(GCD);
}
} | 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:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s737290119 | p02256 | C++ | #include<iostream>
int main() {
int x, y;
std::cin >> x >> y;
std::cout << __gcd(x,y) << std::endl;
return0;
} | a.cc: In function 'int main()':
a.cc:6:18: error: '__gcd' was not declared in this scope
6 | std::cout << __gcd(x,y) << std::endl;
| ^~~~~
a.cc:7:5: error: 'return0' was not declared in this scope
7 | return0;
| ^~~~~~~
|
s571541368 | p02256 | C++ | #include<iostream>
int main() {
int x, y;
std::cin >> x >> y;
std::cout << __gcd(x,y) << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:18: error: '__gcd' was not declared in this scope
6 | std::cout << __gcd(x,y) << std::endl;
| ^~~~~
|
s048511245 | p02256 | C++ | #include<iostream>
#include<algorithm>
int main() {
int x, y;
std::cin >> x >> y;
std::cout << __gcd(x,y) << std::endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:18: error: '__gcd' was not declared in this scope; did you mean 'std::__gcd'?
7 | std::cout << __gcd(x,y) << std::endl;
| ^~~~~
| std::__gcd
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
... |
s012810645 | p02256 | C++ | #include<iostream>
inf gcd(int x, int y){
if(x % y == 0){
return x;
} else {
gcd(y, x%y);
}
}
int main() {
int x, y, swp;
std::cin >> x >> y;
if( x < y ){
swp = x;
x = y;
y = x;
}
std::cout << gcd(x,y) << std::endl;
return 0;
} | a.cc:3:1: error: 'inf' does not name a type; did you mean 'int'?
3 | inf gcd(int x, int y){
| ^~~
| int
a.cc: In function 'int main()':
a.cc:19:18: error: 'gcd' was not declared in this scope
19 | std::cout << gcd(x,y) << std::endl;
| ^~~
|
s728180619 | p02256 | C++ | public class Main {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
long x=scan.nextInt();
long y=scan.nextInt();
long GCD=x;
while(x%y!=0){
if(x>=y){
x=x%y;
GCD=x;
}
else{
... | a.cc:1:1: error: expected unqualified-id before 'public'
1 | public class Main {
| ^~~~~~
|
s103516563 | p02256 | C++ | # coding:utf-8
def gcd(x,y):
if x == y:
print x
return
else if x < y:
t = x
x = y
y = t
a = x % y
y_ans = []
two_ans = []
for i in range(1,y + 1):
if y % i == 0:
y_ans.append(i)
for i in range(1,a + 1):
if a % i == 0:
... | a.cc:1:3: error: invalid preprocessing directive #coding
1 | # coding:utf-8
| ^~~~~~
a.cc:2:1: error: 'def' does not name a type
2 | def gcd(x,y):
| ^~~
|
s754697765 | p02256 | C++ | a,b=map(int,input().split())
while b:a,b=b,a%b
print(a) | a.cc:1:1: error: 'a' does not name a type
1 | a,b=map(int,input().split())
| ^
|
s067959563 | p02256 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int x, y;
int remainder;
int ans;
cin >> x >> y;
if (x<y) {
int t = x;
x = y;
y = t;
}
remainder = x % y;
if (x == y) cout << x << endl;
else if{
for (int i = 1; i <= remainder; i++) {
if (remainder%i == 0) {
if (y%i == 0)... | a.cc: In function 'int main()':
a.cc:19:16: error: expected '(' before '{' token
19 | else if{
| ^
| (
|
s065277754 | p02256 | C++ | #include<stdio.h>
int main (){
int a,b;
scanf("%d%d",&a,&b);
int x=0;
if(b>a)
{
x=a,a=b,b=x;
}
else;
int z=b;
while(a%b!=0){
z=a%b;
a=b;
b=z;
}
prinf("%d\n",z);
return 0;
}
| a.cc: In function 'int main()':
a.cc:18:5: error: 'prinf' was not declared in this scope; did you mean 'printf'?
18 | prinf("%d\n",z);
| ^~~~~
| printf
|
s287653566 | p02256 | C++ | /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
| |
s347908576 | p02256 | C++ | int maxCom(int x, int y) {
int max = 1;
for (int i = 1; i <= ((x > y) ? y : x); i++) {
if (x%i == 0 && y%i == 0) {
if (max < i) max = i;
}
}
return max;
}
int main(void){
int x, y;
cin >> x >> y;
int max = maxCom(x, y);
cout << max;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:9: error: 'cin' was not declared in this scope
13 | cin >> x >> y;
| ^~~
a.cc:17:9: error: 'cout' was not declared in this scope
17 | cout << max;
| ^~~~
|
s791323004 | p02256 | C++ | include<cstdlib>
#include<iostream>
using namespace std;
int gcd(int x,int y){
int m;
if(x>y){
for(int i=y;i>0;i--)
if(x%i==0){
m=i;
break;
}
}else{
for(int i=x;i>0;i--)
if(y%i==0){
m=i;
break;
}
}
return m;
}
int main(){
int a,b;
cin>>a;
cin>>b;
cout<<gcd(a,b);... | a.cc:1:1: error: 'include' does not name a type
1 | include<cstdlib>
| ^~~~~~~
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,
fr... |
s064465211 | p02256 | C++ | unsigned euclidean_gcd(unsigned a,unsigned b){
while(1){
if(a<b) swap(a,b);
if(!b) break;
a%=b;
}
return a;
}
| a.cc: In function 'unsigned int euclidean_gcd(unsigned int, unsigned int)':
a.cc:3:13: error: 'swap' was not declared in this scope
3 | if(a<b) swap(a,b);
| ^~~~
|
s031558715 | p02256 | C++ | #include<iostream.h>
int gcd(int a,int b)
{
if (a%b==0)
{
return(b);
}
else
{
return(gcd(b,a%b));
}
}
int main()
{
int x,y;
cin >> x;
cin >> y;
cout << gcd(x,y) <<"\n";
return 0;
}
| a.cc:1:9: fatal error: iostream.h: No such file or directory
1 | #include<iostream.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s346572116 | p02256 | C++ | #include<iostream>
int gcd(int a,int b)
{
if (a%b==0)
{
return(b);
}
else
{
return(gcd(b,a%b));
}
}
int main()
{
int x,y;
cin >> x;
cin >> y;
cout << gcd(x,y) <<"\n";
return 0;
}
| a.cc: In function 'int main()':
a.cc:18:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
18 | cin >> x;
| ^~~
| 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... |
s036448269 | p02256 | C++ | /*
* ITP1_6_B.cpp
*
* Created on: Apr 20, 2018
* Author: 13743
*/
#include<iostream>
using namespace std;
int gcd(long x, long y) {
if(x == 0 || y == 0) {
return x + y;
}
if(x > y) {
return gcd(y, x % y);
}
return gcd(x, y % x);
}
int main() {
long x, y;
cin >> x >> y;
cout >> gcd(x, y) << en... | a.cc: In function 'int main()':
a.cc:25:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
25 | cout >> gcd(x, y) << endl;
| ~~~~ ^~ ~~~~~~~~~
| | |
| | int
| std::ostream... |
s914099230 | p02256 | C++ | /*
* ITP1_6_B.cpp
*
* Created on: Apr 20, 2018
* Author: 13743
*/
#include<iostream>
using namespace std;
long gcd(long x, long y) {
if(x == 0 || y == 0) {
return x + y;
}
if(x > y) {
return gcd(y, x % y);
}
return gcd(x, y % x);
}
int main() {
long x, y;
cin >> x >> y;
cout >> gcd(x, y) << e... | a.cc: In function 'int main()':
a.cc:25:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'long int')
25 | cout >> gcd(x, y) << endl;
| ~~~~ ^~ ~~~~~~~~~
| | |
| | long int
| st... |
s549096089 | p02256 | C++ | def GCD(x,y):
if(x >= y):
z = y
w = x%y
else:
z = x
w = y%x
if(not(w == 0)):
return GCD(z,w)
else:
return z
A = [int() for i in input().split()]
print(GCD(A[0],A[1]))
"""実行結果
100 55
5
66 77
11
"""
| a.cc:18:3: warning: missing terminating " character
18 | """実行結果
| ^
a.cc:18:3: error: missing terminating " character
18 | """実行結果
| ^~~~~~~~~
a.cc:28:3: warning: missing terminating " character
28 | """
| ^
a.cc:28:3: error: missing terminating " character
a.cc:1:1: error: 'def' does ... |
s436132171 | p02256 | C++ |
import java.io.*;
import java.util.*;
class Main{
public static void main(String[] args){
solve();
}
public static void solve(){
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
if(x<y){
int tmp = x;
x = y;
y = tmp;
}
while(true){
int a = x % y;
if(a==... | a.cc:2:1: error: 'import' does not name a type
2 | import java.io.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.util.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:15:... |
s487060603 | p02256 | C++ | #include<stdio.h>
int main(void)
{
int x, y, d;
scanf_s("%d", &x);
scanf_s("%d", &y);
d = x % y;
while (d != 0) {
x = y;
y = d;
d = x % y;
}
printf("%d", y);
}
| a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
8 | scanf_s("%d", &x);
| ^~~~~~~
| scanf
|
s151293110 | p02256 | C++ | #include<stdio.h>
int main(void)
{
int x, y, d;
scanf_s("%d", &x);
scanf_s("%d", &y);
d = x % y;
while (d != 0) {
x = y;
y = d;
d = x % y;
}
printf("%d", y);
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
8 | scanf_s("%d", &x);
| ^~~~~~~
| scanf
|
s346741454 | p02256 | C++ | /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
| |
s120768801 | p02256 | C++ | #include <iostream>
using namespace std;
int main()
{
int x,y,N1,i,a,answer;
cin>>x>>y;
if(x>=y)
{
N1=x;
N2=y;
}else
{
N1=y;
N2=x;
}
while(1)
{
a=N1%N2
if(a==0){
cout<<N2<<endl;
break
}endl{
N1=N2
N2=a
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:3: error: 'N2' was not declared in this scope; did you mean 'N1'?
11 | N2=y;
| ^~
| N1
a.cc:15:3: error: 'N2' was not declared in this scope; did you mean 'N1'?
15 | N2=x;
| ^~
| N1
a.cc:20:8: error: 'N2' was not declared in this scope; d... |
s085375237 | p02256 | C++ | #include <iostream>
using namespace std;
int main()
{
int x,y,N1,N2,i,a;
cin>>x>>y;
if(x>=y)
{
N1=x;
N2=y;
}else
{
N1=y;
N2=x;
}
while(1)
{
a=N1%N2
if(a==0){
cout<<N2<<endl;
break
}endl{
N1=N2
N2=a
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:10: error: expected ';' before 'if'
20 | a=N1%N2
| ^
| ;
21 | if(a==0){
| ~~
a.cc:24:8: error: expected ';' before '{' token
24 | }endl{
| ^
| ;
a.cc:27:2: error: statement cannot resolve address... |
s788004082 | p02256 | C++ | #include <iostream>
using namespace std;
int main()
{
int x,y,N1,N2,i,a;
cin>>x>>y;
if(x>=y)
{
N1=x;
N2=y;
}else
{
N1=y;
N2=x;
}
while(1)
{
a=N1%N2
if(a==0){
cout<<N2<<endl;
break
}endl{
N1=N2
N2=a
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:10: error: expected ';' before 'if'
20 | a=N1%N2
| ^
| ;
21 | if(a==0){
| ~~
a.cc:24:8: error: expected ';' before '{' token
24 | }endl{
| ^
| ;
a.cc:27:2: error: statement cannot resolve address... |
s910865693 | p02256 | C++ | #include<iostream>
#include<utility>
int gcd(int x,int y){
int z
if(x<y) std::swap(x,y);
while(y>0){
z=x%y;
x=y;
y=z;
}
return x;
}
int main(void){
int x,y;
std::cin>>x>>y;
std::cout<<gcd(x,y)<<std::endl;
}
| a.cc: In function 'int gcd(int, int)':
a.cc:6:5: error: expected initializer before 'if'
6 | if(x<y) std::swap(x,y);
| ^~
a.cc:8:9: error: 'z' was not declared in this scope
8 | z=x%y;
| ^
|
s884763968 | p02256 | C++ | #include<iostream>
using namespace std;
int gcd(int x,int y){
if(x%y==0)return y;
else return gcd(b,a%b);
}
int main(){
int a,b;
cin >> a>>b;
cout <<gcd(a,b)<<endl;
}
| a.cc: In function 'int gcd(int, int)':
a.cc:5:19: error: 'b' was not declared in this scope
5 | else return gcd(b,a%b);
| ^
a.cc:5:21: error: 'a' was not declared in this scope
5 | else return gcd(b,a%b);
| ^
|
s461816968 | p02256 | C++ | #include<bits/stdc++>
using namespace
int main(){
int a,b,c;
cin>>a>>b;
while(a==0){
if(a<b)swap(a,b);
a%=b;
}cout<<b;
return 0;
}
| a.cc:1:9: fatal error: bits/stdc++: No such file or directory
1 | #include<bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s813816084 | p02256 | C++ | #include<bits/stdc++.h>
using namespace
int main(){
int a,b,c;
cin>>a>>b;
while(a==0){
if(a<b)swap(a,b);
a%=b;
}cout<<b;
return 0;
}
| a.cc:4:1: error: expected identifier before 'int'
4 | int main(){
| ^~~
a.cc:2:16: error: expected ';' before 'int'
2 | using namespace
| ^
| ;
3 |
4 | int main(){
| ~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not dec... |
s390331745 | p02256 | C++ | #include<bits/stdc++.h>
using namespace
int main(){
int a,b;
cin>>a>>b;
while(a!=0){
if(a<b) swap(a,b);
a%=b;
}cout<<b<<endl;
return 0;
}
| a.cc:4:1: error: expected identifier before 'int'
4 | int main(){
| ^~~
a.cc:2:16: error: expected ';' before 'int'
2 | using namespace
| ^
| ;
3 |
4 | int main(){
| ~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not dec... |
s752486495 | p02256 | C++ | #include <stdio.h>
int gcd(int x,int y){
if(x<y){
swap(x,y);
}
while(y>0){
int r=x%y;
x=y;
y=r;
}
return x;
}
int main(){
int x,y;
scanf("%d%d",&x,&y)
printf("%d\n",gcd(x,y));
return 0;
}
| a.cc: In function 'int gcd(int, int)':
a.cc:5:5: error: 'swap' was not declared in this scope
5 | swap(x,y);
| ^~~~
a.cc: In function 'int main()':
a.cc:17:22: error: expected ';' before 'printf'
17 | scanf("%d%d",&x,&y)
| ^
| ;
18 | prin... |
s725257686 | p02256 | C++ | #include <stdio.h>
int gcd(int x,int y){
if(x<y){
swap(x,y);
}
while(y>0){
int r=x%y;
x=y;
y=r;
}
return x;
}
int main(){
int x,y;
scanf("%d%d",&x,&y);
printf("%d\n",gcd(x,y));
return 0;
}
| a.cc: In function 'int gcd(int, int)':
a.cc:5:5: error: 'swap' was not declared in this scope
5 | swap(x,y);
| ^~~~
|
s501665047 | p02256 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int inf = 1e9 + 7;
int main() {
int x,y;
cin >> x >> y;
int d = min(x,y);
while(){
if(x%d == 0 && y%d == 0){
cout << d << endl;
return 0;
}
d--;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:15: error: expected primary-expression before ')' token
13 | while(){
| ^
|
s417077530 | p02256 | C++ | #include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <sstream>
using namespace std;
const int N_MAX = 1000000;
int main(){
int x, y;
cin >> x;
cin >> y;
int residue = -1;
while(residue != 0){
residue = max(x, y) % min(x, y);
residue = 0;
int ans = ... | a.cc: In function 'int main()':
a.cc:25:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
25 | cout << ans << endl;
| ^~~
| abs
|
s384584093 | p02256 | C++ | #include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <sstream>
using namespace std;
const int N_MAX = 1000000;
int main(){
int x, y;
cin >> x;
cin >> y;
int residue = -1;
int ans;
while(residue != 0){
residue = max(x, y) % min(x, y);
ans = x>y?y:x... | a.cc: In function 'int main()':
a.cc:22:18: error: expected ';' before 'if'
22 | ans = x>y?y:x
| ^
| ;
23 | if(x>y) x = residue;
| ~~
a.cc:24:5: error: 'else' without a previous 'if'
24 | else y = residue;
| ^~~~
|
s695090994 | p02256 | C++ | #include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <sstream>
using namespace std;
const int N_MAX = 1000000;
int main(){
int x, y;
cin >> x;
cin >> y;
int residue = -1;
int answer;
while(residue != 0){
residue = max(x, y)%min(x, y);
if(residue==0) ... | a.cc: In function 'int main()':
a.cc:30:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
30 | return ans;
| ^~~
| abs
|
s709115263 | p02256 | C++ | #include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <sstream>
using namespace std;
const int N_MAX = 1000000;
int main(){
int x, y;
cin >> x;
cin >> y;
int residue = -1;
int answer;
while(residue != 0){
residue = max(x, y)%min(x, y);
if(residue==0) ... | a.cc: In function 'int main()':
a.cc:26:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
26 | ans = min(x, y);
| ^~~
| abs
|
s651085361 | p02256 | C++ | #include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <sstream>
using namespace std;
const int N_MAX = 1000000;
int main(){
int x, y;
cin >> x;
cin >> y;
int residue = -1;
int answer;
/*
while(residue != 0){
residue = max(x, y)%min(x, y);
if(residue... | a.cc: In function 'int main()':
a.cc:27:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
27 | ans = min(x, y);
| ^~~
| abs
|
s086712414 | p02256 | C++ | #include<stdio.h>
void gcd(int x, int y){
int t=0;
if(y==0)
output(x);
else{
t = x%y;
gcd(y,t);
}
}
void output(int x){
printf("%d",x);
putchar('\n');
}
int main(void){
int x=0;
int y=0;
scanf("%d",&x);
scanf("%d",&y);
gcd(x,y);
return 0;
}
| a.cc: In function 'void gcd(int, int)':
a.cc:8:5: error: 'output' was not declared in this scope
8 | output(x);
| ^~~~~~
|
s852837637 | p02256 | C++ | l=input().split()
l = [int(s) for s in l]
for i in range(1,l[0]):
if l[0] % i == 0 and l[1] % i == 0:
c = i
print(c)
| a.cc:1:1: error: 'l' does not name a type
1 | l=input().split()
| ^
|
s926113153 | p02256 | C++ | l=input().split()
l = [int(s) for s in l]
for i in range(1,l[0]):
if l[0] % i == 0 and l[1] % i == 0:
c = i
print(c)
| a.cc:1:1: error: 'l' does not name a type
1 | l=input().split()
| ^
|
s447117411 | p02256 | C++ | l=input().split()
l = [int(s) for s in l]
for i in range(1,l[0]+1):
if l[0] % i == 0 and l[1] % i == 0:
c = i
print(c)
| a.cc:1:1: error: 'l' does not name a type
1 | l=input().split()
| ^
|
s866707690 | p02256 | C++ | #include <stdio.h>
int main(){
int x, y, z;
scanf("%d%d", &x, &y);
z = gcd(x, y); // 最大公約数を求める
printf("%d\n", z); // 最大公約数を表示
}
int gcd(x, y){
int z, str;
if(x < y) { // x > y として計算するため
str = y; y = x; x = str; // xとyを交換
}
// ユークリッドの互除法を実行 //
while(y > 0){
... | a.cc: In function 'int main()':
a.cc:7:9: error: 'gcd' was not declared in this scope
7 | z = gcd(x, y); // 最大公約数を求める
| ^~~
a.cc: At global scope:
a.cc:12:9: error: 'x' was not declared in this scope
12 | int gcd(x, y){
| ^
a.cc:12:12: error: 'y' was not declared in this scope
... |
s871764887 | p02256 | C++ | #include <iostream>
using namespace std;
int main() {
gcd(x, y)
if x < y
swap(x, y)
while y > 0
r = x % y
x = y
y = r
return x;
}
| a.cc: In function 'int main()':
a.cc:5:5: error: 'x' was not declared in this scope
5 | gcd(x, y)
| ^
a.cc:5:8: error: 'y' was not declared in this scope
5 | gcd(x, y)
| ^
a.cc:5:1: error: 'gcd' was not declared in this scope
5 | gcd(x, y)
| ^~~
|
s072832705 | p02256 | C++ | #include <iostream>
using namespace std;
int main() {
cin >> x >> y;
gcd(x, y)
if (x < y){
swap(x, y);
}
while (y > 0){
r = x % y;
x = y;
y = r;
return x;
}
cout << x << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:16: error: 'x' was not declared in this scope
5 | cin >> x >> y;
| ^
a.cc:5:21: error: 'y' was not declared in this scope
5 | cin >> x >> y;
| ^
a.cc:6:1: error: 'gcd' was not declared in this scope
6 | gcd... |
s017700089 | p02256 | C++ | #include <iostream>
using namespace std;
int main() {
int x , y , r;
cin >> x >> y;
if(x < y){
int a = y;
y = x;
x = a;
}
do{
r = x % y;
x = y;
y = r;
}while(r != 0);
cout << x << endl;
| a.cc: In function 'int main()':
a.cc:17:23: error: expected '}' at end of input
17 | cout << x << endl;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s708862959 | p02256 | C++ | #include <math.h>
int gcd(double x, double y)
{
int m = (int)floor(x);
int n = (int)floor(y);
int r;
do {
r = m % n;
m = n;
n = r;
} while (r != 0);
return m;
}
| /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
|
s684135877 | p02256 | C++ | #include<iostream.h>
int gcd(int a,int b)
{
if (a%b==0)
{
return(b);
}
else
{
return(gcd(b,a%b));
}
}
int main()
{
int x,y;
cout << "1番目の整数を入力してください\n";
cin >> x;
cout << "2番目の整数を入力してください\n";
cin >> y;
cout << "2つの数の最大公約数は" << gcd(x,y) << "です\n";
return 0;
}
| a.cc:1:9: fatal error: iostream.h: No such file or directory
1 | #include<iostream.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s533364785 | p02256 | C++ |
#include <stdio.h>
#include <errno.h>
int main(int argc, char **argv)
{
unsigned long int x[2];
if (argc > 2) {
int i, c;
argv++;
for (i = 0; i < 2; i++) {
char *t;
x[i] = strtoul(argv[i], &t, 10);
if (errno)
return 1;
if (*t)
return 2;
}
printf("最大公約数 %lu\n最小公倍数 %lu\n", gcd(x[0],x[1]),lcm(x[0],x[1]));
}
return 0;
}
| a.cc: In function 'int main(int, char**)':
a.cc:12:8: error: 'strtoul' was not declared in this scope
12 | x[i] = strtoul(argv[i], &t, 10);
| ^~~~~~~
a.cc:18:44: error: 'gcd' was not declared in this scope
18 | printf("最大公約数 %lu\n最小公倍数 %lu\n", gcd(x[0],x[1]),lcm(x[0],x[1]));
| ... |
s802954284 | p02256 | C++ | #include <iostream>
using namespace std;
unsigned int GCD(const unsigned int a, const unsigned int b) {
unsigned int x, y, memo; x = a; y = b;
memo = x%y;
while (memo) {
x = y;
y = memo;
memo = x%y;
}
return y
| a.cc: In function 'unsigned int GCD(unsigned int, unsigned int)':
a.cc:11:9: error: expected ';' at end of input
11 | return y
| ^
| ;
a.cc:11:9: error: expected '}' at end of input
a.cc:3:62: note: to match this '{'
3 | unsigned int GCD(const unsigned int a, const unsigned int b) {
... |
s267038713 | p02256 | C++ | int main(void){
int x, y;
scanf("%d %d", &x, &y);
printf("%d\n", GCD(x, y));
}
| a.cc: In function 'int main()':
a.cc:3:1: error: 'scanf' was not declared in this scope
3 | scanf("%d %d", &x, &y);
| ^~~~~
a.cc:4:16: error: 'GCD' was not declared in this scope
4 | printf("%d\n", GCD(x, y));
| ^~~
a.cc:4:1: error: 'printf' was not declared in this scope
4 | prin... |
s927064398 | p02256 | C++ | int main(void){
int x, y;
scanf("%d %d", &x, &y);
printf("%d\n", GCD(x, y));
}
| a.cc: In function 'int main()':
a.cc:3:1: error: 'scanf' was not declared in this scope
3 | scanf("%d %d", &x, &y);
| ^~~~~
a.cc:4:16: error: 'GCD' was not declared in this scope
4 | printf("%d\n", GCD(x, y));
| ^~~
a.cc:4:1: error: 'printf' was not declared in this scope
4 | prin... |
s464240664 | p02256 | C++ | #include<iostream>
using namespace std;
int calc_gcd(int a,int b){
int x=a,y=b,z;
if(x<y){
z=x;
x=y;
y=z;
}
while(y>0){
z=x%y;
x=y;
y=z;
}
return x;
}
int main(){
int a,b;
cin>>a>>b;
cout<<calc_gcd(a,b)<<endl;
return 0;
}
| a.cc:4:1: error: extended character is not valid in an identifier
4 | int x=a,y=b,z;
| ^
a.cc:4:1: error: extended character is not valid in an identifier
a.cc:5:1: error: extended character is not valid in an identifier
5 | if(x<y){
| ^
a.cc:5:1: error: extended character is not valid i... |
s944782754 | p02256 | C++ | #include<iostream>
using namespace std;
int calc_gcd(int a,int b){
int x=a,y=b,z;
if(x<y){
z=x;
x=y;
y=z;
}
while(y>0){
z=x%y;
x=y;
y=z;
}
return x;
}
int main(){
int a,b;
cin>>a>>b;
cout<<calc_gcd(a,b)<<endl;
return 0;
| a.cc: In function 'int main()':
a.cc:21:10: error: expected '}' at end of input
21 | return 0;
| ^
a.cc:17:11: note: to match this '{'
17 | int main(){
| ^
|
s248464577 | p02256 | C++ | #include<iostream>
using namespace std;
int gcd(int a,int b){return !b?a:gcd(b,a%b);}
int main(){
int a,b;
cin >> a >> b;
cout << gcd(a,b)
} | a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before '}' token
9 | cout << gcd(a,b)
| ^
| ;
10 | }
| ~
|
s597633785 | p02256 | C++ | #include <cstdio>
int a,b;
int main(){
scanf("%d %d",&a,&b);
for(int i=min(a,b);i>=1;i--){
if(a%i==0 && b%i==0){
printf("%d\n",i);
return 0;
}
}
} | a.cc: In function 'int main()':
a.cc:5:13: error: 'min' was not declared in this scope; did you mean 'main'?
5 | for(int i=min(a,b);i>=1;i--){
| ^~~
| main
|
s602273160 | p02256 | C++ | #include <iostream>
using namespace std;
int main()
{
int a,b,tmp;
cin >> a >> b;
while(b!=0){
tmp = b;
b = a % b;
a = tmp;
}
cout << a???<< endl;
} | a.cc:12:12: warning: trigraph ??< ignored, use -trigraphs to enable [-Wtrigraphs]
12 | cout << a???<< endl;
a.cc: In function 'int main()':
a.cc:12:12: error: expected primary-expression before '?' token
12 | cout << a???<< endl;
| ^
a.cc:12:13: error: expected primary-expression before '?' tok... |
s468692971 | p02256 | C++ | #include <iostream>
using namespace std;
int main() {
int a, b; cin >> a >> b;
cout << __gcd(a, b) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:11: error: '__gcd' was not declared in this scope
9 | cout << __gcd(a, b) << endl;
| ^~~~~
|
s655262013 | p02256 | C++ | #include <iostream>
#include <algirithm>
using namespace std;
int main() {
int a, b; cin >> a >> b;
cout << __gcd(a, b) << endl;
return 0;
} | a.cc:2:10: fatal error: algirithm: No such file or directory
2 | #include <algirithm>
| ^~~~~~~~~~~
compilation terminated.
|
s600155665 | p02256 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
cin >> a >> b;
if(max(a,b) % min(a,b) == 0) {
cout << min(a,b) << endl;
return 0;
}
int ans = 0;
for(int i = 1; i*i <= min(a,b); ++i) {
if(a % i == 0 && b % i == 0) {
ans = i;
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
5 | cin >> a >> b;
| ^
a.cc:5:15: error: 'b' was not declared in this scope
5 | cin >> a >> b;
| ^
|
s106191204 | p02256 | C++ | #include<cstdio>
#include<cmath>
int g(int x, int y){
return (y == 0)? x: g(y, x%y);
}
int main(){
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", g( max(a, b) , min(a, b)));
} | a.cc: In function 'int main()':
a.cc:11:27: error: 'max' was not declared in this scope; did you mean 'std::max'?
11 | printf("%d\n", g( max(a, b) , min(a, b)));
| ^~~
| std::max
In file included from /usr/include/c++/14/bits/specfun.h:43,
... |
s787113096 | p02256 | C++ | #include <iostream>
using namespace std;
int main(){
int md=1,a.b;
cin>>a>>b;
while(md>0){
a=md;
md=a%b;
b=a/b;
}
cout<<b<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:17: error: expected initializer before '.' token
4 | int md=1,a.b;
| ^
a.cc:5:12: error: 'a' was not declared in this scope
5 | cin>>a>>b;
| ^
a.cc:5:15: error: 'b' was not declared in this scope
5 | cin>>a>>b;
... |
s419049778 | p02257 | Java | #include <stdio.h>
int isPrime(int);
int main(){
int i,j;
int n,cnt=0;
scanf("%10000d",&n);
int A[n];
for(i=0;i<n;i++){
scanf("%d",&A[i]);
if(A[i]<2 || A[i]>100000000){
continue;
}
cnt += isPrime(A[i]);
}
//output
printf("%d\n",cnt);
return 0;
}
int isPrime(... | Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
^
Main.java:12: error: not a statement
int A[n];
^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
(... |
s110364716 | p02257 | Java | #include <stdio.h>
int main(){
int i,j;
int n,cnt=0;
int flg;
scanf("%10000d",&n);
int A[n];
for(i=0;i<n;i++){
flg = 0;
scanf("%d",&A[i]);
if(A[i]<2 || A[i]>100000000){
continue;
}
if(A[i]<=1) break;
for(j=2;j<A[i];j++){
if( (A[i] % j) == 0 ){
flg = 1;
break;
... | Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
^
Main.java:7: error: class, interface, enum, or record expected
int n,cnt=0;
^
Main.java:8: error: unnamed classes are a preview feature and are disabled by def... |
s910288399 | p02257 | Java | #include <stdio.h>
int main(){
int i,j;
int n,cnt=0;
int flg;
scanf("%10000d",&n);
int A[n];
for(i=0;i<n;i++){
flg = 0;
scanf("%d",&A[i]);
if(A[i]<2 || A[i]>100000000){
continue;
}
if(A[i]<=1) break;
for(j=2;j<A[i];j++){
if( (A[i] % j) == 0 ){
flg = 1;
break;
... | Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
^
Main.java:7: error: class, interface, enum, or record expected
int n,cnt=0;
^
Main.java:8: error: unnamed classes are a preview feature and are disabled by def... |
s631940031 | p02257 | Java | import java.util.Scanner;
import java.util.*;
public class AOJ{
static boolean Sosu(int p){
int count=0;
if(p==1) return false;
else if(p==2) return true;
else {
for (int i=2;i<Math.sqrt(p)+1;i++){
if(p%i==0) count++;
}
if(count==0) return tru... | Main.java:4: error: class AOJ is public, should be declared in a file named AOJ.java
public class AOJ{
^
1 error
|
s886527893 | p02257 | Java | import java.util.Scanner;
public class Main{
public static void main(String [] args){
Scanner in = new Scanner(System.in);
int count = 0;
while(in.hasNextLine()){
if( i == 2 || i == 3 || i == 5 || i == 7 ||
(((i % 10 == 1) || (i % 10 == 3) || (i % 10 == 7) || (i % 10 == 9))
&& (i % 3 != 0 || i % 7 != 0))){
... | Main.java:16: error: reached end of file while parsing
System.out.println(count);
^
1 error
|
s425189895 | p02257 | Java | public class Main{
public static void main (String [] args) {
Scanner in = new Scanner(System.in);
int count = 0;
while(in.hasNextInt()) {
int i = in.nextInt();
if( i == 2 || i == 3 || i == 5 || i == 7 ||
(((i % 10 == 1) || (i % 10 == 3) || (i % 10 == 7) || (i % 10 == 9))
&& (i % 3 != 0... | Main.java:3: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s956966423 | p02257 | Java | import java.util.Sc*;
public class Main {
static int primeCounter = 0;
public static void main (String args[]) {
// input
int numEl;
int numb;
Scanner inp = new Scanner(System.in);
numEl = inp.nextInt();
for (int i = 0; i < numEl; i++) {
numb... | Main.java:1: error: ';' expected
import java.util.Sc*;
^
1 error
|
s948785535 | p02257 | Java | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main101c {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputSt... | Main.java:7: error: class Main101c is public, should be declared in a file named Main101c.java
public class Main101c {
^
1 error
|
s112053873 | p02257 | Java |
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int x = scanner.nextInt();
int sum = 0;
for (int i = 0; i < x; i++) {
int n = scanner.nextInt();
if (isPrime(n)) {
sum++;
}
}
System.out.println(sum);
}
public static boolean isPrime(int ... | Main.java:4: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s340658926 | p02257 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int cnt = 0;... | Main.java:11: error: incompatible types: String cannot be converted to int
if(isPrime(br.readLine()))cnt++;
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.