submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s830162022 | p00009 | C++ | #include<stdio.h>
#include<math.h>
int gurobal[1000001]={0};
int main(void)
{
int n=0;
int i=0,j=0;
int heihoukon=0;
int count=0;
while(scanf("%d",&n)!=EOF)
{
count=0;
gurobal[1]=0;
for (i=2;i<=n;i++)
{
gurobal[i]=1;
}
(int)heihoukon=sqrt((double)n);
for (i=2;i<=heihoukon;i++)
{
if (gurobal[... | a.cc: In function 'int main()':
a.cc:18:17: error: lvalue required as left operand of assignment
18 | (int)heihoukon=sqrt((double)n);
| ^~~~~~~~~~~~~~
|
s967665288 | p00009 | C++ | #include<stdio.h>
#include<math.h>
int gurobal[1000001]={0};
int main(void)
{
int n=0;
int i=0,j=0;
int heihoukon=0;
int count=0;
while(scanf("%d",&n)!=EOF)
{
count=0;
gurobal[1]=0;
for (i=2;i<=n;i++)
{
gurobal[i]=1;
}
(int)heihoukon=sqrt((double)n);
for (i=2;i<=heihoukon;i++)
{
if (gurobal[... | a.cc: In function 'int main()':
a.cc:18:17: error: lvalue required as left operand of assignment
18 | (int)heihoukon=sqrt((double)n);
| ^~~~~~~~~~~~~~
|
s692520195 | p00009 | C++ | #include<stdio.h>
#include<math.h>
int gurobal[100000001]={0};
int main(void)
{
int n=0;
int i=0,j=0;
int heihoukon=0;
int count=0;
while(scanf("%d",&n)!=EOF)
{
count=0;
gurobal[1]=0;
for (i=2;i<=n;i++)
{
gurobal[i]=1;
}
(int)heihoukon=sqrt((double)n);
for (i=2;i<=heihoukon;i++)
{
if (guroba... | a.cc: In function 'int main()':
a.cc:18:17: error: lvalue required as left operand of assignment
18 | (int)heihoukon=sqrt((double)n);
| ^~~~~~~~~~~~~~
|
s963614887 | p00009 | C++ | package util;
import java.util.Scanner;
public class Main{
boolean isPrime[];
void run(){
isPrime = new boolean[1000000];
for(int i=0;i<1000000;i++) isPrime[i] = true;
isPrime[0] = false;
isPrime[1] = false;
for(int i=2;i<=1000000;i++){
if(!isPrime[i]) continue;
for(int j=i+i;j<=1000000;j+=i)... | a.cc:1:1: error: 'package' does not name a type
1 | package util;
| ^~~~~~~
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-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
4 | public ... |
s233107041 | p00009 | C++ | #include <iostream>
using namespace std;
void solve(int n);
int main() {
int n;
while (cin >> n) {
if (n<=1) cout << 0 << endl;
solve(n);
}
return 0;
}
void solve(int n) {
int prime[n];
int i=0;j=0;
for (i=2; i<=n; i++) {
prime[j] = i;
j++;
}
int p;
for (i=0; i<n; i++) {
p = prime[i];
if (p == -... | a.cc: In function 'void solve(int)':
a.cc:15:17: error: 'j' was not declared in this scope
15 | int i=0;j=0;
| ^
|
s511885932 | p00009 | C++ | #include<iostream>
int a,n[40],c[40];
int main (){
for(int i=2;i<31;i++){
n[i]=1;
for(int j=2;j<i;j++){
if(i%j==0){
n[i]=0;
j=i;
}
}
}
for(int i=1;i<31;i++){
c[i]=c[i-1]+n[i];
}
while(scanf("%d"a)^){
printf("%d",c[a]);
}
} | a.cc: In function 'int main()':
a.cc:18:21: error: unable to find string literal operator 'operator""a' with 'const char [3]', 'long unsigned int' arguments
18 | while(scanf("%d"a)^){
| ^~~~~
a.cc:18:28: error: expected primary-expression before ')' token
18 | while(scanf... |
s176758368 | p00009 | C++ | #include<iostream>
#include<vector>
#define LIM 1000000
using namespace std;
void prime();
vector<int> prime_map;
int main(){
int num, i=0,j=0;
vector<int> count;
prime();
cout<<"plese"<<endl;
while(cin){
cin>>num;
i=0;
while(prime_map[i]<=num){
i=i+1;
}
count.push_back(i);
j... | a.cc: In function 'void prime()':
a.cc:38:28: error: expected ';' before 'break'
38 | if(i%j == 0)judge = 0 break;
| ^~~~~~
| ;
|
s849866048 | p00009 | C++ | #include<iostream>
#define LIM 1000000
using namespace std;
int main(){
bool num_map[LIM];
int in_num,prime_count;
for(int i=0;i<LIM;i++){
num_map[i]=1;
}
for(int i=2;i<LIM;i++){
if(num_map[i]==1)
for(int j=i*2;j<LIM;j+=i){
num_map[j]=cout<<in_num<<endl<<endl;
for(int i=2;i<=in_num;i++... | a.cc: In function 'int main()':
a.cc:16:38: error: cannot convert 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'bool' in assignment
16 | num_map[j]=cout<<in_num<<endl<<endl;
| ~~~~~~~~~~~~~~~~~~^~~~~~
| |
... |
s012423112 | p00009 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
vector<int> prime;
void init(){
for(int i=2;i<999999;i++){
bool isprime=true;
for(vector::iterator p(prime.begin());p!=prime.end();p++){
if(i%*p==0){
isprime=false;
break;
}
}
if(isprime){
prime.push_back(i);
}
}
}
int main(){
i... | a.cc:4:1: error: 'vector' does not name a type
4 | vector<int> prime;
| ^~~~~~
a.cc: In function 'void init()':
a.cc:8:21: error: 'vector' has not been declared
8 | for(vector::iterator p(prime.begin());p!=prime.end();p++){
| ^~~~~~
a.cc:8:55: error: 'p' was not d... |
s461682773 | p00009 | C++ | #include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int> prime;
void init(){
for(int i=2;i<999999;i++){
bool isprime=true;
for(vector::iterator p(prime.begin());p!=prime.end();p++){
if(i%*p==0){
isprime=false;
break;
}
}
if(isprime){
prime.push_back(i);
}
... | a.cc: In function 'void init()':
a.cc:9:38: error: qualified-id in declaration before 'p'
9 | for(vector::iterator p(prime.begin());p!=prime.end();p++){
| ^
a.cc:9:37: error: expected ';' before 'p'
9 | for(vector::iterator p(prime.begin... |
s022497586 | p00009 | C++ | #include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int> prime;
void init(){
for(int i=2;i<999999;i++){
bool isprime=true;
for(vector<int>::iterator p(prime.begin());p!=prime.end();p++){
if(p*p>i)break;
if(i%*p==0){
isprime=false;
break;
}
}
if(isprime){
p... | a.cc: In function 'void init()':
a.cc:10:29: error: no match for 'operator*' (operand types are 'std::vector<int>::iterator' and 'std::vector<int>::iterator')
10 | if(p*p>i)break;
| ~^~
| | |
| ... |
s385491361 | p00009 | C++ |
def generate (n)
$P = Array.new(n, false)
i = 3
until i > n
$P[i] = true
i += 2
end
i = 3
$P[2] = true
until i > n
if ! $P[i]
i += 2
next
end
j = i + i
until j > n do
$P[j] = false
j += i
... | a.cc:2:1: error: 'def' does not name a type
2 | def generate (n)
| ^~~
a.cc:34:6: error: expected unqualified-id before '.' token
34 | }.call
| ^
|
s882835718 | p00009 | C++ | #include <iostream>
using namespace std;
#define thefor(i,end) for (i=0;i<end;i++)
bool isprime(int n)
{
if(n==1)return false;
if(n==2)return true;
for (int i=3;i<n;i++)
{
if (n%i==0)return false;
}
if (i==n)
return true;
else
return false;
}
int main()
{
bool prime[1000010];
memset(prime,1,1000010);
... | a.cc: In function 'bool isprime(int)':
a.cc:12:13: error: 'i' was not declared in this scope
12 | if (i==n)
| ^
a.cc: In function 'int main()':
a.cc:20:9: error: 'memset' was not declared in this scope
20 | memset(prime,1,1000010);
| ^~~~~~
a.cc:2:1: note: 'memset' ... |
s497746703 | p00009 | C++ | #include <iostream>
using namespace std;
int main()
{
bool prime[1000010];
memset(prime,1,1000010);
prime[0]=prime[1]=0;
int i,j,n,sum;
for (i=2;i<1000000;i++)
{
if (prime[i])
{
for (j=2;i*j<1000000;j++)
{
prime[i*j]=false;
}
}
}
while(cin>>n)
{
sum=0;
for(i=2;i<=n;i++)
{
sum+=prime... | a.cc: In function 'int main()':
a.cc:6:9: error: 'memset' was not declared in this scope
6 | memset(prime,1,1000010);
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstrin... |
s231777588 | p00009 | C++ | #include<iostream>
using namespace std;
main(){
while(cin>>n){
cout<<n<<endl;
}
} | a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:4:20: error: 'n' was not declared in this scope
4 | while(cin>>n){
| ^
|
s089248703 | p00009 | C++ | #include <iostream>
int main()
{
bool *table = new bool[1000000];
while (true) {
int n;
std::cin >> n;
if (std::cin.eof()) break;
memset(table, 1, sizeof(bool) * (n + 1));
for (int i = 2; i * i <= n; ++i)
for (int j = 2; i * j <= n; ++j)
tabl... | a.cc: In function 'int main()':
a.cc:11:9: error: 'memset' was not declared in this scope
11 | memset(table, 1, sizeof(bool) * (n + 1));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ ... |
s404329477 | p00009 | C++ | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int n,i,j,buf,cnt;
bool flag;
while(cin >> n){
if(n == 1){
cout << "0" << endl;
continue;
}
cnt = 1;
for(i=3;i<=n;i+=2){
flag = false;
buf = (int)sqrt((double)i);
for(j=3;j<=buf;j+=2){
if((i % j) == 0){
flag = ... | a.cc: In function 'int main()':
a.cc:29:42: error: expected primary-expression before ')' token
29 | if(flag == false;){
| ^
|
s989602450 | p00009 | C++ | #include<stdio.h>
#include<math.h>
int gurobal[1000001]={0};
int main(void)
{
int n=0;
int i=0,j=0;
int heihoukon=0;
int count=0;
while(scanf("%d",&n)!=EOF)
{
count=0;
gurobal[1]=0;
for (i=2;i<=n;i++)
{
gurobal[i]=1;
}
(int)heihoukon=sqrt((double)n);
for (i=2;i<=heihoukon;i++)
{
if (gurobal[... | a.cc: In function 'int main()':
a.cc:18:17: error: lvalue required as left operand of assignment
18 | (int)heihoukon=sqrt((double)n);
| ^~~~~~~~~~~~~~
|
s593428611 | p00009 | C++ | #include<stdio.h>
#include<math.h>
int gurobal[999999]={0};
int main(void)
{
int n=0;
int i=0,j=0;
int heihoukon=0;
int count=0;
while(scanf("%d",&n)!=EOF)
{
count=0;
gurobal[1]=0;
for (i=2;i<=n;i++)
{
gurobal[i]=1;
}
(int)heihoukon=sqrt((double)n);
for (i=2;i<=heihoukon;i++)
{
if (gurobal[i... | a.cc: In function 'int main()':
a.cc:18:17: error: lvalue required as left operand of assignment
18 | (int)heihoukon=sqrt((double)n);
| ^~~~~~~~~~~~~~
|
s069671462 | p00009 | C++ | #include <iostream>
#include <bitset>
#include <cmath>
using namespace std;
int main()
{
int count=0,n;
prime[0]=1;
prime[1]=1;
while(cin>>n)
{
int prime[1000001]={0};
for(int i=2;i<=sqrt(n);i++)
if(prime[i]==0)
for(int j=i+1;j<=n;j++)
if(i%j==0)
prime[j]=1;
for(int i=2;i<=n;i++)
if(pr... | a.cc: In function 'int main()':
a.cc:9:9: error: 'prime' was not declared in this scope
9 | prime[0]=1;
| ^~~~~
|
s200869412 | p00009 | C++ | #include<iostream>
using namespace std;
int main()
{
bool is_prime[1000000];
memset(is_prime,false,sizeof(is_prime));
for(int i=2;i<1000000;i++){
if(!is_prime[i]){
// cout<<i<<endl;
for(int m=i*2;m<1000000;m+=i){
is_prime[m]=true;
}
}
}
int n;
while(cin>>n){
int ans=0;
for(int i=2;i<=n;i++){
... | a.cc: In function 'int main()':
a.cc:7:9: error: 'memset' was not declared in this scope
7 | memset(is_prime,false,sizeof(is_prime));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#... |
s174733821 | p00009 | C++ | #include <stdio.h>
#include <string.h>
int main(void){
int n=999999,a,b,c;
char x[1000000];
memset(x,0,sizeof(x));
for(a=2,c=0;a<=n;a++){
if(x[a]){x[a]=c;continue;}
x[a]=++c;
for(b=a*2;b<=n;b+=a)x[b]=-1;
}
while(~scanf("%d",&n)){
printf("%d\n",x[n]);
}
ret... | a.cc: In function 'int main()':
a.cc:15:14: error: expected '}' at end of input
15 | return 0;
| ^
a.cc:3:15: note: to match this '{'
3 | int main(void){
| ^
|
s008171309 | p00009 | C++ | #include <iostream>
#define N 100000
#define rep(i,n) for(int i=0;i<n;i++)
int main(void)
{
bool a[N+1];
int prime[N], n;
rep(i,N)
{
a[i] = true;
}
a[0] = a[1] = false;
for(int i=2;i*i<=N;i++)
{
if(a[i])
{
prime[i] = prime[i-1] + 1;
for(in... | a.cc: In function 'int main()':
a.cc:26:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
26 | while(cin >> n)
| ^~~
| 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; ... |
s089041858 | p00009 | C++ | #include <iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const int N = 100000
int main(void)
{
bool a[N+1];
int prime[N], n;
rep(i,N+1)
{
a[i] = true;
}
a[0] = a[1] = false;
for(int i=2;i*i<=N;i++)
{
if(a[i])
{
prime[i] = prime[... | a.cc:7:1: error: expected ',' or ';' before 'int'
7 | int main(void)
| ^~~
|
s525044811 | p00009 | C++ | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef vector <int> vi;
vi primes;
int get_primes(int max){
int n = (max+1)/2;
int root = (int)(pow(n, 0.5));
vector <bool> numbers(n, true);
numbers[0]=false;
if (max>1) primes.push_back(2);
for (int i=1; i<root; i++){
int tmp =... | a.cc: In function 'int get_primes(int)':
a.cc:10:26: error: 'pow' was not declared in this scope
10 | int root = (int)(pow(n, 0.5));
| ^~~
|
s373159891 | p00009 | C++ | using System;
using System.Collections;
class main
{
static void Main(String[] args)
{
while (true)
{
string s = Console.ReadLine();
if (s != null)
{
int c = 0;
int f = 0;
int n = int.Parse(s);
... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections;
| ^~~~~~
a.cc:6:22: error: 'String' has not been declared
6 | static void Main(String[] args)
... |
s718575861 | p00009 | C++ | #include <iostream>
using namespace std;
bool isprime(int &num)
{
static int i;
i = 2;
for(;i< num; i++)
if(num%i==0) return false;
return true;
}
int countprime(int &num)
{
static int i;
static int count;
count = 0;
i = 2;
for(;i<=num;i++)
if(isprime(i)) count++;
... | a.cc: In function 'int main()':
a.cc:31:28: error: expected primary-expression before 'int'
31 | cout << countprime(int num[i]) << endl;
| ^~~
|
s571218236 | p00009 | C++ | #include <iostream>
using namespace std;
int main(){
const int N_MAX=1000000;
int i,j,n[32],ni,soi,max;
int so[N_MAX],count[N_MAX];
for(i=0;i<N_MAX;i++)
count[i]=so[i]=0;
ni=0;
max=0;
while(cin>>n[ni])
if(n[ni++]>max)
max=n[ni-1];
int sq_max = (int)sqrt(max);
so[0]=so[1]=1;
for(soi=0,i=2;i<=sq_max;... | a.cc: In function 'int main()':
a.cc:17:27: error: 'sqrt' was not declared in this scope
17 | int sq_max = (int)sqrt(max);
| ^~~~
|
s939877509 | p00009 | C++ | #include <iostream>
using namespace std;
int main(){
const int N_MAX=100000;
int i,j,n[32],ni,soi,max;
int so[N_MAX],count[N_MAX];
for(i=0;i<N_MAX;i++)
count[i]=so[i]=0;
ni=0;
max=0;
while(cin>>n[ni])
if(n[ni++]>max)
max=n[ni-1];
int sq_max = (int)sqrt(max);
so[0]=so[1]=1;
for(soi=0,i=2;i<=sq_max;i... | a.cc: In function 'int main()':
a.cc:17:27: error: 'sqrt' was not declared in this scope
17 | int sq_max = (int)sqrt(max);
| ^~~~
|
s929464925 | p00009 | C++ | #include <iostream>
using namespace std;
int main(){
const int N_MAX=100;
int i,j,n[32],ni,soi,max;
int so[N_MAX],count[N_MAX];
for(i=0;i<N_MAX;i++)
count[i]=so[i]=0;
ni=0;
max=0;
while(cin>>n[ni])
if(n[ni++]>max)
max=n[ni-1];
int sq_max = (int)sqrt(max);
so[0]=so[1]=1;
for(soi=0,i=2;i<=sq_max;i++)... | a.cc: In function 'int main()':
a.cc:17:27: error: 'sqrt' was not declared in this scope
17 | int sq_max = (int)sqrt(max);
| ^~~~
|
s836170805 | p00009 | C++ | #include <iostream>
using namespace std;
int main(){
const int N_MAX=1000000;
int i,j,n[32],ni,max;
int count[N_MAX];
bool so[N_MAX];
for(i=0;i<N_MAX;i++)
so[i]=true;
ni=0;
max=0;
while(cin>>n[ni])
if(n[ni++]>max)
max=n[ni-1];
so[0]=so[1]=0;
for(soi=0,i=2;i<=1000;i++){
if(so[i]==0)continue;
for... | a.cc: In function 'int main()':
a.cc:19:13: error: 'soi' was not declared in this scope; did you mean 'so'?
19 | for(soi=0,i=2;i<=1000;i++){
| ^~~
| so
|
s242753323 | p00009 | C++ | #include<iostream>
#include<conio.h>
#include<cmath>
using namespace std;
int main()
{
int n;
cin>>n;
for (int i=2; i<n; i++)
for (int j=2; j*j<=i; j++)
{
if (i % j == 0)
break;
else if (j+1 > sqrt(i)) {
cout << i << end... | a.cc:2:9: fatal error: conio.h: No such file or directory
2 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s887020277 | p00009 | C++ | int main(void)
{
int data,i,j,k=0,l=0,kai[100]={0},s[100000]={0};
while(scanf("%d",&data) != EOF)
{
if(data<=1)
kai[k]=0;
else
{
for(i=2;i<=data;i++)s[i]=i;
i=2;
while(i*2<data)
{
if(s[i] != 0)
{
j=2;
while(j*i<=data)
{
s[j*i]=0;
j+=1;
}
}
i... | a.cc: In function 'int main()':
a.cc:5:15: error: 'scanf' was not declared in this scope
5 | while(scanf("%d",&data) != EOF)
| ^~~~~
a.cc:5:36: error: 'EOF' was not declared in this scope
5 | while(scanf("%d",&data) != EOF)
| ^~~
a.cc:... |
s779666746 | p00009 | C++ | #include<stdio.h>
int main(void)
{
int data,i,j,k=0,l=0,kai=0,s[100000]={0};
while(scanf("%d",&data) != EOF)
{
if(data<=1)
kai[k]=0;
else
{
for(i=2;i<=data;i++)s[i]=i;
i=2;
while(i*2<data)
{
if(s[i] != 0)
{
j=2;
while(j*i<=data)
{
s[j*i]=0;
j+=1;
}
... | a.cc: In function 'int main()':
a.cc:10:23: error: invalid types 'int[int]' for array subscript
10 | kai[k]=0;
| ^
|
s214486380 | p00009 | C++ | #include<stdio.h>
int main(void)
{
int data=1,i,j,s[1000000],x;
while((scanf("%d\n",&data)) != EOF)
{
for(i=0;i<=data;i++){
s[i]=1;}
x=0;
if(data<=1){
printf("%d\n",0);}
else
{
for(i=2;i<=data/2;i++){
if(s[i]!=0){
for(j=i*2;j<data;j+=i)
s[j]=0;
}
for(i=0;i<data;i++)
x+... | a.cc: In function 'int main()':
a.cc:27:2: error: expected '}' at end of input
27 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s591268049 | p00009 | C++ |
int main(void)
{
int d=2,i,j,s[10000],x;
while(scanf("%d",d)!=EOF)
{
for(i=0;i<=d;i++){
s[i]=1;}
x=0;
if(d<=1){
printf("%d\n",0);}
else
{
for(i=2;i<=d/2;i++){
if(s[i]!=0){
for(j=i*2;j<d;j+=i)
s[j]=0;
}
}
for(i=0;i<d;i++)
x+=s[i];
printf("%d\n",x);
}
}
return ... | a.cc: In function 'int main()':
a.cc:6:15: error: 'scanf' was not declared in this scope
6 | while(scanf("%d",d)!=EOF)
| ^~~~~
a.cc:6:30: error: 'EOF' was not declared in this scope
6 | while(scanf("%d",d)!=EOF)
| ^~~
a.cc:1:1: note: 'EOF' i... |
s726802358 | p00009 | C++ | #include <stdio.h>
#include <math.h>
int judgeprime(long num){
int primeflag=1,i;
if(num%2==0){primeflag=0;}
else for(i=3;i<sqrt(num);i+=2){
if( num%i==0 ){
primeflag=0;
break;
}
}
if(num==0||num==1||num==4){primeflag=0;}
else if(num==2){primeflag=1;}
return primeflag;
}
int ma... | a.cc:42:1: error: expected unqualified-id before numeric constant
42 | 04:57:02 ~/programming/AOJ
| ^~
|
s288548663 | p00009 | C++ | #include <stdio.h>
#include <math.h>
int judgeprime(long num){
int primeflag=1,i;
if(num%2==0){primeflag=0;}
else for(i=3;i<sqrt(num);i+=2){
if( num%i==0 ){
primeflag=0;
break;
}
}
if(num==0||num==1||num==4){primeflag=0;}
else if(num==2){primeflag=1;}
return primeflag;
}
int ma... | a.cc:42:1: error: expected unqualified-id before numeric constant
42 | 04:57:02 ~/programming/AOJ
| ^~
|
s792688792 | p00009 | C++ | #include <stdio.h>
int main(void){
int n;
while(scanf("%d",&n)!=EOF){
int count=0;
for(int m=1;m<=n;m++){
bool check=true;
for(int i=2;i<m;i++){
if(i!=m && m%i==0){
chack=false;
}
}
if(check==true){
count++;
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:1: error: 'chack' was not declared in this scope; did you mean 'check'?
11 | chack=false;
| ^~~~~
| check
|
s377732965 | p00009 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int MAX_N = 1000000;
vector<int> init(void){
vector<int> prime;
bool is_prime[MAX_N];
memset(is_prime, true, MAX_N);
is_prime[0] = is_prime[1] = false;
for(int i=2; i<MAX_N; i++){
if(is_prime[i]){
... | a.cc: In function 'std::vector<int> init()':
a.cc:11:5: error: 'memset' was not declared in this scope
11 | memset(is_prime, true, MAX_N);
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <algorithm>
+++ |+#in... |
s224398831 | p00009 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
const int MAX_N = 1000000;
vector<int> init(void){
vector<int> prime;
bool is_prime[MAX_N];
memset(is_prime, true, MAX_N);
is_prime[0] = is_prime[1] = false;
for(int i=2; i<MAX_N; i++){
i... | a.cc: In function 'std::vector<int> init()':
a.cc:12:5: error: 'memset' was not declared in this scope
12 | memset(is_prime, true, MAX_N);
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <algorithm>
+++ |+#in... |
s819029124 | p00009 | C++ | #include <iostream>
using namespace std;
int main(){
int prime[999999];
bool is_prime[1000000];
int p =0;
int n ;
int i;
while(cin >> n){
for(i=0;i<=n;i++) is_prime[i] = true;
is_prime[0] = is_prime[1] = false;
for(i=2;i<=n;i++){
i... | a.cc:24:8: error: stray '@' in program
24 | [tebora@tebora cpp]$ cat pr.cpp
| ^
a.cc:24:1: error: expected unqualified-id before '[' token
24 | [tebora@tebora cpp]$ cat pr.cpp
| ^
a.cc:28:5: error: redefinition of 'int main()'
28 | int main(){
| ^~~~
a.cc:4:5: note: 'int main()' ... |
s034349980 | p00009 | C++ | import sys
def prime_list(n):
l = range(2,n+1)
i = 2
while i * i <= n:
l = filter(lambda x: x == i or x % i != 0, l)
i = i + 1
return l
if __name__ == '__main__':
l = prime_list(999999)
for line in sys.stdin:
n = int(line)
print len([x for x in l if x <= n]) | a.cc:11:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
11 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s625780843 | p00009 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
int n;
vector<int> a;
while(cin << n){
a.push_back(n);
}
for(int i=0;i<a.size();i++){
int k = 0;
for(int j=2;j<a[i];j++){
if(a[i]%j == 0 ) k++;
}
cout << k ;
}
} | a.cc: In function 'int main()':
a.cc:8:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
8 | while(cin << n){
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.... |
s542974646 | p00009 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
int n;
vector<int> a;
while(cin < n){
a.push_back(n);
}
for(int i=0;i<a.size();i++){
int k = 0;
for(int j=2;j<a[i];j++){
if(a[i]%j == 0 ) k++;
}
cout << k ;
}
} | a.cc: In function 'int main()':
a.cc:8:13: error: no match for 'operator<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
8 | while(cin < n){
| ~~~ ^ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:8:... |
s739580358 | p00009 | C++ |
int main()
{
int num, i, j;
cout<<"Enter an Integer:"<<endl;
cin>>num;
for(i=0; i<=num; i++)
{
for(j=2; j<=i; j++)
{
if(i%j == 0)
... | a.cc: In function 'int main()':
a.cc:5:6: error: 'cout' was not declared in this scope
5 | cout<<"Enter an Integer:"<<endl;
| ^~~~
a.cc:5:33: error: 'endl' was not declared in this scope
5 | cout<<"Enter an Integer:"<<endl;
| ^~~~
a.cc:6:19: error: 'cin... |
s353402230 | p00009 | C++ | #include <iostream>
using namespace std;
int main(void)
{
int input;
while(cin >> input)
{
bool isPrime[input];
// if the index 0 do not count as the prime number
isPrime[0] = false;
/// if the index 1 do not count as the prime number
isPrime[1] = false;
// if the index 2 count as the prime number
... | a.cc: In function 'int main()':
a.cc:22:42: error: 'n' was not declared in this scope
22 | for(int j = i * i; j <= n; j += i)
| ^
a.cc:24:38: error: 'n' was not declared in this scope
24 | for(int i = 4; i <= n; i += 2)
| ... |
s897207174 | p00009 | C++ |
#define MAX 100
main(){
int in_num;
int i, put, j, k = 0, l;
int count = 0;
int res;
int pres[MAX], flag = 0;
while(1){
res = scanf("%d", &in_num);
if(res == EOF) break;
for(i = 1 ; i <= in_num ; i++){
/* iが現在まで判明している素数の倍数でないかを調べる */
for(l = 0 ; pres[l] != NULL ; l++){
if(i % pres[... | a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:13:9: error: 'scanf' was not declared in this scope
13 | res = scanf("%d", &in_num);
| ^~~~~
a.cc:15:13: error: 'EOF' was not declared in this scope
... |
s924250577 | p00009 | C++ | #include <stdio.h>
int main(){
int e[30];
int k = 0;
while( scanf( "%d",&e[k] ) != EOF )k++;
for( int i = 0;i < k;i++ ){
int n = 1;
int k = 0;
while( true ){
if( e[k] => n ){
k++;
n *= 10;
} else {
brea... | a.cc: In function 'int main()':
a.cc:13:23: error: expected primary-expression before '>' token
13 | if( e[k] => n ){
| ^
|
s690816555 | p00009 | C++ | #include <deque>
#include <algorithm>
#include <iostream>
#include <functional>
using namespace std;
int main(){
int N,t,f,ans=0,s;
while(cin>>N){
for(int j=0;j<N;j++){
int cnt=0;
for(int k=2;k<N;k++){
if(N%k==0){
cnt=1;
}
}
if(data[j]==2){
cnt=0;
}
else if(data[j]==1){
cnt=1;
}
... | a.cc: In function 'int main()':
a.cc:16:24: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
16 | if(data[j]==2){
| ^
a.cc:19:29: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
19 | ... |
s829295764 | p00009 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int *prime,i,j;
int count;
bool flag;
//for(i=1;i<1000000;i++)n[i]=1;
while((cin >> n)!= NULL){
count = 0;
prime = new int[(int)sqrt(n)+1];
for(i = 3; i <= n; i+=2){
flag = true;
for(j = 0; j < count; j++){
if(i % prime[j] == 0){
fl... | a.cc: In function 'int main()':
a.cc:11:25: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'long int')
11 | while((cin >> n)!= NULL){
| ^
a.cc:11:25: note: candidate: 'operator!=(int, long int)'... |
s752067554 | p00009 | C++ | #include <iostream>
#include <list>
#include <algorithm>
using namespace std;
int main() {
int n;
while(!cin.eof()) {
cin >> n;
list<int> search_list(n-1);
list<int> prime_number;
while(n!=1) {
search_list.push_front(n);
n--;
}
while(!search_list.empty()) {
int m = sea... | a.cc: In function 'int main()':
a.cc:32:23: error: no matching function for call to 'std::__cxx11::list<int>::erase()'
32 | prime_number.erase();
| ~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/14/list:66,
from a.cc:2:
/usr/include/c++/14/bits/list.tcc:150:5: note: candid... |
s656224221 | p00010 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
for(int i = 0; i < n; i++) {
double x1 = s.nextDouble();
double y1 = s.nextDouble();
double x2 = s.nextDouble();
double y2 = s.nextDouble();
double x3 = ... | Main.java:25: error: ';' expected
double l = Math.hypot(x-x1, y-y1)
^
1 error
|
s071236342 | p00010 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
 
public class Main{
 
    private static final String BLANK = " ";
 
    public static void main(String[] args) {
 
   ... | Main.java:5: error: class, interface, enum, or record expected
 
^
Main.java:5: error: illegal character: '#'
 
^
Main.java:7: error: illegal start of type
 
^
Main.java:7: error: illegal character: '#'
 
^
Main.java:8: error: illegal start of type
    private static final Stri... |
s226914434 | p00010 | Java | package judge.aidu.volume0;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
public class CircumscribedCircleOfATriangle {
private static final String BLANK = " ";
public static void main(String[] args) {
BufferedReader in = n... | Main.java:8: error: class CircumscribedCircleOfATriangle is public, should be declared in a file named CircumscribedCircleOfATriangle.java
public class CircumscribedCircleOfATriangle {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s686938922 | p00010 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
public class Main{
private static final String BLANK = " ";
public static void main(String[] args) {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
... | Main.java:43: error: exception IOException is never thrown in body of corresponding try statement
} catch (IOException e) {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s164395687 | p00010 | Java | import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
for(int i=0;i<n;i++){
int x1,y1,x2,y2,x3,y3;
x1=sc.nextInt();
y1=sc.nextInt();
x2=sc.nextInt();
y2=sc.nextInt();
x3=sc.nextInt();
y3=sc.nextInt();
int a=(x1*x1-x2*x2)*(y2-y3)-(x2*x2-x3*x... | Main.java:19: error: incompatible types: possible lossy conversion from double to int
int r=Math.hypot(px-x1,py-y1);
^
1 error
|
s980782813 | p00010 | Java | import java.util.*;
public class Main{
static final Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
double x1,x2,x3,y1,y2,y3;
int n = stdin.nextInt();
while( n-- > 0 ){
x1 = sc.nextDouble(); y1 = sc.nextDouble();
x2 = sc.nextDouble(); y2 = sc.nextDouble();
x3 = sc.nextDou... | Main.java:7: error: cannot find symbol
int n = stdin.nextInt();
^
symbol: variable stdin
location: class Main
1 error
|
s881985897 | p00010 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class Main {
/**
* 空白区切りの6つの数字を受け取り、
* その6つの数字を3点とする三角形の外心および外接円の半径を取得する。
*
* @param args
*/
public static void main(String[] args) throws IOExcep... | Main.java:22: error: non-static variable this cannot be referenced from a static context
Triangle triangle = new Triangle(trianglePoints);
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s666289887 | p00010 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.MathContext;
public class AOJ0010 {
public static void main(String[] args) throws IOException {
//input
BufferedReader br = new BufferedReader(new InputStreamReader(System.... | Main.java:9: error: class AOJ0010 is public, should be declared in a file named AOJ0010.java
public class AOJ0010 {
^
Note: Main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
|
s738775993 | p00010 | Java | import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static double[] getLine(double x1, double y1, double x2, double y2){
double[] ans = new double[3];
double mid_x = (x1 + x2) / 2;
double mid_y = (y1 + y2) / 2;
ans[0] = y1 - y2;
ans[1] = x1 - x2;
ans... | Main.java:27: error: ')' expected
(l1[1] * l2[0] - l1[0] * l2[1]);
^
1 error
|
s269861440 | p00010 | Java | import java.util.*;
public class Vol0_10{
private static final Scanner scan = new Scanner(System.in);
public static double[] getLine(double x1, double y1, double x2, double y2){
double[] ans = new double[3];
double mid_x = (x1 + x2) / 2;
double mid_y = (y1 + y2) / 2;
ans[0] = y1 - y2;
ans[1] = x1 - x2;
... | Main.java:3: error: class Vol0_10 is public, should be declared in a file named Vol0_10.java
public class Vol0_10{
^
1 error
|
s076934859 | p00010 | Java | class Main
{
double x, y;
Main( double x, double y )
{
this.x = x;
this.y = y;
}
public static void main( String[] args )
{
new Circle();
}
static class Circle
{
Circle()
{
java.util.Scanner sc = new java.util.Scanner( System.in );
point a = new point( sc.nextDouble(), sc.nextDouble() );
poi... | Main.java:18: error: cannot find symbol
point a = new point( sc.nextDouble(), sc.nextDouble() );
^
symbol: class point
location: class Circle
Main.java:18: error: cannot find symbol
point a = new point( sc.nextDouble(), sc.nextDouble() );
^
symbol: class point
location: class Circl... |
s737075326 | p00010 | Java | class Main
{
double x, y;
Main( double x, double y )
{
this.x = x;
this.y = y;
}
public static void main( String[] args )
{
java.util.Scanner sc = new java.util.Scanner( System.in );
point a = new point( sc.nextDouble(), sc.nextDouble() );
point b = new point( sc.nextDouble(), sc.nextDouble() );
point... | Main.java:12: error: cannot find symbol
point a = new point( sc.nextDouble(), sc.nextDouble() );
^
symbol: class point
location: class Main
Main.java:12: error: cannot find symbol
point a = new point( sc.nextDouble(), sc.nextDouble() );
^
symbol: class point
location: class Main
Main.j... |
s869575449 | p00010 | Java | import java.util.Scanner;
public class CircumscribedCircleofaTriangle2 {
public static void main(String[] args) {
try (Scanner scan = new Scanner(System.in)) {
String[] vertexStrList = scan.nextLine().split(" ");
double[] vertexList = new double[6];
for (int i = 0; i < ... | Main.java:3: error: class CircumscribedCircleofaTriangle2 is public, should be declared in a file named CircumscribedCircleofaTriangle2.java
public class CircumscribedCircleofaTriangle2 {
^
1 error
|
s780642072 | p00010 | Java | /**
* A GaussJordan object holds a two dimensional array representing a matrix
* containing a system of equations. Contains methods for performing a
* Gauss-Jordan Elimination and putting a matrix into Reduced Row Echelon Form
*
* @author Thomas Coe
* @version 1.0 October 8th, 2013
*/
class GaussJordan{
pri... | Main.java:136: error: cannot find symbol
public static List<Double> genRow(double x1, double x2, double y1, double y2) {
^
symbol: class List
location: class Main
Main.java:161: error: cannot find symbol
public static void solve(ArrayList<Point> p) {
^
symb... |
s364629855 | p00010 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
double[] points = new double[6];
double ep = 0.0001;
double l,m;
for(int i=0 ; i<n ; i++) {
for(int j=0 ; j<6 ; j++)
points[j] = s.next();
for(int j=1 ; j<3 ; j... | Main.java:12: error: incompatible types: String cannot be converted to double
points[j] = s.next();
^
Main.java:20: error: bad operand types for binary operator '-'
System.out.println(points[0]-l/2 + " " + points[1]-m/2 + " " + (l*l+m*m)/4);
... |
s065472922 | p00010 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
double[] points = new double[6];
double ep = 0.0001;
double l,m;
for(int i=0 ; i<n ; i++) {
for(int j=0 ; j<6 ; j++)
points[j] = s.nextDouble();
for(int j=1 ; j... | Main.java:20: error: bad operand types for binary operator '-'
System.out.println(points[0]-l/2 + " " + points[1]-m/2 + " " + (l*l+m*m)/4);
^
first type: String
second type: double
1 error
|
s531135860 | p00010 | Java | import java.util.*;
public class Main {
static double[] solve(double a, double b, double c, double d, double e, double f){
double det = a*e-b*d;
double[] ans = new double[2];
ans[0] = (c*e-b*f)/det;
ans[1] = (a*f-c*d)/det;
for(int i=0; i<2; i++) if(ans[i]==-0) ans[i] = 0;
return ans;
}
public... | Main.java:34: error: reached end of file while parsing
}
^
1 error
|
s289433172 | p00010 | Java | 1
0.0 0.0 2.0 0.0 2.0 2.0import java.util.*;
public class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
for (int i = 0; i < n; i++) {
double x1 = scanner.nextDouble();
double y1... | Main.java:1: error: class, interface, enum, or record expected
1
^
1 error
|
s612046752 | p00010 | Java | import java.io.*;
import static java.lang.Math.*;
public class CircumscribedCircleOfATriangle {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(in.readLine());
for(int i=0;i<n;i++)calc(in.readLine());
... | Main.java:4: error: class CircumscribedCircleOfATriangle is public, should be declared in a file named CircumscribedCircleOfATriangle.java
public class CircumscribedCircleOfATriangle {
^
1 error
|
s294744373 | p00010 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double x1, x2, x3, y1, y2, y3, a, b, c, x, y, r;
while (sc.hasNext()) {
x1 = sc.nextDouble();
y1 = sc.nextDouble();
x2 = sc.nextDouble();
y2 = sc.nextDouble();
x3 = sc.nextDouble(... | Main.java:24: error: cannot find symbol
System.out.printf("%.3f %.3f %.3f", x, y, R);
^
symbol: variable R
location: class Main
1 error
|
s051170149 | p00010 | Java | import java.io.*;
class Main
{
public static void main(String args[])throws IOException
{
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
int n=Integer.parseInt(input.readLine());
for(int i=0;i<n;i++)
{
String str=input.readLine();
String str_ary[]=str.split(" ");
Double... | Main.java:21: error: incompatible types: int cannot be converted to Double
Double max1=x[0],max2=y[0],min1=x[0],min2=y[0],then=0;
^
1 error
|
s116120255 | p00010 | Java | import std.stdio;
import std.string;
import std.conv;
import std.math;
int main()
{
int n;
readf("%f",&n);
foreach(int i;0..n)
{
double x1,y1,x2,y2,x3,y3;
readf("%f %f %f %f %f %f",&x1,&y1,&x2,&y2,&x3,&y3);
double a1 = 2*(x2 - x1);
double b1 = 2*(y2 - y1);
double c1 = x1*x1 - x2*x2 + y1*y1 - y2*y2;
... | Main.java:11: error: not a statement
foreach(int i;0..n)
^
Main.java:11: error: not a statement
foreach(int i;0..n)
^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
int main()
^
(use --enable-preview to enable unnamed classes)
Main.java:9: error:... |
s975212343 | p00010 | Java | import java.util.*;
import java.math.BigDecimal;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
for(int i=0; i<n; i++) {
double a1 = in.nextDouble();
double a2 = in.nextDouble();
double b1 = in.nextDouble();
double b2 = in.next... | Main.java:25: error: reached end of file while parsing
}
^
1 error
|
s918402079 | p00010 | C | #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
int n;
double x1, x2, x3;
double y1, y2, y3;
cin >> n;
cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
double px, py, r;
double A = (x2 - x1)*(y3 - y2) - (y2 - y1)*(x3 - x2);
px = 0.5*((y3 - y2)*(x2*x2 - x1*x1 + y2*y2 - y1*y1) - ... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s706243551 | p00010 | C | #include<stdio.h>
#include<math.h>
double x1,y1,x2,y2,x3,y3;
double px, py,r;
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
double A1 =(x2*x2+y2*y2-x1*x1-y1*y1)*(y3-y1);
double B1 =(x3*x3+y3*y3-x1*x1-y1*y1)*(y2-y1);
... | main.c:3:11: error: 'y1' redeclared as different kind of symbol
3 | double x1,y1,x2,y2,x3,y3;
| ^~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:28,
from ... |
s277129121 | p00010 | C | #include <stdio.h>
#include <math.h>
typedef struct {
double x;
double y;
} point_t;
// result[0]: px
// result[1]: py
// result[2]: r
void alg ( point_t* data, double* result )
{
double a = sqrt( pow( data[0].x - data[1].x ) + pow( data[0].y - data[1].y ) );
double b = sqrt( pow( data[0].x - data[2].... | main.c: In function 'alg':
main.c:14:22: error: too few arguments to function 'pow'
14 | double a = sqrt( pow( data[0].x - data[1].x ) + pow( data[0].y - data[1].y ) );
| ^~~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/bits/lib... |
s775921704 | p00010 | C | #include <stdio.h>
#include <math.h>
typedef struct {
double x;
double y;
} point_t;
// result[0]: px
// result[1]: py
// result[2]: r
void alg ( point_t* data, double* result )
{
double a = sqrt( pow( data[0].x - data[1].x ) + pow( data[0].y - data[1].y ) );
double b = sqrt( pow( data[0].x - data[2].... | main.c: In function 'alg':
main.c:14:22: error: too few arguments to function 'pow'
14 | double a = sqrt( pow( data[0].x - data[1].x ) + pow( data[0].y - data[1].y ) );
| ^~~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/bits/lib... |
s208668259 | p00010 | C | #include<stdio.h>
#include<math.h>
int main(void){
int n,i;
double x1,x2,x3,y1,y2,y3;
double A1,B1,C1,A2,B2,C2,X,Y;
double r;
double a,b,c,a1,b1,c1;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%3lf %3lf %3lf %3lf %3lf %3lf",&x1,&y1,&x2,&y2,&x3,&y3);
A1 = 2 * (x2 - x1);
B1 = 2 * (y2 - y1);
... | main.c: In function 'main':
main.c:34:3: error: expected declaration or statement at end of input
34 | }
| ^
|
s292284261 | p00010 | C | #include<stdio.h>
#include<math.h>
int main(void){
int n;
double x1,x2,x3,y1,y2,y3;
double A1,B1,C1,A2,B2,C2,X,Y;
double r;
double a,b,c,a1,b1,c1;
scanf("%d",&n);
while( n != 0){
scanf("%3lf %3lf %3lf %3lf %3lf %3lf",&x1,&y1,&x2,&y2,&x3,&y3);
A1 = 2 * (x2 - x1);
B1 = 2 * (y2 - y1);
C1... | main.c: In function 'main':
main.c:24:8: error: implicit declaration of function 'anf'; did you mean 'ynf'? [-Wimplicit-function-declaration]
24 | Y =anf("%d",&n);
| ^~~
| ynf
main.c:49:2: error: expected declaration or statement at end of input
49 | }
| ^
|
s495903920 | p00010 | C | #include<stdio.h>
#include<math.h>
int main(void)
{
double x1 , x2 , x3 , y1 , y2 , y3 , x, y , r , a ;
while(scanf("%lf%lf%lf%lf%lf%lf",&x1,&x2,&x3,&y1,&y2,&y3)!=EOF){
a = (x1*x1+x2*x2-x3*x3) / 2*x1*x2 ;
r = x3 / (2*sin(double a));
x = ((y1-y3)*(y1*y1-y2*y2+x1*x1-x2... | main.c: In function 'main':
main.c:10:27: error: expected expression before 'double'
10 | r = x3 / (2*sin(double a));
| ^~~~~~
|
s232352108 | p00010 | C | #include <iostream>
#include <complex>
#include <cmath>
using namespace std;
// ?????§?¨?????????¨??????
typedef complex<double> P;
// ???????????
#define PI 3.1415926535898
// ?¨±?????????????????
#define EPS (1e-10)
//XY??§?¨?
#define X real()
#define Y imag()
//?????????double????????°???????????????????????????
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s727646528 | p00010 | C | #include <iostream>
#include <complex>
#include <cmath>
using namespace std;
// ?????§?¨?????????¨??????
typedef complex<double> P;
// ???????????
#define PI 3.1415926535898
// ?¨±?????????????????
#define EPS (1e-10)
//XY??§?¨?
#define X real()
#define Y imag()
//?????????double????????°???????????????????????????
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s051507623 | p00010 | C | #include<stdio.h>
#include<math.h>
int main();
double sq(double);
int main(){
double x1,x2,x3,y1,y2,y3,a1,b1,c1,a2,b2,c2,x,y,r;
int n;
scanf("%d\n", &n);
for(int i = 0;i < n;i++){
scanf("%lf %lf %lf %lf %lf %lf",
&x1, &y1, &x2, &y2, &x3, &y3);
a1 = 2 * (x2 - x1);
b1 = 2 * (y2 - y1);
c1 = sq(x1) ... | /usr/bin/ld: /tmp/ccjfcf6f.o: in function `main':
main.c:(.text+0x281): undefined reference to `hypot'
/usr/bin/ld: /tmp/ccjfcf6f.o: in function `sq':
main.c:(.text+0x2fe): undefined reference to `pow'
collect2: error: ld returned 1 exit status
|
s201393106 | p00010 | C | #include <stdio.h>
#include <math.h>
int main()
{
int i, n;
double x1, x2, x3, y1, y2, y3;
double a, b, c, d, e, f;
double X1, Y1, r;
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%lf %lf %lf %lf %lf %lf",&x1, &y1, &x2, &y2, &x3, &y3);
a = 2 * (x2 - x1);
b = 2 * (y2... | main.c: In function 'main':
main.c:29:9: error: 'px' undeclared (first use in this function)
29 | px = round(px);
| ^~
main.c:29:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:9: error: 'py' undeclared (first use in this function)
30 | ... |
s340871840 | p00010 | C | #include <stdio.h>
#include <math.h>
int main()
{
int n;
int i;
double x1, x2, x3, y1, y2, y3, px, py, r;
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3);
px = ((y2 - y1) * (y2 - y1) * (y3 - y2) + x1 * (x2 - x1) - x2 * (x3 - x2) * (y2 - y1)) / ((y3... | main.c: In function 'main':
main.c:18:60: error: expected ';' before 'printf'
18 | r = sqrt((px - x1) * (px - x1) + (py - y1) * (py - y1))
| ^
| ;
19 |
20 | printf("%lf %lf... |
s228963392 | p00010 | C | #include <stdio.h>
#include <math.h>
int main()
{
int n;
int i;
double x1, x2, x3, y1, y2, y3, px, py, r;
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);
px = ((y2 - y3)*(x1*x1 + y1*y1) + (y3 - y1)*(x2*x2 + y2*y2) + (y1 - y2)*(x3*x3 + y3*y3... | main.c: In function 'main':
main.c:19:9: error: too many arguments to function 'sqrt'
19 | r = sqrt(pow((px - x1), 2), pow((py - y1), 2));
| ^~~~
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from... |
s433261318 | p00010 | C | #include<stdio.h>
#include <math.h>
double ceil2(double dIn, int nLen) {
double dOut;
dOut = dIn * pow(10.0, nLen);
dOut = (double)(int)(dOut + 0.9);
return dOut * pow(10.0, -nLen);
}
int main(void) {
double x1[20], x2[20], x3[20], y1[20], y2[20], y3[20];
double distance_12[20],distance_23[20],distance_31[20... | main.c: In function 'main':
main.c:26:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
26 | scanf_s("%lf%lf%lf%lf%lf%lf",&x1[i],&y1[i],&x2[i],&y2[i],&x3[i],&y3[i]);
| ^~~~~~~
| scanf
|
s143758283 | p00010 | C | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <cstdlib>
#include <list>
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;
int main() {
int n;
double x1, x2, x3, y1, y2, y3;
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s383138205 | p00010 | C | #include<stdio.h>
#include<math.h>
struct Zahyou
{
float x, y;
};
int main()
{
int n;
Zahyou de[4];
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
for (int j = 1; j < 4; j++)
{
scanf("%f %f", &de[j].x, &de[j].y);
}
de[0].x = ((de[1].y - de[3].y)*(pow(de[1].y, 2) - pow(de[2].y, 2) + pow(de[1].x, 2) -... | main.c: In function 'main':
main.c:12:9: error: unknown type name 'Zahyou'; use 'struct' keyword to refer to the type
12 | Zahyou de[4];
| ^~~~~~
| struct
main.c:19:46: error: request for member 'x' in something not a structure or union
19 | scanf("%f %... |
s744264155 | p00010 | C | #include <stdio.h>
#include <math.h>
int main(void)
{
int n;
int i;
double x1, y1, x2, y2, x3, y3;
double a, b, c, d, e, f;
double px, py, r;
scanf("%d",&n);
for(int i=0; i<n; i++)
{
scanf("%lf%lf%lf%lf%lf%lf",&x1, &y1, &x2, &y2, &x3, &y3);
a = 2 * (x1 -x2);
b = 2 * (y1 -y2);
c = 2 * (x1 ... | /usr/bin/ld: /tmp/ccs8FBPB.o: in function `main':
main.c:(.text+0x22b): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
|
s677445629 | p00010 | C | #include <stdio.h>
#include <math.h>
int main(void)
{
int n;
int i;
double x1, y1, x2, y2, x3, y3;
double a, b, c, d, e, f;
double px, py, r;
scanf("%d",&n);
for(int i=0; i<n; i++)
{
scanf("%lf%lf%lf%lf%lf%lf",&x1, &y1, &x2, &y2, &x3, &y3);
a = 2 * (x1 -x2);
b = 2 * (y1 -y2);
c = 2 * (x1 ... | /usr/bin/ld: /tmp/cccXuRB2.o: in function `main':
main.c:(.text+0x22b): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
|
s410975642 | p00010 | C | #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
double a,b,c,d,e,f,x,y,A,B,C,s,r;
int n;
cin >> n ;
for(int i=0;i<n;i++){
cin >> a >> b >> c >> d >> e >> f;
C = (a-c)*(a-c)+(b-d)*(b-d);
A = (c-e)*(c-e)+(d-f)*(d-f);
B = (e-a)*(e-a)+(f-b)*(f-b);
s = 2*(A*B+B*C+C*A)-(A*A... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s458028865 | p00010 | C | #include<stdio.h>
#include<math.h>
int main(void){
int n, i;
double minx, miny, xy1, xy2, xy3, x1, x2, x3, y1, y2, y3, X, Y, r;
scanf("%d", &n);
for ( i = 0; i < n; i++ ) {
scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3);
minx = x1;
miny = y1;
if ( x2 < minx ) minx = x... | main.c: In function 'main':
main.c:35:13: error: expected ';' before '}' token
35 | Y++
| ^
| ;
36 | }
| ~
|
s589137415 | p00010 | C | #include <stdio.h>
#include <math.h>
int main(void){
double Px,Py,r;
double x1,y1,x2,y2,x3,y3;
double a1,b1,c1,a2,b2,c2;
int n,i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
a1=2*(x1-x2);
b1=2*(y1-y2);
c1=(x1*x1*)... | main.c: In function 'main':
main.c:16:18: error: expected expression before ')' token
16 | c1=(x1*x1*)-(x2*x2)+(y1*y1)-(y2*y2);
| ^
main.c:19:18: error: expected expression before ')' token
19 | c2=(x1*x1*)-(x3*x3)+(y1*y1)-(y3*y3);
| ^
|
s141925855 | p00010 | C | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for(int i = 0; i < n; i++) {
double x1 = sc.nextDouble();
double y1 = sc.nextDouble();
double x2 = sc.nextDou... | main.c:1:1: error: unknown type name 'import'
1 | import java.util.Scanner;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.util.Scanner;
| ^
main.c:3:1: error: unknown type name 'public'
3 | public class Main {
| ^~... |
s672591750 | p00010 | C | #include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
using namespace std;
#define N 10000
#define INF 200000000
int main()
{
int n;
vector<double> x(3), y(3), x2(3), y2(3);
cin >> n;
for(int p=0; p<n; p++)
{
cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s217252806 | p00010 | C | #include<complex>
#define F(a,b,c) acos((b*b+c*c-a*a)/2/b/c)
void main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(C,A,B)),v=s+t+u;p... | main.c:1:9: fatal error: complex: No such file or directory
1 | #include<complex>
| ^~~~~~~~~
compilation terminated.
|
s577080487 | p00010 | C | #include<complex>
#include<stdio.h>
#define F(a,b,c) acos((b*b+c*c-a*a)/2/b/c)
int main(){typedef double D;int n;D d,e,f,g,h,i;for(scanf("%d",&n);n--;){scanf("%lf%lf%lf%lf%lf%lf",&d,&g,&e,&h,&f,&i);std::complex<D> a(d,g),b(e,h),c(f,i);D A=abs(b-c),B=abs(c-a),C=abs(a-b),L=F(A,B,C),s=sin(2*L),t=sin(2*F(B,C,A)),u=sin(2*F(... | main.c:1:9: fatal error: complex: No such file or directory
1 | #include<complex>
| ^~~~~~~~~
compilation terminated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.