submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s093694135 | p02257 | C++ | #include<stdio.h>
#include<math.h>
int main()
{
int i, j, n, s;
double q,x;
int a[10000];
scanf("%d", &n);
s = n;
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (i = 0; i < n; i++) {
j=0;
q=sqrt(a[i]);
x=ceil(q)
while (j < x) {
if (a[i] % j == 0 || a[i] % 2 == 0) ... | a.cc: In function 'int main()':
a.cc:18:26: error: expected ';' before 'while'
18 | x=ceil(q)
| ^
| ;
19 | while (j < x) {
| ~~~~~
|
s216906637 | p02257 | C++ | #include<stdio.h>
#include<math.h>
#define MAX 10000
int main()
{
int i, j,n,s,ary[30];
bool a[MAX];
for (i = 0; i < MAX; i++) {
a[i] = i <= 1 ? false: true;
}
for (i = 2; i < sqrt(MAX); i++) {
if (a[i]) {
for (j = 0; i*(j + 2) < MAX; j++) {
a[i*(j + 2)] = 0;
}
}
}
scanf_s("%d", &n);
for (i = 0... | a.cc: In function 'int main()':
a.cc:19:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
19 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s911726068 | p02257 | C++ | #include<stdio.h>
#include<math.h>
int prime(int x)
{
int i;
if(x%2==0)
return 0;
for(i=3;i*i<=x;i+=2){
if(x%i==0)
return 0;
}
return 1;
}
int main()
{
int n,m,i;
int a=0;
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&m);
if(prime(m)==1)
{
a++;
}
}
printf("%d\n",a);
return 0;
} | a.cc:46:7: error: expected constructor, destructor, or type conversion before '(' token
46 | printf("%d\n",a);
| ^
a.cc:48:1: error: expected unqualified-id before 'return'
48 | return 0;
| ^~~~~~
a.cc:50:1: error: expected declaration before '}' token
50 | }
| ^
|
s801412448 | p02257 | C++ | int sosu(int n,int D[])
{
int i, j, k;
int l = 1;
D[0] = 2;
for (i = 3; i <= n; i += 2)
{
k = 0;
for (j = 3; j <= sqrt(i); j += 2)
{
if (i%j == 0)
{
k = 1;
break;
}
}
if (k == 0)
{
//printf("%d ", i);
D[l] = i;
l = l + 1;
}
}
l = l - 1;
//printf("total %d", l);
//printf... | a.cc: In function 'int sosu(int, int*)':
a.cc:9:34: error: 'sqrt' was not declared in this scope
9 | for (j = 3; j <= sqrt(i); j += 2)
| ^~~~
a.cc: In function 'int main()':
a.cc:40:9: error: 'scanf_s' was not declared in this scope
40 | scanf_s(" %d... |
s479136294 | p02257 | C++ | int sosu(int n,int D[])
{
int i, j, k;
int l = 1;
D[0] = 2;
for (i = 3; i <= n; i += 2)
{
k = 0;
for (j = 3; j <= sqrt(i); j += 2)
{
if (i%j == 0)
{
k = 1;
break;
}
}
if (k == 0)
{
//printf("%d ", i);
D[l] = i;
l = l + 1;
}
}
l = l - 1;
//printf("total %d", l);
//printf... | a.cc: In function 'int sosu(int, int*)':
a.cc:9:34: error: 'sqrt' was not declared in this scope
9 | for (j = 3; j <= sqrt(i); j += 2)
| ^~~~
a.cc: In function 'int main()':
a.cc:40:9: error: 'scanf' was not declared in this scope
40 | scanf(" %d", &... |
s986385069 | p02257 | C++ | int sosu(int n,int D[])
{
int i, j, k;
int l = 1;
D[0] = 2;
for (i = 3; i <= n; i += 2)
{
k = 0;
for (j = 3; j <=i/3; j += 2)
{
if (i%j == 0)
{
k = 1;
break;
}
}
if (k == 0)
{
//printf("%d ", i);
D[l] = i;
l = l + 1;
}
}
l = l - 1;
//printf("total %d", l);
//printf("\n"... | a.cc: In function 'int main()':
a.cc:40:9: error: 'scanf' was not declared in this scope
40 | scanf(" %d", &n);
| ^~~~~
a.cc:70:17: error: 'printf' was not declared in this scope
70 | printf("%d\n", kosu);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in ... |
s173854715 | p02257 | C++ | int sosu(int n,int D[])
{
int i, j, k;
int l = 1;
D[0] = 2;
for (i = 3; i <= n; i += 2)
{
k = 0;
for (j = 3; j <=i/3; j += 2)
{
if (i%j == 0)
{
k = 1;
break;
}
}
if (k == 0)
{
//printf("%d ", i);
D[l] = i;
l = l + 1;
}
}
l = l - 1;
//printf("total %d", l);
//printf("\n"... | a.cc: In function 'int main()':
a.cc:40:9: error: 'scanf_s' was not declared in this scope
40 | scanf_s("%d", &n);
| ^~~~~~~
a.cc:70:17: error: 'printf_s' was not declared in this scope
70 | printf_s("%d\n", kosu);
| ^~~~~~~~
|
s231478297 | p02257 | C++ | int main()
{
int C[10000];
int n;
int i, j, k;
int l = 1;
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
scanf("%d", &C[i]);
}
int kosu = 0;
for (int j = 0; j < n; j++)
{
if (C[j] == 2)
{
kosu = kosu++;
}
else
{
k = 0;
for (int l =2; l < C[j]; l ++)
{
if (C[j] % l == 0)
{
... | a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf' was not declared in this scope
9 | scanf("%d", &n);
| ^~~~~
a.cc:39:17: error: 'printf' was not declared in this scope
39 | printf("%d\n", kosu);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in he... |
s210072233 | p02257 | C++ | ??? | a.cc:1:1: error: expected unqualified-id before '?' token
1 | ???
| ^
|
s797170992 | p02257 | C++ | #include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
int i, j,n,s,ary[10000],most=0,s[MAX];
double x;
bool a[MAX];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &ary[i]);
if(ary[i]>most) most=ary[i];
}
for (i = 0; i < most+1; i++) {
a[i] = i >= 2 ? 1:0;
}
x=sqrt(mo... | a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ^
a.cc:6:20: note: previous declaration as 'int s'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ... |
s529650325 | p02257 | C++ | #include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
int i, j,n,s,ary[10000],most=0,s[MAX];
int x;
bool a[MAX];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &ary[i]);
if(ary[i]>most) most=ary[i];
}
for (i = 0; i < most+1; i++) {
a[i] = i >= 2 ? 1:0;
}
x=sqrt(most+... | a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ^
a.cc:6:20: note: previous declaration as 'int s'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ... |
s019577178 | p02257 | C++ | #include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
int i, j,n,s,ary[10000],most=0,s[MAX];
double x;
bool a[MAX];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &ary[i]);
if(ary[i]>most) most=ary[i];
}
for (i = 0; i < most+1; i++) {
a[i] = i >= 2 ? 1:0;
}
x=sqrt(mo... | a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ^
a.cc:6:20: note: previous declaration as 'int s'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ... |
s466545575 | p02257 | C++ | #include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
int i, j,n,s,ary[10000],most=0,s[MAX];
int x;
bool a[MAX];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &ary[i]);
if(ary[i]>most) most=ary[i];
}
for (i = 0; i < most+1; i++) {
a[i] = i >= 2 ? 1:0;
}
x=sqrt(most+... | a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ^
a.cc:6:20: note: previous declaration as 'int s'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ... |
s857891738 | p02257 | C++ | #include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
int i, j,n,s,ary[10000],most=0,s[MAX],x;
bool a[MAX];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &ary[i]);
if(ary[i]>most) most=ary[i];
}
for (i = 0; i < most+1; i++) {
a[i] = i >= 2 ? 1:0;
}
x=sqrt(most+1);
... | a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
6 | int i, j,n,s,ary[10000],most=0,s[MAX],x;
| ^
a.cc:6:20: note: previous declaration as 'int s'
6 | int i, j,n,s,ary[10000],most=0,s[MAX],x;
| ... |
s959528897 | p02257 | C++ | #include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
int i, j,n,s,ary[10000],most=0,s[MAX],x;
bool a[MAX];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &ary[i]);
if(ary[i]>most) most=ary[i];
}
for (i = 0; i < most+1; i++) {
a[i] = i >= 2 ? 1:0;
}
x=sqrt((double)m... | a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
6 | int i, j,n,s,ary[10000],most=0,s[MAX],x;
| ^
a.cc:6:20: note: previous declaration as 'int s'
6 | int i, j,n,s,ary[10000],most=0,s[MAX],x;
| ... |
s513188090 | p02257 | C++ | #include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
int i, j,n,s,ary[10000],most=0,s[MAX];
double x;
bool a[MAX];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &ary[i]);
if(ary[i]>most) most=ary[i];
}
for (i = 0; i < most+1; i++) {
a[i] = i >= 2 ? 1:0;
}
... | a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ^
a.cc:6:20: note: previous declaration as 'int s'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ... |
s370967907 | p02257 | C++ | #include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
int i, j,n,s,ary[10000],most=0,s[MAX];
double x;
bool a[MAX];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &ary[i]);
if(ary[i]>most) most=ary[i];
}
for (i = 0; i < most+1; i++) {
a[i] = i >= 2 ? 1:0;
}
... | a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ^
a.cc:6:20: note: previous declaration as 'int s'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ... |
s764486283 | p02257 | C++ | #include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
int i, j,n,s,ary[10000],most=0,s[MAX];
double x;
bool a[MAX];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &ary[i]);
if(ary[i]>most) most=ary[i];
}
for (i = 0; i < most+1; i++) {
a[i] = i >= 2 ? 1:0;
}
... | a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ^
a.cc:6:20: note: previous declaration as 'int s'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ... |
s097130928 | p02257 | C++ | #include<stdio.h>
#include<math.h>
#define MAX 10000000
int main()
{
int i, j,n,s,ary[10000],most=0,s[MAX];
bool a[MAX];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &ary[i]);
if(ary[i]>most) most=ary[i];
}
for (i = 0; i < most+1; i++) {
a[i] = i >= 2 ? 1:0;
}
for (i = 2; i < ... | a.cc: In function 'int main()':
a.cc:6:40: error: conflicting declaration 'int s [10000000]'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ^
a.cc:6:20: note: previous declaration as 'int s'
6 | int i, j,n,s,ary[10000],most=0,s[MAX];
| ... |
s079854673 | p02257 | C++ | sinekomati | a.cc:1:1: error: 'sinekomati' does not name a type
1 | sinekomati
| ^~~~~~~~~~
|
s478129108 | p02257 | C++ | #include<iostream>
#include<cmath>
#define size 1000;
using namespace std;
bool isprime (int x) {
int = i;
if (x == 2) {
return true;
}
if (x < 2 || x % 2) {
return false;
}
for (i = 3; i <= sqrt(x); i += 2) {
if (n % i) {
return fals... | a.cc: In function 'bool isprime(int)':
a.cc:10:9: error: expected unqualified-id before '=' token
10 | int = i;
| ^
a.cc:24:10: error: 'i' was not declared in this scope
24 | for (i = 3; i <= sqrt(x); i += 2) {
| ^
a.cc:26:13: error: 'n' was not declared in this scope
26 | ... |
s935733025 | p02257 | C++ | #include<iostream>
#include<cmath>
#define size 1000;
using namespace std;
bool isprime (int x) {
int = i;
if (x == 2) {
return true;
}
if (x < 2 || x % 2 == 0) {
return false;
}
for (i = 3; i <= sqrt(x); i += 2) {
if (n % i) {
return... | a.cc: In function 'bool isprime(int)':
a.cc:10:9: error: expected unqualified-id before '=' token
10 | int = i;
| ^
a.cc:24:10: error: 'i' was not declared in this scope
24 | for (i = 3; i <= sqrt(x); i += 2) {
| ^
a.cc:26:13: error: 'n' was not declared in this scope
26 | ... |
s047658539 | p02257 | C++ | #include<iostream>
#include<cmath>
#define size 1000;
using namespace std;
bool isprime (int x) {
int = i;
if (x == 2) {
return true;
}
if (x < 2 || x % 2 == 0) {
return false;
}
for (i = 3; i <= sqrt(x); i += 2) {
if (n % i == 0) {
r... | a.cc: In function 'bool isprime(int)':
a.cc:10:9: error: expected unqualified-id before '=' token
10 | int = i;
| ^
a.cc:24:10: error: 'i' was not declared in this scope
24 | for (i = 3; i <= sqrt(x); i += 2) {
| ^
a.cc:26:13: error: 'n' was not declared in this scope
26 | ... |
s581786711 | p02257 | C++ | #include<iostream>
#include<cmath>
#define size 1000;
using namespace std;
bool isprime (int x) {
int = i;
if (x == 2) {
return true;
}
if (x < 2 || x % 2 == 0) {
return false;
}
for (i = 3; i <= sqrt(x); i += 2) {
if (n % i == 0) {
r... | a.cc: In function 'bool isprime(int)':
a.cc:10:9: error: expected unqualified-id before '=' token
10 | int = i;
| ^
a.cc:24:10: error: 'i' was not declared in this scope
24 | for (i = 3; i <= sqrt(x); i += 2) {
| ^
a.cc:26:13: error: 'n' was not declared in this scope
26 | ... |
s218865138 | p02257 | C++ | #include<iostream>
#include<cmath>
#define size 1000;
using namespace std;
bool isprime (int x) {
int = i;
if (x == 2) {
return true;
}
if (x < 2 || x % 2 == 0) {
return false;
}
for (i = 3; i * i <= x; i += 2) {
if (n % i == 0) {
ret... | a.cc: In function 'bool isprime(int)':
a.cc:10:9: error: expected unqualified-id before '=' token
10 | int = i;
| ^
a.cc:24:10: error: 'i' was not declared in this scope
24 | for (i = 3; i * i <= x; i += 2) {
| ^
a.cc:26:13: error: 'n' was not declared in this scope
26 | ... |
s474062510 | p02257 | C++ | #include<iostream>
using namespace std;
bool isprime (int x) {
int = i;
if (x == 2) {
return true;
}
if (x < 2 || x % 2 == 0) {
return false;
}
for (i = 3; i * i <= x; i += 2) {
if (n % i == 0) {
return false;
}
retu... | a.cc: In function 'bool isprime(int)':
a.cc:7:9: error: expected unqualified-id before '=' token
7 | int = i;
| ^
a.cc:21:10: error: 'i' was not declared in this scope
21 | for (i = 3; i * i <= x; i += 2) {
| ^
a.cc:23:13: error: 'n' was not declared in this scope
23 | ... |
s147083588 | p02257 | C++ | #include<iostream>
using namespace std;
bool isprime (int x) {
int = i;
if (x == 2) {
return true;
}
if (x < 2 || x % 2 == 0) {
return false;
}
for (i = 3; i * i <= x; i += 2) {
if (x % i == 0) {
return false;
}
retu... | a.cc: In function 'bool isprime(int)':
a.cc:7:9: error: expected unqualified-id before '=' token
7 | int = i;
| ^
a.cc:21:10: error: 'i' was not declared in this scope
21 | for (i = 3; i * i <= x; i += 2) {
| ^
a.cc: In function 'int main()':
a.cc:42:10: error: 'i' was not de... |
s233097229 | p02257 | C++ | #include<iostream>
using namespace std;
bool isprime (int x) {
int i;
if (x == 2) {
return true;
}
if (x < 2 || x % 2 == 0) {
return false;
}
for (i = 3; i * i <= x; i += 2) {
if (x % i == 0) {
return false;
}
return... | a.cc: In function 'int main()':
a.cc:42:10: error: 'i' was not declared in this scope
42 | for (i = 0; i < n; i++) {
| ^
a.cc: In function 'bool isprime(int)':
a.cc:33:1: warning: control reaches end of non-void function [-Wreturn-type]
33 | }
| ^
|
s804000965 | p02257 | C++ | #include<iostream>
using namespace std;
bool isprime (int x) {
int i;
if (x == 2) {
return true;
}
if (x < 2 || x % 2 == 0) {
return false;
}
for (i = 3; i * i <= x; i += 2) {
if (x % i == 0) {
return false;
}
return... | a.cc: In function 'int main()':
a.cc:42:10: error: 'i' was not declared in this scope
42 | for (i = 0; i < n; i++) {
| ^
a.cc: In function 'bool isprime(int)':
a.cc:33:1: warning: control reaches end of non-void function [-Wreturn-type]
33 | }
| ^
|
s250095810 | p02257 | C++ | #include<iostream>
using namespace std;
bool isprime (int x) {
int i;
if (x == 2) {
return true;
}
if (x < 2 || x % 2 == 0) {
return false;
}
for (i = 3; i * i <= x; i += 2) {
if (x % i == 0) {
return false;
}
return... | a.cc: In function 'int main()':
a.cc:42:10: error: 'i' was not declared in this scope
42 | for (i = 0; i < n; i++) {
| ^
a.cc: In function 'bool isprime(int)':
a.cc:33:1: warning: control reaches end of non-void function [-Wreturn-type]
33 | }
| ^
|
s515154374 | p02257 | C++ | //
// ALDS1_1 - C Prime Numbers
// A prime number is a natural number which has exactly two distinct natural number divisors:
// 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.
//
// Write a program which reads a list of N integers and prints the number of prime numbers in the list.
//
#inc... | a.cc: In function 'void checkPrimeNumbers(size_t, const int*, int&)':
a.cc:58:35: error: 'sqrt' was not declared in this scope
58 | for (int j = 3; j <= (int)sqrt(value); j += 2) {
| ^~~~
|
s765388527 | p02257 | C++ | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
uint64_t get_size(uint64_t n) {
return n % 6 % 5 == 0 ? (n - 1) / 3 : (n / 6) * 2;
}
std::vector<int> generate_primes(uint64_t upperbound) {
uint64_t sieve_size = get_size(upperbound);
std::vector<bool> sieve(sieve_size, true);
uint64... | a.cc:6:1: error: 'uint64_t' does not name a type
6 | uint64_t get_size(uint64_t n) {
| ^~~~~~~~
a.cc:5:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
4 | #include <vector>
+++ |+#include <cstdint>
5 |
a.cc:10:34: error: 'uint64_t' was n... |
s544238016 | p02257 | C++ | #include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
int get_size(int n) {
return n % 6 % 5 == 0 ? (n - 1) / 3 : (n / 6) * 2;
}
std::vector<int> generate_primes(int upperbound) {
int sieve_size = get_size(upperbound);
std::vector<bool> sieve(sieve_size, true);
uint64_t limit = get_size(... | a.cc: In function 'std::vector<int> generate_primes(int)':
a.cc:13:3: error: 'uint64_t' was not declared in this scope
13 | uint64_t limit = get_size(sqrt(upperbound));
| ^~~~~~~~
a.cc:5:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
4 | #i... |
s324625117 | p02257 | C++ | #include<iostream>
using namespace std;
bool prime(int n)
{
for(int i=2;i<=sqrt(double(n));i++)
if(n%i==0)
{
return false;
break;
}
}
int gcd(int x,int y)//??????y????????°????????????x?°?
{
if(x%y==0)
return y;
if(x>y)
return gcd(y,x%y);
if(x<y)
return gcd(x,y%x);
}
int main()
{
int n,a[1000... | a.cc: In function 'bool prime(int)':
a.cc:5:24: error: 'sqrt' was not declared in this scope
5 | for(int i=2;i<=sqrt(double(n));i++)
| ^~~~
a.cc:13:1: warning: control reaches end of non-void function [-Wreturn-type]
13 | }
| ^
a.cc: In function 'int gcd(int, int)':
a.c... |
s262856421 | p02257 | C++ |
#include <stdio.h>
int main(){
int i,j,n,x=0;
int sosu[10000];
int count=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&sosu[i]);
if (sosu[i]!=2 && (sosu[i]%2)==0) {
}
else{
sosu[x]=sosu[i];
x++;
}
}
// printf("%d\n",x);
for(i=0;i<x;i++){
if(sosu[i... | a.cc: In function 'int main()':
a.cc:30:17: error: expected ';' before 'break'
30 | flag = 1
| ^
| ;
31 | break;
| ~~~~~
|
s458713794 | p02257 | C++ | #include <iostream>
#include <cmath>
using namespace std;
bool f(int x){
if(x == 1) return false;
bool res = true;
for(int i = 2; i <= sqrt(x); ++i){
if(x % i == 0){
res = false;
break;
}
}
return res;
}
int main () {
int n, x, k = 0;
cin >> n;
while (cin>>x){
if (f(x) == true)
k++;
... | a.cc: In function 'int main()':
a.cc:27:9: error: 'a' was not declared in this scope
27 | a
| ^
|
s124956166 | p02257 | C++ | #include <iostream>
#include <cmath>
using namespace std;
bool isPrime(int a){
for(int i=2; i<=sqrt(a); ++i){
if(a%i==0) return false;
}
return true;
}
int main(){
int a,b;
set<int>q;
cin>>a;
for(int i=0; i<a; ++i){
cin>>b;
if(isPrime(b))
q.insert(b);
}
cout<<q.size()<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:17:9: error: 'set' was not declared in this scope
17 | set<int>q;
| ^~~
a.cc:3:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
2 | #include <cmath>
+++ |+#include <set>
3 |
a.cc:17:13: error: e... |
s701676119 | p02257 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int isPrime(int n);
int main()
{
int a; //?´???°??????????????°???????????°
int b; //?´???°??????????????°???
int pcnt; //?´???°?????°
cin >> a;// ?´???°?????????????????°???????????°?????\???
for(int i=0; i < a; i++)// ??°????????? ?????¶ ??\?????° < ... | a.cc: In function 'int isPrime(int)':
a.cc:45:17: error: 'heiho' was not declared in this scope
45 | heiho = sqrt(n)
| ^~~~~
a.cc:45:25: error: 'sqrt' was not declared in this scope
45 | heiho = sqrt(n)
| ^~~~
|
s083440021 | p02257 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int isPrime(int n);
int main()
{
int a; //?´???°??????????????°???????????°
int b; //?´???°??????????????°???
int pcnt; //?´???°?????°
cin >> a;// ?´???°?????????????????°???????????°?????\???
for(int i=0; i < a; i++)// ??°????????? ?????¶ ??\?????° < ... | a.cc: In function 'int isPrime(int)':
a.cc:45:21: error: 'sqrt' was not declared in this scope
45 | k = sqrt(n)
| ^~~~
|
s705781889 | p02257 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int isPrime(int n);
int main()
{
int a; //?´???°??????????????°???????????°
int b; //?´???°??????????????°???
int pcnt; //?´???°?????°
cin >> a;// ?´???°?????????????????°???????????°?????\???
for(int i=0; i < a; i++)// ??°????????? ?????¶ ??\?????° <... | a.cc: In function 'int isPrime(int)':
a.cc:46:21: error: 'sqrt' was not declared in this scope
46 | k = sqrt(n * 1.0);
| ^~~~
|
s404768278 | p02257 | C++ | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int a; //?´???°??????????????°???????????°
int b; //?´???°??????????????°???
int pcnt = 0; //?´???°?????°
cin >> a; // ?´???°?????????????????°???????????°?????\???
for(int i=0; i < a; i++)// ??°????????? ?????¶ ??\?????° < ??... | a.cc: In function 'int main()':
a.cc:16:20: error: 'isPrime' was not declared in this scope
16 | if(isPrime(b) == 1);// ?´???°??????(True or False)
| ^~~~~~~
|
s108813720 | p02257 | C++ | #include <iostream>
using namespace std;
int isPrime(int x){
int i;
if(x<2) return 0;
else if(x==2) return 1;
if(x%2==0) return 0;
for(i=3;i*i<=x;i+=2){
if(x%i==0) return 0;
}
return 1;
}
int main() {
int n, x;
int cnt = 0;
cin >> n;
for(int i; i<N;i++){
cin >> x;
if(isPrime(x)) cnt+... | a.cc: In function 'int main()':
a.cc:19:16: error: 'N' was not declared in this scope
19 | for(int i; i<N;i++){
| ^
|
s658782825 | p02257 | C++ | #include <iostream>
#include <math.h>
using namespace std;
bool isPrime(int x) {
if (k == 2) {
return 2;
}if (k %2 == 0) {
return false;
}
for (int w = 3; w < sqrt(x); w+=2) {
if (x % w == 0) {
return false;
}
}
return true;
}
int main() {
int i,... | a.cc: In function 'bool isPrime(int)':
a.cc:6:9: error: 'k' was not declared in this scope
6 | if (k == 2) {
| ^
a.cc:8:10: error: 'k' was not declared in this scope
8 | }if (k %2 == 0) {
| ^
|
s522951244 | p02257 | C++ | #include
| a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
1 | #include
| ^
|
s747514730 | p02257 | C++ | #include <iostream>
using namespace std;
bool isPrime(int a){
int x = (int)sqrt(a);
int val = 1;
for (int i = 2; i <= x; i++) val *= (a % i != 0);
return (val == 1);
}
int main(){
int n, count, a;
cin >> n;
count = 0;
for (int i = 0; i != n; i++){
cin >> a;
count += isPrime(a);
}
cout << count << endl;
... | a.cc: In function 'bool isPrime(int)':
a.cc:5:22: error: 'sqrt' was not declared in this scope
5 | int x = (int)sqrt(a);
| ^~~~
|
s682474712 | p02257 | C++ | #include <iostream>
using namespace std;
bool isPrime(int n) {
if( n==2)
return true;
if( n<2 || n%2 == 0)
return false;
int i = 3;
while( i<= sqrt(n/1.0) )
{
if(n%i == 0)
return false;
i += 2;
}
return true;
}
int main() {
int n;
cin >> n;
int suuti;
int counter = 0;
for(int i =0; i<n; i++) {
... | a.cc: In function 'bool isPrime(int)':
a.cc:10:20: error: 'sqrt' was not declared in this scope
10 | while( i<= sqrt(n/1.0) )
| ^~~~
|
s315165120 | p02257 | C++ | #include <iostream>
using namespace std;
bool isPrime(int n) {
if( n==2)
return true;
if( n<2 || n%2 == 0)
return false;
int i = 3;
while( i<= sqrt(n/1.0) )
{
if(n%i == 0)
return false;
i += 2;
}
return true;
}
int main() {
int n;
cin >> n;
int suuti;
int counter = 0;
for(int i =0; i<n; i++) {
... | a.cc: In function 'bool isPrime(int)':
a.cc:10:20: error: 'sqrt' was not declared in this scope
10 | while( i<= sqrt(n/1.0) )
| ^~~~
|
s803292937 | p02257 | C++ | #include <iostream>
using namespace std;
bool isPrime(int n) {
if( n==2)
return true;
if( n<2 || n%2 == 0)
return false;
int i = 3;
while( i<= sqrt(static_cast<double>(n)) )
{
if(n%i == 0)
return false;
i += 2;
}
return true;
}
int main() {
int n;
cin >> n;
int suuti;
int counter = 0;
for(int i... | a.cc: In function 'bool isPrime(int)':
a.cc:10:20: error: 'sqrt' was not declared in this scope
10 | while( i<= sqrt(static_cast<double>(n)) )
| ^~~~
|
s288512311 | p02257 | C++ | #include <stdio.h>
#include <boolean.h>
#include <stdlib.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repi(i, n, a) for(int i = a; i < n; ++i)
#define num 100000010
int main(void) {
int n, i, j, ans = 0, a;
bool *f;
f = (bool*)malloc(sizeof(bool) * num);
rep(i, num) f[i] = true;
... | a.cc:2:10: fatal error: boolean.h: No such file or directory
2 | #include <boolean.h>
| ^~~~~~~~~~~
compilation terminated.
|
s048175780 | p02257 | C++ | #include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repi(i, n, a) for(int i = a; i < n; ++i)
#define num 100000010
int main(void) {
int n, i, j, ans = 0, a;
bool *f;
f = (bool*)malloc(sizeof(bool) * num);
rep(i, num) f[i] = true;
... | a.cc: In function 'int main()':
a.cc:14:57: error: expected ';' before ')' token
14 | repi(i, sqrt(num), 2) if(f[i]) for(j = 2; i * j <= num) f[i * j] = false;
| ^
|
s294346530 | p02257 | C++ | #include <iostram>
#include <random>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
ull powmod(ull a,ull b) {
ull res=1;
for(; b; b >>= 1){
if(b & 1){
res = res * a % mod;
}
a = a * a % mod;
}
return res;
}
bool MillerRabin(ull n, ull k){
if (n == 2){
ret... | a.cc:1:10: fatal error: iostram: No such file or directory
1 | #include <iostram>
| ^~~~~~~~~
compilation terminated.
|
s533842917 | p02257 | C++ | #include<iostream>
using namespace std;
int prime(int arr[], int num) {
int count = 0;
bool isPrime = true;
for(int i = 0; i < num; i++) {
if(a[i] != 1 && a[i] != 2) {
for(int j = 3; j < arr[i]; j += 2) {
if(arr[i] % j == 0) {
isPrime = false;
... | a.cc: In function 'int prime(int*, int)':
a.cc:9:12: error: 'a' was not declared in this scope
9 | if(a[i] != 1 && a[i] != 2) {
| ^
|
s009561253 | p02257 | C++ | #include<iostream>
using namespace std;
int prime(int arr[], int num) {
int count = 0;
bool isPrime = true;
for(int i = 0; i < num; i++) {
if(arr[i] <= 2)
count++:
else if(arr[i] % 2 != 0) {
for(int j = 3; j < arr[i] && isPrime; j += 2) {
if(arr[j] %... | a.cc: In function 'int prime(int*, int)':
a.cc:10:19: error: expected ';' before ':' token
10 | count++:
| ^
| ;
|
s528037593 | p02257 | C++ | #include "cmath"
#include "vector"
#define FOR(i, n) for ((i) = 0; (i) < (n); ++(i))
std::vector<bool> eratos(int upper) {
std::vector<bool> v(upper + 1, true);
int i, j;
v[0] = false;
v[1] = false;
for (i = 2; i < upper + 1; ++i) {
if (v[i] == true) {
for (j = 2; j <= int(upper / i); ++j) {
... | a.cc: In function 'void print_array_horizon(type)':
a.cc:42:10: error: 'stdout' was not declared in this scope
42 | fflush(stdout);
| ^~~~~~
a.cc:3:1: note: 'stdout' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
2 | #include "vector"
+++ |+#include <cs... |
s934187631 | p02257 | C++ | #include "cmath"
#include "vector"
std::vector<bool> eratos(int upper) {
std::vector<bool> v(upper + 1, true);
int i, j;
v[0] = false;
v[1] = false;
for (i = 2; i < upper + 1; ++i) {
if (v[i] == true) {
for (j = 2; j <= int(upper / i); ++j) {
v[i * j] = false;
}
}
}
return v;
... | a.cc: In function 'int main()':
a.cc:40:3: error: 'scanf' was not declared in this scope
40 | scanf("%d\n", &n);
| ^~~~~
a.cc:47:3: error: 'printf' was not declared in this scope
47 | printf("%d\n", out);
| ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixab... |
s260307157 | p02257 | C++ | #include <iostream>
using namespace std;
bool primeNum(int num) {
if (num < 2) return false;
else if (num == 2) return true;
else if (num % 2 == 0) return false;
for (int i = 3; i <= sqrt(num); i += 2) {
if (num%i == 0)
return false;
}
}
int main(void) {
int n;
int count = 0;
cin >> n;
for (int i = ... | a.cc: In function 'bool primeNum(int)':
a.cc:10:30: error: 'sqrt' was not declared in this scope
10 | for (int i = 3; i <= sqrt(num); i += 2) {
| ^~~~
a.cc:15:1: warning: control reaches end of non-void function [-Wreturn-type]
15 | }
| ^
|
s299330160 | p02257 | C++ | #include <iostream>
#include <math.h>
using namespace std;
bool is_prime[10000000];
int primes[100000000];
int prime_count = 0;
void set_prime() {
int j, end_point;
bool flag;
for (int i = 5; i < 100000000; i += 2) {
flag = false;
end_point = (int)sqrt((double)i);
for (j = 0; j < prime_count && p... | a.cc: In function 'int main()':
a.cc:43:25: error: expected '}' at end of input
43 | cout << count << endl;
| ^
a.cc:28:12: note: to match this '{'
28 | int main() {
| ^
|
s245691373 | p02257 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#define Lens 10005
using namespace std;
int a[Lens];
int prime(int i)
{
if (i == 2 || i == 3)
return 1;
if (!(i % 6 == 1 || i % 6 == 5))
return 0;
int m = sqrt(i);
for (int s = 5; s <= m; s+=6)
{
if (i%s == 0 || i % (s + 2) == 0)
{
return 0;
}
... | a.cc: In function 'int prime(int)':
a.cc:14:17: error: 'sqrt' was not declared in this scope
14 | int m = sqrt(i);
| ^~~~
|
s167933574 | p02257 | C++ |
int main(){
int n,x;
int cnt=0;
int flag=0;
cin >> n;
for(int i=0;i<n;i++){
cin >> x;
if(x==2){
flag=0;
}
else if(x%2==0) flag=1;
else{
for(int j=2;j<sqrt(x);j++){
if(x%j==0){
flag=1;
break;
}
}
}
if(flag==0) cnt++;
flag = 0;
}
cout << cnt << endl... | a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> n;
| ^~~
a.cc:14:19: error: 'sqrt' was not declared in this scope
14 | for(int j=2;j<sqrt(x);j++){
| ^~~~
a.cc:24:3: error: 'cout' was not declared in this scope
24 | cout <... |
s403778193 | p02257 | C++ | ---wrapperクラスを利用---
byte min:-128,max127
short min-32768,max32767
int min-2147483648,max2147483647
long min-9223372036854775808,max9223372036854775807
float min1.4E-45,max3.4028235E38
double min4.9E-324,max1.7976931348623157E308
---シフト演算子を利用---
byte min:-128,max127
short min-32768,max32767
int min-2147483648,max2147483... | a.cc:5:10: warning: integer constant is so large that it is unsigned
5 | long min-9223372036854775808,max9223372036854775807
| ^~~~~~~~~~~~~~~~~~~
a.cc:7:1: warning: floating constant truncated to zero [-Woverflow]
7 | double min4.9E-324,max1.7976931348623157E308
| ^~~~~~
a.cc:12:10: warnin... |
s980206633 | p02257 | C++ |
#include<iostream>
#include<math.h>
using namespace std;
int main(void){
int n;
vector<int> v(10000) = 0;
int flg=0;
int count=0;
cin >> n;
for(int k = 0;k<n;k++)
{
cin >> v[k];
for(int i = 2;i<=v[k];i++){
for(int j= 2;j<=sqrt(v[k])+1;j++){
if(i%j==0&&i!=j)
{
flg=1;
}
}
... | a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
9 | vector<int> v(10000) = 0;
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include<math.h>
+++ |+#include <vector>
4 | u... |
s678508639 | p02257 | C++ |
#include<iostream>
#include<math.h>
#include<vector>
using namespace std;
int main(void){
int n;
vector<int> v(10000) = 0;
int flg=0;
int count=0;
cin >> n;
for(int k = 0;k<n;k++)
{
cin >> v[k];
for(int i = 2;i<=v[k];i++){
for(int j= 2;j<=sqrt(v[k])+1;j++){
if(i%j==0&&i!=j)
{
fl... | a.cc: In function 'int main()':
a.cc:10:24: error: expected ',' or ';' before '=' token
10 | vector<int> v(10000) = 0;
| ^
|
s607130211 | p02257 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
bool is_prime(int a,std::vector<int>& p);
void make_p_vector(int n,std::vector<int>& p);
int main(){
int n;
int cnt = 0;
std::cin >> n;
std::vector<int> a(n);
std::vector<int> p(0);
for(int i=0;i<n;i++){
std::cin >... | a.cc: In function 'int main()':
a.cc:18:31: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
18 | int max = std::max_element(a.begin(),a.end());
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
| |
| ... |
s092552435 | p02257 | C++ | #include<iostream>
#include<vector>
#include<cmath>
bool is_prime(int a,std::vector<int>& p);
int main(){
int n;
int cnt = 0;
std::cin >> n;
std::vector<int> a(n);
for(int i=0;i<n;i++){
std::cin >> a[i];
}
for(int i=0;i<n;i++){
bool flag = is_prime(a[i]);
if(flag) c... | a.cc: In function 'int main()':
a.cc:16:29: error: too few arguments to function 'bool is_prime(int, std::vector<int>&)'
16 | bool flag = is_prime(a[i]);
| ~~~~~~~~^~~~~~
a.cc:5:6: note: declared here
5 | bool is_prime(int a,std::vector<int>& p);
| ^~~~~~~~
|
s039218022 | p02257 | C++ |
import math
a=int(input())
sum=0
for i in range(n):
b=1
n=int(input())
if n==2 or n==3:
sum+=1
if n>3:
for j in range(2,int(math.sqrt(n))+1):
if n%j==0:
b=0
break
sum+=b
print(sum)
| a.cc:2:1: error: 'import' does not name a type
2 | import math
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
|
s429784448 | p02257 | C++ | #include<iostream>
int main void(){
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
for(int j=2;j<sqrt(A[i]);j++){
if(A[i]%j==0){
judge=1;
break;
}
... | a.cc:2:10: error: expected initializer before 'void'
2 | int main void(){
| ^~~~
|
s100144528 | p02257 | C++ | #include<iostream>
int main void(){
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
for(int j=2;j<sqrt(A[i]);j++){
if(A[i]%j==0){
judge=1;
break;
}
... | a.cc:2:10: error: expected initializer before 'void'
2 | int main void(){
| ^~~~
|
s276391813 | p02257 | C++ | #include<iostream>
int main void(){
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
for(int j=2;j<sqrt(A[i]);j++){
if(A[i]%j==0){
judge=1;
break;
}
... | a.cc:2:10: error: expected initializer before 'void'
2 | int main void(){
| ^~~~
|
s421475958 | p02257 | C++ | #include<iostream>
int main void()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
for(int j=2;j<sqrt(A[i]);j++){
if(A[i]%j==0){
judge=1;
break;
}... | a.cc:2:10: error: expected initializer before 'void'
2 | int main void()
| ^~~~
|
s741129685 | p02257 | C++ | #include<iostream>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
for(int j=2;j<sqrt(A[i]);j++){
if(A[i]%j==0){
judge=1;
break;
}
... | a.cc: In function 'int main()':
a.cc:8:23: error: expected primary-expression before ';' token
8 | for(int i=0;i<n;i+;){
| ^
a.cc:8:23: error: expected ')' before ';' token
8 | for(int i=0;i<n;i+;){
| ~ ^
| )
a.cc:8:24: er... |
s793056574 | p02257 | C++ | #include<iostream>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
for(int j=2;j<sqrt(A[i]);j++){
if(A[i]%j==0){
judge=1;
break;
}
... | a.cc: In function 'int main()':
a.cc:8:23: error: expected primary-expression before ';' token
8 | for(int i=0;i<n;i+;){
| ^
a.cc:8:23: error: expected ')' before ';' token
8 | for(int i=0;i<n;i+;){
| ~ ^
| )
a.cc:8:24: er... |
s328064003 | p02257 | C++ | #include<iostream>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
for(int j=2;j<=sqrt(A[i]);j++){
if(A[i]%j==0){
judge=1;
break;
}
... | a.cc: In function 'int main()':
a.cc:8:23: error: expected primary-expression before ';' token
8 | for(int i=0;i<n;i+;){
| ^
a.cc:8:23: error: expected ')' before ';' token
8 | for(int i=0;i<n;i+;){
| ~ ^
| )
a.cc:8:24: er... |
s617484942 | p02257 | C++ | #include<iostream>
#include<math.h>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
for(int j=2;j<=sqrt(A[i]);j++){
if(A[i]%j==0){
judge=1;
break;
... | a.cc: In function 'int main()':
a.cc:9:23: error: expected primary-expression before ';' token
9 | for(int i=0;i<n;i+;){
| ^
a.cc:9:23: error: expected ')' before ';' token
9 | for(int i=0;i<n;i+;){
| ~ ^
| )
a.cc:9:24: er... |
s265666854 | p02257 | C++ | #include<iostream>
#include<math.h>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
if(sqrtA[i])>=2){
for(int j=2;j<=sqrt(A[i]);j++){
if(A[i]%j==0){
... | a.cc: In function 'int main()':
a.cc:9:23: error: expected primary-expression before ';' token
9 | for(int i=0;i<n;i+;){
| ^
a.cc:9:23: error: expected ')' before ';' token
9 | for(int i=0;i<n;i+;){
| ~ ^
| )
a.cc:9:24: er... |
s897420527 | p02257 | C++ | #include<iostream>
#include<math.h>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
if(sqrtA[i])>=2){
for(int j=2;j<=sqrt(A[i]);j++){
if(A[i]%j==0){
... | a.cc: In function 'int main()':
a.cc:9:23: error: expected primary-expression before ';' token
9 | for(int i=0;i<n;i+;){
| ^
a.cc:9:23: error: expected ')' before ';' token
9 | for(int i=0;i<n;i+;){
| ~ ^
| )
a.cc:9:24: er... |
s235057018 | p02257 | C++ | #include<iostream>
#include<math.h>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;sqrt(A[i])>=2){
for(int j=2;j<=sqrt(A[i]);j++){
if(A[i]%j==0){
judge=1;
... | a.cc: In function 'int main()':
a.cc:9:23: error: expected primary-expression before ';' token
9 | for(int i=0;i<n;i+;){
| ^
a.cc:9:23: error: expected ')' before ';' token
9 | for(int i=0;i<n;i+;){
| ~ ^
| )
a.cc:9:24: er... |
s003187355 | p02257 | C++ | #include<iostream>
#include<math.h>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
if(sqrt(A[i])>=2){
for(int j=2;j<=sqrt(A[i]);j++){
if(A[i]%j==0){
... | a.cc: In function 'int main()':
a.cc:9:23: error: expected primary-expression before ';' token
9 | for(int i=0;i<n;i+;){
| ^
a.cc:9:23: error: expected ')' before ';' token
9 | for(int i=0;i<n;i+;){
| ~ ^
| )
a.cc:9:24: er... |
s364196648 | p02257 | C++ | #include<iostream>
#include<math.h>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
if(sqrt(A[i])>=2){
for(int j=2;j<=sqrt(A[i]);j++){
if(A[i]%j==0){
... | a.cc: In function 'int main()':
a.cc:9:23: error: expected primary-expression before ';' token
9 | for(int i=0;i<n;i+;){
| ^
a.cc:9:23: error: expected ')' before ';' token
9 | for(int i=0;i<n;i+;){
| ~ ^
| )
a.cc:9:24: er... |
s447376828 | p02257 | C++ | #include<iostream>
#include<math.h>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i+;){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
if(sqrt(A[i])>=2){
for(int j=2;j<=sqrt(A[i]);j++){
if(A[i]%j==0){
... | a.cc: In function 'int main()':
a.cc:9:23: error: expected primary-expression before ';' token
9 | for(int i=0;i<n;i+;){
| ^
a.cc:9:23: error: expected ')' before ';' token
9 | for(int i=0;i<n;i+;){
| ~ ^
| )
a.cc:9:24: er... |
s508457945 | p02257 | C++ | #include<iostream>
#include<math.h>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i++){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
if(sqrt(A[i])>=2){
for(int j=2;j<=sqrt(A[i]);j++){
if(A[i]%j==0){
... | a.cc: In function 'int main()':
a.cc:27:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
27 | ans=n-cnt;
| ^~~
| abs
|
s477816150 | p02257 | C++ | #include<iostream>
#include<math.h>
int main()
{
int n;
int cnt=0;
std::cin>>n;
int A[n];
for(int i=0;i<n;i++){
std::cin>>A[i];
}
int judge=0;
for(int i=0;i<n;i++){
if(sqrt(A[i])>=2){
for(int j=2;j<=sqrt(A[i]);j++){
if(A[i]%j==0){
... | a.cc: In function 'int main()':
a.cc:28:14: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
28 | std::cout>>ans;
| ~~~~~~~~~^~~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char... |
s241588743 | p02257 | C++ | #include <stdio.h>
#include <vector>
#include <utility>
#include <algorithm>
#include <iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
int main()
{int ans=0;
int n;
vector<bool>isprime(10004);
for(int i=0;i<isprime.size();++i){
isprime[i]=true;
}
isprime[0]=isprime[1]=false;
//.
for(int i=0;i<10... | a.cc:20:7: error: extended character ” is not valid in an identifier
20 | cout<<” ”;
| ^
a.cc:20:9: error: extended character ” is not valid in an identifier
20 | cout<<” ”;
| ^
a.cc:21:19: error: extended character ” is not valid in an identifier
21 | cout<<(isprime[i]?”YES”:”NO”)<<e... |
s289302457 | p02257 | C++ | #include <stdio.h>
#include <math.h>
int main(void)
{
int n, x, i, j, count, ans = 0;
scanf_s("%d", &n);
if (n >= 1 && n <= 10000) {
for (i = 0; i < n; i++) {
scanf_s("%d", &x);
if (x >= 2 && x <= (pow(10.0, 8.0))) {
count = 0;
for (j = 1; j <= x; j++) {
if (x % j == 0) count++;
if (count >... | a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
6 | scanf_s("%d", &n);
| ^~~~~~~
| scanf
|
s125812044 | p02257 | C++ | #include <iostream>
using namespace std;
bool primes[100000000]={true};
bool IsPrime(p)
{
return primes[p];
}
int main(void)
{
int count=0;
int n;
cin>>n;
for(int i =0;i<n;i++)
{
int p;
cin>>p;
if(IsPrime(p))
{
count++;
}
}
cout<<count<... | a.cc:4:14: error: 'p' was not declared in this scope
4 | bool IsPrime(p)
| ^
a.cc: In function 'int main()':
a.cc:17:19: error: 'IsPrime' cannot be used as a function
17 | if(IsPrime(p))
| ~~~~~~~^~~
|
s703641132 | p02257 | C++ | #include <iostream>
using namespace std;
bool primes[100000000]={true};
bool IsPrime(p)
{
return primes[p];
}
int main(void)
{
int count=0;
int n;
cin>>n;
for(int i =0;i<n;i++)
{
int p;
cin>>p;
if(IsPrime(p))
{
count++;
}
}
cout<<count<... | a.cc:4:14: error: 'p' was not declared in this scope
4 | bool IsPrime(p)
| ^
a.cc: In function 'int main()':
a.cc:17:19: error: 'IsPrime' cannot be used as a function
17 | if(IsPrime(p))
| ~~~~~~~^~~
|
s081869597 | p02257 | C++ | #include <iostream>using namespace std;
// エラトステネスの篩//
bool primes[100000000] = {true};bool IsPrime(int n) {
int count = 0; for(int i=1;i<=n;i++){
if(n % i == 0) {
count++;
}
if(count > 2){
return false;
}
}
return (count == 2);
}
int main(void){
int count = 0;
int n;
cin >> n;
for... | a.cc:1:26: warning: extra tokens at end of #include directive
1 | #include <iostream>using namespace std;
| ^~~~~~~~~
a.cc:1:10: fatal error: iostream>usin: No such file or directory
1 | #include <iostream>using namespace std;
| ^~~~~~~~~~~~~~~
compilation terminate... |
s093209658 | p02257 | C++ | import java.util.Arrays;
import java.util.Scanner;
class Hoge {
private static void print(String s) { System.out.print(s);}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int num_primes = 0;
initTable();
for(int i=0;i<N;i++) {
int x = sc.nextInt();
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Arrays;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-t... |
s243384530 | p02257 | C++ | #include <iostream>
using namespace std;
bool IsPrime(int x) {
return true; /* ダミー: 全て素数と判定 */
}
int main(void){
int count = 0, n;
cin >> n; /* n個整数を読む */
for(int i = 0; i < n; i++) {
int p;
cin >> p;
if(IsPrime(p)) {
bool IsPrime(int n) {
for(int i = 2; i*i <= n; i++) {
... | a.cc: In function 'int main()':
a.cc:15:30: error: a function-definition is not allowed here before '{' token
15 | bool IsPrime(int n) {
| ^
|
s711277293 | p02257 | C++ | #include <iostream>using namespace std;
// エラトステネスの篩//
bool primes[100000000] = {true};bool IsPrime(int n) {
int count = 0;
for(int i=1;i<=n;i++){
if(n % i == 0) {
count++; }
if(count > 2){
return false;
}
}
return (count == 2);}int main(void){
int count = 0;
... | a.cc:1:26: warning: extra tokens at end of #include directive
1 | #include <iostream>using namespace std;
| ^~~~~~~~~
a.cc:1:10: fatal error: iostream>usin: No such file or directory
1 | #include <iostream>using namespace std;
| ^~~~~~~~~~~~~~~
compilation terminate... |
s130817515 | p02257 | C++ | #include <iostream>
using namespace std;
bool IsPrime(int x) {
return true; /* ダミー: 全て素数と判定 */
}
int main(void){
int count = 0, n;
cin >> n; /* n個整数を読む */
for(int i = 0; i < n; i++) {
int p;
cin >> p;
if(IsPrime(p)) {
bool IsPrime(int n) {
for(int i = 2; i*i <= n; i++) {
... | a.cc: In function 'int main()':
a.cc:15:30: error: a function-definition is not allowed here before '{' token
15 | bool IsPrime(int n) {
| ^
a.cc: At global scope:
a.cc:30:1: error: expected declaration before '}' token
30 | }
| ^
|
s857669925 | p02257 | C++ | #include <iostream>using namespace std;
bool primes[100000000] = {true};
bool IsPrime(int n) {
int count = 0;
for(int i=1;i<=n;i++){
if(n % i == 0) {
count++;
}
if(count > 2){
return false;
}
}
return (count == 2);}int main(void){
int count = 0;
int n;
c... | a.cc:1:26: warning: extra tokens at end of #include directive
1 | #include <iostream>using namespace std;
| ^~~~~~~~~
a.cc:1:10: fatal error: iostream>usin: No such file or directory
1 | #include <iostream>using namespace std;
| ^~~~~~~~~~~~~~~
compilation terminate... |
s503775341 | p02257 | C++ | #include <iostream>
using namespace std;
bool primes[100000000] = {true};
bool IsPrime(int n) {
int count = 0;
for(int i=1;i<=n;i++){
if(n % i == 0) {
count++;
}
if(count > 2){
return false;
}
}
return (count == 2);}int main(void){
int count = 0;
int n;
... | a.cc: In function 'int main()':
a.cc:27:13: error: expected '}' at end of input
27 | return 0;
| ^
a.cc:15:37: note: to match this '{'
15 | return (count == 2);}int main(void){
| ^
|
s788526720 | p02257 | C++ | #include <iostream>
using namespace std;
bool primes[100000000] = {true};
bool IsPrime(int n) {
int count = 0;
for(int i=1;i<=n;i++){
if(n % i == 0) {
count++;
}
if(count > 2){
return false;
}
}
return (count == 2);
}
int main(void){
int count = 0;
int n;... | a.cc: In function 'int main()':
a.cc:30:13: error: expected '}' at end of input
30 | return 0;
| ^
a.cc:18:15: note: to match this '{'
18 | int main(void){
| ^
|
s047161143 | p02257 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
using namespace std;
bool judge(int n){
if(n<=1){return false;}
for(int i=2;i*i<=n;i++){
if(n%i==0){return false;}
}
return true... | a.cc: In function 'int main()':
a.cc:28:17: error: expected ')' before 'a'
28 | if(judge a){count++;}
| ~ ^~
| )
|
s386506707 | p02257 | 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
| |
s428724397 | p02257 | C++ |
#include<bits/stdc++.h>
using namespace std;
int isprime(int x)
{
if(x<2){
return 0;
}else if(x==2){
return 1;
}
if(x%2==0){
return 0;
}
int temp=(ceil)sqrt(x);
for(int i=3;i<=temp;i+=2){
if(x%i==0){
return 0;
}
}
return 1;
}
in... | a.cc: In function 'int isprime(int)':
a.cc:16:19: error: cannot resolve overloaded function 'ceil' based on conversion to type 'int'
16 | int temp=(ceil)sqrt(x);
| ^
|
s224283810 | p02257 | C++ | #include<stdio.h>
#include<math.h>
int isPrime(int x){
if(x==2){
return true;
}
if(x<2 || x%2==0){
return false;
}
int i=3;
while(i<=sqrt(x)){
if(x%i==0){
return false;
}
i = i+2;
}
return true;
}
int main(){
int n;
scanf("%d",&n);
int N[n];
int c=0;
for(int i=0;... | a.cc: In function 'int main()':
a.cc:30:5: error: 'cin' was not declared in this scope; did you mean 'sin'?
30 | cin >> N[i];
| ^~~
| sin
|
s105208143 | p02257 | C++ | #include <iostream>
#include <cassert>
#define MAX_N (100000000)
bool ptable[MAX_N];
void init_ptable()
{
memset(ptable, false, MAX_N * sizeof(bool));
ptable[0] = true;
int base = 2;
while (base <= MAX_N / 2) {
//std::cout << "base: " << base << std::endl;
for (int cur = base * 2; c... | a.cc: In function 'void init_ptable()':
a.cc:10:5: error: 'memset' was not declared in this scope
10 | memset(ptable, false, MAX_N * sizeof(bool));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cassert>
++... |
s426230784 | p02257 | C++ | #include <iostream>
#include <cassert>
#define MAX_N (100000000)
bool ptable[MAX_N];
void init_ptable()
{
memset(ptable, false, MAX_N * sizeof(bool));
ptable[0] = true;
int base = 2;
while (base <= MAX_N / 2) {
//std::cout << "base: " << base << std::endl;
for (int cur = base * 2; c... | a.cc: In function 'void init_ptable()':
a.cc:10:5: error: 'memset' was not declared in this scope
10 | memset(ptable, false, MAX_N * sizeof(bool));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cassert>
++... |
s455431133 | p02257 | 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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.