submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s803615817
|
p00079
|
C++
|
#include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cctype>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(int)(b);++i)
#define rep(i,n) FOR(i,0,n)
vector<double> x, y;
double __pow(double a) {
return a * a;
}
int main() {
double px,py;
while(~scanf("%lf,%lf",&px,&py)) {
x.push_back(px); y.push_back(py);
}
int n = x.size();
double s = 0;
FOR(i,2,n) {
double a = sqrt(__pow(x[0]-x[i-1]) + __pow(y[0]-y[i-1]));
double b = sqrt(__pow(x[0]-x[i]) + __pow(y[0]-y[i]));
double c = sqrt(__pow(x[i-1]-x[i]) + __pow(y[i-1]-y[i]));
double z = (a+b+c) / 2.0;
s += sqrt(z * (z-a) * (z-b) * (z-c));
}
printf("%.15lf\n", s);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:28:20: error: 'sqrt' was not declared in this scope
28 | double a = sqrt(__pow(x[0]-x[i-1]) + __pow(y[0]-y[i-1]));
| ^~~~
|
s401098452
|
p00079
|
C++
|
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cctype>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
#include <complex>
#include <utility>
#include <numeric>
using namespace std;
typedef pair<double,double> P;
int main(){
P p[50];
char c;
double ans=0;
int n=1;
while(cin>>p[n].first>>c>>p[n].second,p[n])
n++;
p[n].first=p[1].first;
p[n].second=p[1].second;
for(int i=1;i<=n;i++){
double s=0;
s=(p[i].first-p[i+1].first)*(p[i].second+p[i+1].second);
ans+=s;
}
printf("%.6f\n",abs(ans)/2);
}
|
a.cc: In function 'int main()':
a.cc:31:46: error: could not convert '(((void)(& std::operator>><char, char_traits<char> >((* & std::cin.std::basic_istream<char>::operator>>(p[n].std::pair<double, double>::first)), c))->std::basic_istream<char>::operator>>(p[n].std::pair<double, double>::second)), p[n])' from 'P' {aka 'std::pair<double, double>'} to 'bool'
31 | while(cin>>p[n].first>>c>>p[n].second,p[n])
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
| |
| P {aka std::pair<double, double>}
|
s065390158
|
p00079
|
C++
|
#include <iostream>
#include <cmath>
#include <complex>
using namespace std;
int main(){
int n=0;
double x,y;
complex<double> v[20];
while(cin >> x >> y){
v[n]=complex<double>(x,y);
n++;
}
double s=0.0;
for(int i=1;(i+1)<n;i++){
s+=abs((conj(v[i]-v[0])*(v[i+1]-v[0])).imag())
}
cout << s << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:51: error: expected ';' before '}' token
17 | s+=abs((conj(v[i]-v[0])*(v[i+1]-v[0])).imag())
| ^
| ;
18 | }
| ~
|
s482053150
|
p00079
|
C++
|
#include<iostream>
#include<complex>
#include<cstdio>
#include<cmath>
typedef std::complex<double> point;
double CalS(double a,double b,double c){
double z=(a+b+c)/2;
return sqrt(z*(z-a)*(z-b)*(z-c));
}
int main(void){
point p[20];
int n=0;
double x,y;
while(scanf("%lf%lf",&x,&y)!=EOF)
p[n++]=point(x,y);
double sum=0;
for(int i=1;i<n-1;i++){
sum+=CalS(std::abs(p[0]-p[i]),std::abs(p[0]-p[i+1]),std::abs(p[i],p[i+1]));
}
printf("%lf\n",sum);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:69: error: no matching function for call to 'abs(point&, point&)'
21 | sum+=CalS(std::abs(p[0]-p[i]),std::abs(p[0]-p[i+1]),std::abs(p[i],p[i+1]));
| ~~~~~~~~^~~~~~~~~~~~~
In file included from a.cc:2:
/usr/include/c++/14/complex:892:5: note: candidate: 'template<class _Tp> _Tp std::abs(const complex<_Tp>&)'
892 | abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
| ^~~
/usr/include/c++/14/complex:892:5: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_conversions.h:43,
from /usr/include/c++/14/bits/basic_string.h:4154,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
/usr/include/stdlib.h:980:12: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate expects 1 argument, 2 provided
|
s117380564
|
p00079
|
C++
|
#include<iostream>
#include<complex>
#include<cstdio>
#include<cmath>
typedef std::complex<double> point;
double CalS(double a,double b,double c){
double z=(a+b+c)/2;
return sqrt(z*(z-a)*(z-b)*(z-c));
}
int main(void){
point p[20];
int n=0;
double x,y;
while(scanf("%lf%lf",&x,&y)!=EOF)
p[n++]=point(x,y);
double sum=0;
for(int i=1;i<n-1;i++){
sum+=CalS(std::abs(p[0]-p[i]),std::abs(p[0]-p[i+1]),std::abs(p[i],p[i+1]));
}
printf("%lf\n",sum);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:69: error: no matching function for call to 'abs(point&, point&)'
21 | sum+=CalS(std::abs(p[0]-p[i]),std::abs(p[0]-p[i+1]),std::abs(p[i],p[i+1]));
| ~~~~~~~~^~~~~~~~~~~~~
In file included from a.cc:2:
/usr/include/c++/14/complex:892:5: note: candidate: 'template<class _Tp> _Tp std::abs(const complex<_Tp>&)'
892 | abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
| ^~~
/usr/include/c++/14/complex:892:5: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_conversions.h:43,
from /usr/include/c++/14/bits/basic_string.h:4154,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
/usr/include/stdlib.h:980:12: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate expects 1 argument, 2 provided
|
s369872003
|
p00079
|
C++
|
#include<stdio.h>
</stdio.h>
typedef struct vec vec;
struct vec {
double x, y;
};
/* 便利なコンストラクタ関数*/
static vec P(double x, double y) {
vec p = {x, y};
return p;
}
static vec add(vec a,vec b){
returnVec(a.x + b.y, a.y + b.y);
}
int main(void){
vec a = {1.0,2.0};
vec b = Vec{2.0,3.0};
vec c = add(a,b);
printf("(%f,%f)\n", c.x, c.y);
return 0;
}
|
a.cc:24:9: error: extended character is not valid in an identifier
24 | vec a = {1.0,2.0};
| ^
a.cc:3:1: error: expected unqualified-id before '<' token
3 | </stdio.h>
| ^
a.cc: In function 'vec add(vec, vec)':
a.cc:19:5: error: 'returnVec' was not declared in this scope
19 | returnVec(a.x + b.y, a.y + b.y);
| ^~~~~~~~~
a.cc:20:5: warning: no return statement in function returning non-void [-Wreturn-type]
20 | }
| ^
a.cc: In function 'int main()':
a.cc:25:13: error: 'Vec' was not declared in this scope; did you mean 'vec'?
25 | vec b = Vec{2.0,3.0};
| ^~~
| vec
a.cc:26:17: error: 'a' was not declared in this scope
26 | vec c = add(a,b);
| ^
|
s910165628
|
p00079
|
C++
|
#include<stdio.h>
</stdio.h>
typedef struct vec vec;
struct vec {
double x, y;
};
/* 便利なコンストラクタ関数*/
static vec P(double x, double y) {
vec p = {x, y};
return p;
}
static vec add(vec a,vec b){
return Vec(a.x + b.y, a.y + b.y);
}
static vec add(vec a,vec b){
return Vec(a.x - b.y, a.y - b.y);
}
static double norm(vec a){
return sqrt(a.x * b.y, a.y * b.x);
}
static double dot(vec a,vec b){
return a.x * b.y - a.y * b.x;
}
int main(void){
vec a = {1.0,2.0};
vec b = Vec{2.0,3.0};
vec c = add(a,b);
printf("(%f,%f)\n", c.x, c.y);
printf("dot %f\n",dot(a , b));
printf("ceoss %f\n", cross(a,b));
return 0;
}
|
a.cc:36:9: error: extended character is not valid in an identifier
36 | vec a = {1.0,2.0};
| ^
a.cc:3:1: error: expected unqualified-id before '<' token
3 | </stdio.h>
| ^
a.cc: In function 'vec add(vec, vec)':
a.cc:19:12: error: 'Vec' was not declared in this scope; did you mean 'vec'?
19 | return Vec(a.x + b.y, a.y + b.y);
| ^~~
| vec
a.cc: At global scope:
a.cc:22:12: error: redefinition of 'vec add(vec, vec)'
22 | static vec add(vec a,vec b){
| ^~~
a.cc:18:12: note: 'vec add(vec, vec)' previously defined here
18 | static vec add(vec a,vec b){
| ^~~
a.cc: In function 'vec add(vec, vec)':
a.cc:23:12: error: 'Vec' was not declared in this scope; did you mean 'vec'?
23 | return Vec(a.x - b.y, a.y - b.y);
| ^~~
| vec
a.cc: In function 'double norm(vec)':
a.cc:27:23: error: 'b' was not declared in this scope
27 | return sqrt(a.x * b.y, a.y * b.x);
| ^
a.cc:27:12: error: 'sqrt' was not declared in this scope
27 | return sqrt(a.x * b.y, a.y * b.x);
| ^~~~
a.cc: In function 'int main()':
a.cc:37:13: error: 'Vec' was not declared in this scope; did you mean 'vec'?
37 | vec b = Vec{2.0,3.0};
| ^~~
| vec
a.cc:38:17: error: 'a' was not declared in this scope
38 | vec c = add(a,b);
| ^
a.cc:41:26: error: 'cross' was not declared in this scope
41 | printf("ceoss %f\n", cross(a,b));
| ^~~~~
|
s942357634
|
p00079
|
C++
|
#include<stdio.h>
</stdio.h>
typedef struct vec vec;
struct vec {
double x, y;
};
/* 便利なコンストラクタ関数*/
static vec P(double x, double y) {
vec p = {x, y};
return p;
}
static vec add(vec a,vec b){
return Vec(a.x + b.y, a.y + b.y);
}
static vec add(vec a,vec b){
return Vec(a.x - b.y, a.y - b.y);
}
static double norm(vec a){
return sqrt(a.x * b.y, a.y * b.x);
}
static double dot(vec a,vec b){
return a.x * b.y - a.y * b.x;
}
int main(void){
vec a = {1.0,2.0};
vec b = Vec{2.0,3.0};
vec c = add(a,b);
printf("(%f,%f)\n", c.x, c.y);
printf("dot %f\n",dot(a , b));
printf("cross %f\n", cross(a,b));
return 0;
}
|
a.cc:36:9: error: extended character is not valid in an identifier
36 | vec a = {1.0,2.0};
| ^
a.cc:3:1: error: expected unqualified-id before '<' token
3 | </stdio.h>
| ^
a.cc: In function 'vec add(vec, vec)':
a.cc:19:12: error: 'Vec' was not declared in this scope; did you mean 'vec'?
19 | return Vec(a.x + b.y, a.y + b.y);
| ^~~
| vec
a.cc: At global scope:
a.cc:22:12: error: redefinition of 'vec add(vec, vec)'
22 | static vec add(vec a,vec b){
| ^~~
a.cc:18:12: note: 'vec add(vec, vec)' previously defined here
18 | static vec add(vec a,vec b){
| ^~~
a.cc: In function 'vec add(vec, vec)':
a.cc:23:12: error: 'Vec' was not declared in this scope; did you mean 'vec'?
23 | return Vec(a.x - b.y, a.y - b.y);
| ^~~
| vec
a.cc: In function 'double norm(vec)':
a.cc:27:23: error: 'b' was not declared in this scope
27 | return sqrt(a.x * b.y, a.y * b.x);
| ^
a.cc:27:12: error: 'sqrt' was not declared in this scope
27 | return sqrt(a.x * b.y, a.y * b.x);
| ^~~~
a.cc: In function 'int main()':
a.cc:37:13: error: 'Vec' was not declared in this scope; did you mean 'vec'?
37 | vec b = Vec{2.0,3.0};
| ^~~
| vec
a.cc:38:17: error: 'a' was not declared in this scope
38 | vec c = add(a,b);
| ^
a.cc:41:26: error: 'cross' was not declared in this scope
41 | printf("cross %f\n", cross(a,b));
| ^~~~~
|
s224072607
|
p00079
|
C++
|
#include<iostream>
#include<cmath>
using namespace std;
int main(){
double x[3],y[3],s=0,z,a,b,c;
char cc;
cin>>x[0]>>cc>>y[0]>>x[1]>>cc>>y[1];
for(int i=1;cin>>x[i%2+1]>>cc>>y[i%2+1];i++){
for(int i=0;i<3;i++)a[i] = sqrt((x[i%3]-x[(i+1)%3])*(x[i%3]-x[(i+1)%3])+(y[i%3]-y[(i+1)%3])*(y[i%3]-y[(i+1)%3]));
z=(a+b+c)/2;s += sqrt(z*(z-a)*(z-b)*(z-c));
}
printf("%.7f\n",s);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:26: error: invalid types 'double[int]' for array subscript
9 | for(int i=0;i<3;i++)a[i] = sqrt((x[i%3]-x[(i+1)%3])*(x[i%3]-x[(i+1)%3])+(y[i%3]-y[(i+1)%3])*(y[i%3]-y[(i+1)%3]));
| ^
|
s982478431
|
p00079
|
C++
|
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
int main(){
double x,y,sum=0;
double x1,x2,y1,y2,x3,y3,s,a,b,c;
scanf("%lf,%lf",&x1,&y1);
scanf("%lf,%lf",&x2,&y2);
while(scanf("%lf,%lf",&x3,&y3)!=EOF){
a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
b=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
c=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
s=(a+b+c)/2;
sum+=sqrt(s*(s-a)*(s-b)*(s-c));
x2=x3;y2=y3;
}
printf("%.6lf\n",sum);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:19: error: 'sqrt' was not declared in this scope
11 | a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
| ^~~~
|
s039897671
|
p00079
|
C++
|
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
public class Main {
int INF = 1 << 28;
void run() {
Scanner sc = new Scanner(System.in);
double s = 0;
double[] x = new double[3];
double[] y = new double[3];
String[] str = sc.next().split(",");
x[0] = Double.parseDouble(str[0]);
y[0] = Double.parseDouble(str[1]);
str = sc.next().split(",");
x[2] = x[1] = Double.parseDouble(str[0]);
y[2] = y[1] = Double.parseDouble(str[1]);
while(sc.hasNext()) {
x[1] = x[2];
y[1] = y[1];
str = sc.next().split(",");
x[2] = Double.parseDouble(str[0]);
y[2] = Double.parseDouble(str[1]);
s += area( line(x, y) );
}
System.out.println(s);
}
double[] line(double[] x, double[] y) {
double[] d = new double[3];
for(int i=0;i<3;i++) {
d[i] = sqrt( (x[i]-x[(i+1)%3])*(x[i]-x[(i+1)%3]) + (y[i]-y[(i+1)%3])*(y[i]-y[(i+1)%3]) );
}
return d;
}
double area(double[] d) {
double len = d[0] + d[1] + d[2];
return sqrt( len * (len-d[0]) * (len-d[1]) * (len-d[2]) );
}
public static void main(String[] args) {
new Main().run();
}
}
|
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.*;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import static java.lang.Math.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import static java.util.Arrays.*;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
6 | public class Main {
| ^~~~~~
|
s428464333
|
p00079
|
C++
|
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<cstdio>
using namespace std;
double EPS = 1e-10;
const double PI = acos(-1);
double add(double a, double b){
if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
return a+b;
}
struct point{
double x, y;
point(){}
point(double x,double y) : x(x) , y(y){}
point operator + (point p){
return point(add(x,p.x), add(y,p.y));
}
point operator - (point p){
return point(add(x,-p.x), add(y,-p.y));
}
point operator * (double d){
return point(x*d,y*d);
}
point operator / (double d){
return point(x/d,y/d);
}
bool operator == ( const point &p ) const {
return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
}
};
struct segment{
point a,b;
};
double dot(point a, point b) {
return (a.x * b.x + a.y * b.y);
}
double cross(point a, point b) {
return (a.x * b.y - a.y * b.x);
}
double vec_abs(point a){
return sqrt(a.x*a.x+a.y*a.y);
}
int ccw(point p0, point p1, point p2){
point a = p1 - p0;
point b = p2 - p0;
if(cross(a,b)>EPS)return +1;
if(cross(a,b)<EPS)return -1;
if(dot(a,b)<-EPS)return +2;
if(a.x*a.x+a.y*a.y<b.x*b.x+b.y*b.y)return -2;
return 0;
}
vector<segment> construct_edge(point* p, int n){
vector<segment>seg,seg2;
segment temp;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(i!=j){
temp.a=p[i];
temp.b=p[j];
seg.push_back(temp);
}
}
}
int t=seg.size();
for(int i=0;i<t;i++){
int fg=0;
for(int j=0;j<t;j++){
if(i!=j && vec_abs(seg[i].b-seg[j].a)<=EPS){
if(ccw(seg[i].a,seg[i].b,seg[j].b)==1){
fg=1;
break;
}
}
}
if(!fg)seg2.push_back(seg[i]);
}
return seg2;
}
|
/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
|
s270164787
|
p00079
|
C++
|
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<cstdio>
using namespace std;
double EPS = 1e-10;
const double PI = acos(-1);
double add(double a, double b){
if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
return a+b;
}
struct point{
double x, y;
point(){}
point(double x,double y) : x(x) , y(y){}
point operator + (point p){
return point(add(x,p.x), add(y,p.y));
}
point operator - (point p){
return point(add(x,-p.x), add(y,-p.y));
}
point operator * (double d){
return point(x*d,y*d);
}
point operator / (double d){
return point(x/d,y/d);
}
bool operator == ( const point &p ) const {
return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
}
};
struct segment{
point a,b;
};
double dot(point a, point b) {
return (a.x * b.x + a.y * b.y);
}
double cross(point a, point b) {
return (a.x * b.y - a.y * b.x);
}
double vec_abs(point a){
return sqrt(a.x*a.x+a.y*a.y);
}
double dist(point a,point b){
return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
}
int ccw(point p0, point p1, point p2){
point a = p1 - p0;
point b = p2 - p0;
if(cross(a,b)>EPS)return +1;
if(cross(a,b)<EPS)return -1;
if(dot(a,b)<-EPS)return +2;
if(a.x*a.x+a.y*a.y<b.x*b.x+b.y*b.y)return -2;
return 0;
}
vector<segment> construct_edge(point* p, int n){
vector<segment>seg,seg2;
segment temp;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(i!=j){
temp.a=p[i];
temp.b=p[j];
seg.push_back(temp);
}
}
}
int t=seg.size();
for(int i=0;i<t;i++){
int fg=0;
for(int j=0;j<t;j++){
if(i!=j && vec_abs(seg[i].b-seg[j].a)<=EPS){
if(ccw(seg[i].a,seg[i].b,seg[j].b)==1){
fg=1;
break;
}
}
}
if(!fg)seg2.push_back(seg[i]);
}
return seg2;
}
/*
double areaPol(point* ps, int n){
vector<segment>t=construct_edge(ps,n);
int tsz=t.size();
double area=0;
for(int i=0;i<tsz;i++){
area+=abs((t[i].a.x-t[i].b.x)*(t[i].a.y+t[i].b.y));
}
return abs(area)/2.0;
}
*/
/*
double areaPol(point* ps, int n){
vector<segment>t=construct_edge(ps,n);
int tsz=t.size();
point c;
c.x=c.y=0;
for(int i=0;i<n;i++)c=c+ps[i];
c=c/n;
double area=0;
for(int i=0;i<tsz;i++){
double a=dist(t[i].a,t[i].b);
double b=dist(t[i].a,c);
double d=dist(t[i].b,c);
double z=(a+b+d)/2;
area+=sqrt(z*(z-a)*(z-b)*(z-d));
}
return area;
}
*/
int main(void){
point p[21];
int n=0;
char k;
while(cin>>x>>k>>y){
if(cin.eof())break;
p[n].x = x;
p[n].y = y;
n++;
}
p[n]=p[0];
double s;
for(int j=0; j<n; j++)
s+=(p[j].x-p[j+1].x)*(p[j].y+p[j+1].y);
printf("%.6f\n",abs(s/2));
return 0;
}
|
a.cc: In function 'int main()':
a.cc:141:13: error: 'x' was not declared in this scope
141 | while(cin>>x>>k>>y){
| ^
a.cc:141:19: error: 'y' was not declared in this scope
141 | while(cin>>x>>k>>y){
| ^
|
s683346424
|
p00079
|
C++
|
#include <iostream>
#include <cmath>
int main() {
double cx[20], cy[20];
int i;
double a, b, c, z;
double S;
char dummy;
i=0;
while( std::cin >> cx[i] >> dummy >> cy[i] ) i++; i++;
S = 0.0;
for( int j=0; j<i-2; j++) {
a = sqrt( (cx[0]-cx[j+1])*(cx[0]-cx[j+1]) + (cy[0]-cy[j+1])*(cy[0]-cy[j+1]) );
b = sqrt( (cx[0]-cx[j+2])*(cx[0]-cx[j+2]) + (cy[0]-cy[j+2])*(cy[0]-cy[j+2]) );
c = sqrt( (cx[j+1]-cx[j+2])*(cx[j+1]-cx[j+2]) + (cy[j+1]-cy[j+2])*(cy[j+1]-cy[j+2]) );
z = ( a + b + c ) / 2.0;
S += sqrt( z*(z-a)*(z-b)*(z-c) );
}
std::cout << S << std::endl;
return 0;
|
a.cc: In function 'int main()':
a.cc:25:18: error: expected '}' at end of input
25 | return 0;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s387668505
|
p00079
|
C++
|
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
int main(){
char _;
int n=0;
double x[21],y[21];
while(cin>>x[n]>>_>>y[n])n++;
x[n]=x[0];y[n]=y[0];
double s=0;
for(int i=0;i<n;i++){
s += x[i]*y[i+1] - y[i]*x[i+1];
}
printf("%.6f\n",fabs(s/2));
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:25: error: 'fabs' was not declared in this scope; did you mean 'labs'?
17 | printf("%.6f\n",fabs(s/2));
| ^~~~
| labs
|
s643982428
|
p00079
|
C++
|
#include <iostream>
#include <vector>
vector<double> X,Y;
int main(){
double x,y,s=0;
int i,n=0;
char c;
while(std::cin>>x>>c>>y){
X.push_back(x);
Y.push_back(y);
n++;
}
X.push_back(X[0]);
Y.push_back(Y[0]);
for(i=0;i<n;i++)
s+=(X[i]*Y[i+1]-X[i+1]*Y[i]);
std::cout<<abs(s)/2<<endl;
}
|
a.cc:3:1: error: 'vector' does not name a type
3 | vector<double> X,Y;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:9:17: error: 'X' was not declared in this scope
9 | X.push_back(x);
| ^
a.cc:10:17: error: 'Y' was not declared in this scope
10 | Y.push_back(y);
| ^
a.cc:13:9: error: 'X' was not declared in this scope
13 | X.push_back(X[0]);
| ^
a.cc:14:9: error: 'Y' was not declared in this scope
14 | Y.push_back(Y[0]);
| ^
a.cc:17:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
17 | std::cout<<abs(s)/2<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s159444532
|
p00079
|
C++
|
#include <cstdlib>
#include <iostream>
#include <vector>
vector<double> X,Y;
int main(){
double x,y,s=0;
int i,n=0;
char c;
while(std::cin>>x>>c>>y){
X.push_back(x);
Y.push_back(y);
n++;
}
X.push_back(X[0]);
Y.push_back(Y[0]);
for(i=0;i<n;i++)
s+=(X[i]*Y[i+1]-X[i+1]*Y[i]);
std::cout<<abs(s)/2<<endl;
}
|
a.cc:4:1: error: 'vector' does not name a type
4 | vector<double> X,Y;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:10:17: error: 'X' was not declared in this scope
10 | X.push_back(x);
| ^
a.cc:11:17: error: 'Y' was not declared in this scope
11 | Y.push_back(y);
| ^
a.cc:14:9: error: 'X' was not declared in this scope
14 | X.push_back(X[0]);
| ^
a.cc:15:9: error: 'Y' was not declared in this scope
15 | Y.push_back(Y[0]);
| ^
a.cc:18:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
18 | std::cout<<abs(s)/2<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41,
from a.cc:2:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s193456646
|
p00079
|
C++
|
#include <cstdlib>
#include <cstdio>
#include <iostream>
int main(){
double x0,y0,x1,y1,x, y, s = 0;
char c;
std::cin >> x0 >> c >> y0;
x1 = x0; y1 = y0;
while(std::cin>>x>>c>>y){
s += x1*y - y1*x;
x1 = x;
y1 = y;
}
s += x1*y0 - y1*x0;
printf("%.6f\n", fabs(s / 2));
}
|
a.cc: In function 'int main()':
a.cc:15:34: error: 'fabs' was not declared in this scope; did you mean 'labs'?
15 | printf("%.6f\n", fabs(s / 2));
| ^~~~
| labs
|
s781772397
|
p00079
|
C++
|
#include <iostream>
int main(){
double x0,y0,x1,y1,x,y,s=0;
char c;
std::cin>>x0>>c>>y0;
x1=x0;y1=y0;
while(std::cin>>x>>c>>y){
s+=x1*y-y1*x;
x1=x;y1=y;
}
s+=x1*y0-y1*x0;
std::cout<<fabs((s<0?-s:s)/2)<<"\n";
}
|
a.cc: In function 'int main()':
a.cc:12:20: error: 'fabs' was not declared in this scope; did you mean 'labs'?
12 | std::cout<<fabs((s<0?-s:s)/2)<<"\n";
| ^~~~
| labs
|
s299788559
|
p00080
|
Java
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double q;
while ((q = in.nextDouble() >= 1) {
double xn = q / 2.0;
double checkVal = Math.pow(xn, 3.0) - q;
while (Math.abs(checkVal) >= 0.00001 * q) {
checkVal = Math.pow(xn, 3.0) - q;
xn = xn - (checkVal) / (Math.pow(xn, 2) * 3.0);
}
System.out.println(xn);
}
}
}
|
Main.java:7: error: ')' expected
while ((q = in.nextDouble() >= 1) {
^
1 error
|
s271097223
|
p00080
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
public class AOJ_0080
{
public static void main(String[] args) throws NumberFormatException, IOException
{
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
while (input.ready())
{
double num = Double.valueOf(input.readLine());
if (num < 0)
{
break;
}
MathContext mc = new MathContext(7, RoundingMode.HALF_DOWN);
BigDecimal ans = new BigDecimal(getThirdRoot(num, num / 2)).round(mc);
System.out.println(ans.toPlainString());
}
}
private static float getThirdRoot(double q, double x)
{
if (Math.abs(Math.pow(x, 3) - q) < 0.00001 * q)
{
return (float) x;
}
return getThirdRoot(q, (float) (x - ((Math.pow(x, 3) - q) / (3 * Math.pow(x, 2)))));
}
}
|
Main.java:8: error: class AOJ_0080 is public, should be declared in a file named AOJ_0080.java
public class AOJ_0080
^
1 error
|
s292449222
|
p00080
|
C
|
#include <stdio.h>
#include <math.h>
int main(void){
int q;
double xn,x1,k;
while(scanf("%d",&q)!=EOF){
if(q==-1) break;
else{
n=0;
x1=(double)q/2.0;
//printf("x1:%.6f\n",x1);
while(fabs(x1*x1*x1-q)>=(0.00001*q)){
k=(x1*x1*x1-q)/(3*x1*x1);
xn=x1-k;
x1=xn;
//printf("//%.6f\n",x1);
}
printf("%.6f\n",x1);
}
}
return 0;
}
|
main.c: In function 'main':
main.c:10:7: error: 'n' undeclared (first use in this function)
10 | n=0;
| ^
main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
|
s294331312
|
p00080
|
C
|
#include <stdio.h>double zenka(double q){ double x=q/2; while(x*x*x-q>=0.00001*q || x*x*x-q<=-0.00001*q) { x=x-((x*x*x)-q)/(3*x*x); } return x;}int main(void){ int q; while(1) { scanf("%d",&q); if(q==-1) break; else { printf("%.7f\n",zenka(q)); } } return 0;}
|
main.c:1:19: warning: extra tokens at end of #include directive
1 | #include <stdio.h>double zenka(double q){ double x=q/2; while(x*x*x-q>=0.00001*q || x*x*x-q<=-0.00001*q) { x=x-((x*x*x)-q)/(3*x*x); } return x;}int main(void){ int q; while(1) { scanf("%d",&q); if(q==-1) break; else { printf("%.7f\n",zenka(q)); } } return 0;}
| ^~~~~~
/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
|
s669958316
|
p00080
|
C
|
#include <stdio.h>double zenka(double q){ double x=q/2; while(x*x*x-q>=0.00001*q || x*x*x-q<=-0.00001*q) { x=x-((x*x*x)-q)/(3*x*x); } return x;}int main(void){ int q; while(1) { scanf("%d",&q); if(q==-1) break; else { printf("%.7f\n",zenka(q)); } } return 0;}
|
main.c:1:19: warning: extra tokens at end of #include directive
1 | #include <stdio.h>double zenka(double q){ double x=q/2; while(x*x*x-q>=0.00001*q || x*x*x-q<=-0.00001*q) { x=x-((x*x*x)-q)/(3*x*x); } return x;}int main(void){ int q; while(1) { scanf("%d",&q); if(q==-1) break; else { printf("%.7f\n",zenka(q)); } } return 0;}
| ^~~~~~
/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
|
s593920334
|
p00080
|
C
|
#include <stdio.h>
#include <math.h>
int main(void){
int q;
while(scanf("%d", &q)!= EOF) {
double x;
x=(double)q/2.0;
if(q>0) {
double xx;
while((fabs(x*x*x-q))>(0.00001*q)){
xx=x-((x*x*x-q)/(3*x*x));
x=xx;
}
printf("%.6f\n",xx);
}
}
return 0;
}
三乗根の問題です。
PAIZAでは実行できますが、AOJではWrong Answerとなってしまいます。
|
main.c:20:17: error: stray '\343' in program
20 | <U+4E09><U+4E57><U+6839><U+306E><U+554F><U+984C><U+3067><U+3059><U+3002>
| ^~~~~~~~
main.c:20:1: error: unknown type name '\U00004e09\U00004e57\U00006839\U0000306e\U0000554f\U0000984c\U00003067\U00003059'
20 | 三乗根の問題です。
| ^~~~~~~~~~~~~~~~
main.c:21:24: error: stray '\343' in program
21 | PAIZA<U+3067><U+306F><U+5B9F><U+884C><U+3067><U+304D><U+307E><U+3059><U+304C><U+3001>AOJ<U+3067><U+306F>Wrong<U+3000>Answer<U+3068><U+306A><U+3063><U+3066><U+3057><U+307E><U+3044><U+307E><U+3059><U+3002>
| ^~~~~~~~
main.c:21:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'AOJ\U00003067\U0000306fWrong'
21 | PAIZAでは実行できますが、AOJではWrong Answerとなってしまいます。
| ^~~~~~~~~~~~
main.c:21:38: error: stray '\343' in program
21 | PAIZA<U+3067><U+306F><U+5B9F><U+884C><U+3067><U+304D><U+307E><U+3059><U+304C><U+3001>AOJ<U+3067><U+306F>Wrong<U+3000>Answer<U+3068><U+306A><U+3063><U+3066><U+3057><U+307E><U+3044><U+307E><U+3059><U+3002>
| ^~~~~~~~
main.c:21:26: error: unknown type name 'AOJ\U00003067\U0000306fWrong'
21 | PAIZAでは実行できますが、AOJではWrong Answerとなってしまいます。
| ^~~~~~~~~~~~
main.c:21:64: error: stray '\343' in program
21 | PAIZA<U+3067><U+306F><U+5B9F><U+884C><U+3067><U+304D><U+307E><U+3059><U+304C><U+3001>AOJ<U+3067><U+306F>Wrong<U+3000>Answer<U+3068><U+306A><U+3063><U+3066><U+3057><U+307E><U+3044><U+307E><U+3059><U+3002>
| ^~~~~~~~
|
s220731298
|
p00080
|
C
|
#include <stdio.h>
#include <math.h>
int main(void){
int q;
while(scanf("%d", &q)!= EOF) {
double x;
x=(double)q/2;
if(q>0) {
double xx;
while((fabs(x*x*x-q))>(0.00001*q)){
xx=x-((x*x*x-q)/(3*x*x));
x=xx;
}
printf("%.6f\n",xx);
}
}
return 0;
}
三乗根の問題です。
PAIZAでは実行できますが、AOJではWrong Answerとなってしまいます。
|
main.c:20:17: error: stray '\343' in program
20 | <U+4E09><U+4E57><U+6839><U+306E><U+554F><U+984C><U+3067><U+3059><U+3002>
| ^~~~~~~~
main.c:20:1: error: unknown type name '\U00004e09\U00004e57\U00006839\U0000306e\U0000554f\U0000984c\U00003067\U00003059'
20 | 三乗根の問題です。
| ^~~~~~~~~~~~~~~~
main.c:21:24: error: stray '\343' in program
21 | PAIZA<U+3067><U+306F><U+5B9F><U+884C><U+3067><U+304D><U+307E><U+3059><U+304C><U+3001>AOJ<U+3067><U+306F>Wrong<U+3000>Answer<U+3068><U+306A><U+3063><U+3066><U+3057><U+307E><U+3044><U+307E><U+3059><U+3002>
| ^~~~~~~~
main.c:21:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'AOJ\U00003067\U0000306fWrong'
21 | PAIZAでは実行できますが、AOJではWrong Answerとなってしまいます。
| ^~~~~~~~~~~~
main.c:21:38: error: stray '\343' in program
21 | PAIZA<U+3067><U+306F><U+5B9F><U+884C><U+3067><U+304D><U+307E><U+3059><U+304C><U+3001>AOJ<U+3067><U+306F>Wrong<U+3000>Answer<U+3068><U+306A><U+3063><U+3066><U+3057><U+307E><U+3044><U+307E><U+3059><U+3002>
| ^~~~~~~~
main.c:21:26: error: unknown type name 'AOJ\U00003067\U0000306fWrong'
21 | PAIZAでは実行できますが、AOJではWrong Answerとなってしまいます。
| ^~~~~~~~~~~~
main.c:21:64: error: stray '\343' in program
21 | PAIZA<U+3067><U+306F><U+5B9F><U+884C><U+3067><U+304D><U+307E><U+3059><U+304C><U+3001>AOJ<U+3067><U+306F>Wrong<U+3000>Answer<U+3068><U+306A><U+3063><U+3066><U+3057><U+307E><U+3044><U+307E><U+3059><U+3002>
| ^~~~~~~~
|
s373706934
|
p00080
|
C
|
#include <stdio.h>
#include <math.h>
int main(void){
double q;
while(scanf("%d", &q)!= EOF&&q=-1) {
double x;
x=q/2;
if(q>0) {
double xx;
while((fabs(x*x*x-q))>(0.00001*q)){
xx=x-((x*x*x-q)/(3*x*x));
x=xx;
}
printf("%.6f\n",xx);
}
}
return 0;
}
|
main.c: In function 'main':
main.c:5:34: error: lvalue required as left operand of assignment
5 | while(scanf("%d", &q)!= EOF&&q=-1) {
| ^
|
s256087712
|
p00080
|
C
|
#include <stdio.h>
#include <math.h>int main(void){
double q;
while(scanf("%lf", &q)!= EOF && q != -1) {
double x, a;
x=q/2;
while(1){
if(fabs(x*x*x-q)<0.00001*q) break;
x=x-((x*x*x-q)/(3*x*x));
x = x;
}
printf("%.7f\n",x);
}
return 0;
}
|
main.c:2:18: warning: extra tokens at end of #include directive
2 | #include <math.h>int main(void){
| ^~~
main.c:4:5: error: expected identifier or '(' before 'while'
4 | while(scanf("%lf", &q)!= EOF && q != -1) {
| ^~~~~
main.c:15:1: error: expected identifier or '(' before 'return'
15 | return 0;
| ^~~~~~
main.c:16:1: error: expected identifier or '(' before '}' token
16 | }
| ^
|
s389581684
|
p00080
|
C
|
#include <stdio.h>
#include <math.h>int main(void){
double q;
while(scanf("%lf", &q)!= EOF && q != -1) {
double x, a;
x=q/2;
while(1){
if(fabs(x*x*x-q)<0.00001*q) break;
x=x-((x*x*x-q)/(3*x*x));
x = x;
}
printf("%.7f\n",x);
}
return 0;
}
|
main.c:2:18: warning: extra tokens at end of #include directive
2 | #include <math.h>int main(void){
| ^~~
main.c:4:1: error: expected identifier or '(' before 'while'
4 | while(scanf("%lf", &q)!= EOF && q != -1) {
| ^~~~~
main.c:14:1: error: expected identifier or '(' before 'return'
14 | return 0;
| ^~~~~~
main.c:15:1: error: expected identifier or '(' before '}' token
15 | }
| ^
|
s188222983
|
p00080
|
C
|
#include <stdio.h>#include <math.h>int main(void){ double q; while(scanf("%lf", &q)!= EOF && q != -1) { double x, a; x=q/2; while(1){ if(fabs(x*x*x-q)<0.00001*q) break; x=x-((x*x*x-q)/(3*x*x)); x = x; } printf("%.7f\n",x); } return 0; }
|
main.c:1:19: warning: extra tokens at end of #include directive
1 | #include <stdio.h>#include <math.h>int main(void){ double q; while(scanf("%lf", &q)!= EOF && q != -1) { double x, a; x=q/2; while(1){ if(fabs(x*x*x-q)<0.00001*q) break; x=x-((x*x*x-q)/(3*x*x)); x = x; } printf("%.7f\n",x); } return 0; }
| ^
/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
|
s365214031
|
p00080
|
C
|
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
using namespace std;
int main()
{
while ( true )
{
int q;
cin >> q;
if ( q == -1 )
{
break;
}
double x = q / 2.0;
while ( q * 0.00001 < abs( pow( x, 3 ) - q ) )
{
x -= ( ( pow( x, 3 ) - q ) / ( 3 * pow( x, 2 ) ) );
}
printf("%.6lf\n", x );
}
return 0;
}
|
main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s139283534
|
p00080
|
C
|
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[])
{
int n;
double ans, limit;
while (1) {
scanf("%d", &n);
if (n == -1) break;
limit = 0.00001 * n;
ans = double(n/2);
while (1) {
ans = ans - (ans * ans * ans - n) / (3 * ans * ans);
if ((ans * ans * ans) - n < limit) break;
}
printf("%f\n", ans);
}
return 0;
}
|
main.c: In function 'main':
main.c:13:11: error: expected expression before 'double'
13 | ans = double(n/2);
| ^~~~~~
|
s507471775
|
p00080
|
C
|
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int n;
double ans, limit;
while (1) {
scanf("%d", &n);
if (n == -1) break;
limit = 0.00001 * n;
ans = double(n/2);
while (1) {
ans = ans - (ans * ans * ans - n) / (3 * ans * ans);
if ((ans * ans * ans) - n < limit) break;
}
printf("%f\n", ans);
}
return 0;
}
|
main.c: In function 'main':
main.c:13:11: error: expected expression before 'double'
13 | ans = double(n/2);
| ^~~~~~
|
s886863825
|
p00080
|
C
|
while(n=gets.to_i)!=-1
p n.cbrt;end
|
main.c:1:1: error: expected identifier or '(' before 'while'
1 | while(n=gets.to_i)!=-1
| ^~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
2 | p n.cbrt;end
| ^
|
s283867750
|
p00080
|
C++
|
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
double a,x;
while(cin>>a){
if(a==-1)
break;
x=a/2;
while(1){
x=x-(x*x*x-a)/(3*x*x);
if(fabs(x*x*x-a)<0.00001*a)
break;
}
printf("%.6f\n",x);
}
}
|
a.cc: In function 'int main()':
a.cc:13:16: error: 'fabs' was not declared in this scope; did you mean 'labs'?
13 | if(fabs(x*x*x-a)<0.00001*a)
| ^~~~
| labs
|
s272819162
|
p00080
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int a;
double b,c;
while(cin>>a&&a!=-1){
b=a
c=b/2;
while(fabs(c*c*c-b)>=b*1e-5){
c=c-(c*c*c-b)/(3*c*c);
}
cout<<c<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before 'c'
8 | b=a
| ^
| ;
9 | c=b/2;
| ~
|
s365597094
|
p00080
|
C++
|
import sys
for e in sys.stdin:print(float(e)**(1/3))
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
####################################################
########################################################################################################
####################################################
####################################################
########################################################################################################v
############################################################################################################################################################
####################################################
####################################################
####################################################
########################################################################################################v
vv####################################################v
|
a.cc:5:1: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:3: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:5: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:7: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:9: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:11: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:13: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:15: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:17: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:19: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:21: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:23: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:25: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:27: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:29: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:31: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:33: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:35: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:37: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:39: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:41: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:43: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:45: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:47: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:49: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:5:51: error: stray '##' in program
5 | ####################################################
| ^~
a.cc:6:1: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:3: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:5: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:7: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:9: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:11: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:13: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:15: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:17: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:19: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:21: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:23: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:25: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:27: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:29: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:31: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:33: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:35: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:37: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:39: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:41: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:43: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:45: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:47: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:49: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:6:51: error: stray '##' in program
6 | ####################################################
| ^~
a.cc:7:1: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:3: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:5: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:7: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:9: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:11: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:13: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:15: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:17: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:19: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:21: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:23: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:25: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:27: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:29: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:31: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:33: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:35: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:37: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:39: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:41: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:43: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:45: error: stray '##' in program
7 | ####################################################
| ^~
a.cc:7:47: error: stray '##' in program
7 | ##
|
s082041137
|
p00080
|
C++
|
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;a++)
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
ld abs(long double A) {
return A<0.0 ? -A : A;
}
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
ld a = 0;
while (true) {
cin >> a;
if (a == -1) { break; }
ld x = (ld)a / (ld)2.00000000000000000000000;
while ((ld)abs((ld)x *(ld)x * (ld)x - (ld)a) >=(ld) 0.00001*(ld)a) {
x =(ld) x -(ld) (x * x * x - (ld)a) / (ld)((ld)3.00 * x * x);
}
printf("%.6lf\n", x);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:44:31: error: call of overloaded 'abs(long double)' is ambiguous
44 | while ((ld)abs((ld)x *(ld)x * (ld)x - (ld)a) >=(ld) 0.00001*(ld)a) {
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/bits/stl_algo.h:71,
from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
a.cc:32:4: note: candidate: 'long double abs(long double)'
32 | ld abs(long double A) {
| ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
|
s644446282
|
p00080
|
C++
|
#include <iostream>
using namespace std;
int main(){
int q;
while(cin>>q,q!=-1){
double x=q/2.0;
while(fabs(x*x*x-q)>=0.00001*q)x-=(x*x*x-q)/(3*x*x);
printf("%.6f\n",x);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:15: error: 'fabs' was not declared in this scope; did you mean 'labs'?
8 | while(fabs(x*x*x-q)>=0.00001*q)x-=(x*x*x-q)/(3*x*x);
| ^~~~
| labs
|
s114524007
|
p00080
|
C++
|
#include <stdio.h>double zenka(double q){ double x=q/2; while(x*x*x-q>=0.00001*q || x*x*x-q<=-0.00001*q) { x=x-((x*x*x)-q)/(3*x*x); } return x;}int main(void){ int q; while(1) { scanf("%d",&q); if(q==-1) break; else { printf("%.7f\n",zenka(q)); } } return 0;}
|
a.cc:1:26: warning: extra tokens at end of #include directive
1 | #include <stdio.h>double zenka(double q){ double x=q/2; while(x*x*x-q>=0.00001*q || x*x*x-q<=-0.00001*q) { x=x-((x*x*x)-q)/(3*x*x); } return x;}int main(void){ int q; while(1) { scanf("%d",&q); if(q==-1) break; else { printf("%.7f\n",zenka(q)); } } return 0;}
| ^~~~~
a.cc:1:10: fatal error: stdio.h>doubl: No such file or directory
1 | #include <stdio.h>double zenka(double q){ double x=q/2; while(x*x*x-q>=0.00001*q || x*x*x-q<=-0.00001*q) { x=x-((x*x*x)-q)/(3*x*x); } return x;}int main(void){ int q; while(1) { scanf("%d",&q); if(q==-1) break; else { printf("%.7f\n",zenka(q)); } } return 0;}
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s347890956
|
p00080
|
C++
|
#include<stdio.h>
double abs(double A){
return A<0.0?-A:A;
}
int main(){
int a; while(scanf("%d",&a),~a){ double p=(double)a/2.0;
while(1){ p=p-((p*p*p)-(double)a)/(3.0*p*p);
if(abs(p*p*p-(double)a)<(double)a*0.00001)break;
//printf("%.6lf\n",p); } printf("%.6lf\n",p);
}
}
|
a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:7:12: note: to match this '{'
7 | int main(){
| ^
|
s258974038
|
p00080
|
C++
|
#include<stdio.h>
double abs(double A){
return A<0.0?-A:A;
}
int main(){
int a;
while(scanf("%d",&a),~a){ double p=(double)a/2.0;
while(1){ p=p-((p*p*p)-(double)a)/(3.0*p*p);
if(abs(p*p*p-(double)a)<(double)a*0.00001)break;
//printf("%.6lf\n",p); } printf("%.6lf\n",p);
}
}
|
a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' at end of input
15 | }
| ^
a.cc:7:12: note: to match this '{'
7 | int main(){
| ^
|
s516196158
|
p00080
|
C++
|
#include<stdio.h>
double abs(double A){
return A<0.0?-A:A; }
int main()
{
int a;
while(scanf("%d",&a),~a){
double p=(double)a/2.0;
while(1){
p=p-((p*p*p)-(double)a)/(3.0*p*p);
if(abs(p*p*p-(double)a)<(double)a*0.00001)break;
//printf("%.6lf\n",p); } printf("%.6lf\n",p);
}
}
|
a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:9:1: note: to match this '{'
9 | {
| ^
|
s062734957
|
p00080
|
C++
|
include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
#define EPS 0.00001
void compute(int q){
double x = 1.0*q/2;
while(1){
if ( fabs(x*x*x - q) < EPS ) break;
x = x - (x*x*x - q)/(3*x*x);
}
printf("%.6lf\n", x);
}
main(){
int q;
while( cin >> q && q >= 0 ) compute(q);
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/cmath:45,
from a.cc:3:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
In file included from /usr/include/stdio.h:34,
from /usr/include/c++/14/cstdio:42,
from a.cc:2:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:65:
/usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type
125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
+++ |+#include <cstddef>
1 | // Types used in iterator implementation -*- C++ -*-
/usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type
214 | typedef ptrdiff_t difference_type;
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type
225 | typedef ptrdiff_t difference_type;
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
In file included from /usr/include/c++/14/bits/stl_algobase.h:66:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does not name a type
112 | ptrdiff_t
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
65 | #include <debug/assertions.h>
+++ |+#include <cstddef>
66 | #include <bits/stl_iterator_base_types.h>
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: error: 'ptrdiff_t' does not name a type
118 | ptrdiff_t
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
In file included from /usr/include/c++/14/bits/stl_iterator.h:67,
from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/ptr_traits.h:156:47: error: 'p
|
s637364759
|
p00080
|
C++
|
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
static const double EPS = 1e-5;
#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
double f(double x,double q){
return (x-(x*x*x-q)/(3*x*x));
}
double newton(double x,double q){
double nx = f(x,q);
if(abs(nx*nx*nx-q)<0.00001*q) return nx;
else return (newton(nx,q));
}
int main(void){
int q;
while(cin>>q){
if(q==-1) break;
printf("%lf\n",double(q,(double)1/3));
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:40:40: error: expression list treated as compound expression in functional cast [-fpermissive]
40 | printf("%lf\n",double(q,(double)1/3));
| ^
|
s216420962
|
p00080
|
C++
|
#include<cstdio>
#include<cmath>
int main(){
int q; x;
for(;scanf("%d",&q),~q;printf("%f\n",x))
for(x=q/2.;fabs(x*x*x-q)>1e-5*q;x-=(x*x*x-q)/3./x/x);
}
|
a.cc: In function 'int main()':
a.cc:4:16: error: 'x' was not declared in this scope
4 | int q; x;
| ^
|
s136749330
|
p00080
|
C++
|
#import<cstdio>
#import<cmath>
main(q){float x;for(;scanf("%d",&q),~q;printf("%f\n",x))for(x=q/2.;fabs(x*x*x-q)>1e-5*q;x-=(x*x*x-q)/(3*x*x));}
|
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<cstdio>
| ^~~~~~
a.cc:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
2 | #import<cmath>
| ^~~~~~
a.cc:3:5: error: expected constructor, destructor, or type conversion before '(' token
3 | main(q){float x;for(;scanf("%d",&q),~q;printf("%f\n",x))for(x=q/2.;fabs(x*x*x-q)>1e-5*q;x-=(x*x*x-q)/(3*x*x));}
| ^
|
s672510378
|
p00080
|
C++
|
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main(void)
{
int a;
while(cin>>a)
{
if(a==-1)break;
double q = (double)a;
double x = q/2;
while(abs(x*x*x-q)>=0.00001*q)
{
double y = x-(x*x*x-q)/(3*x*x);
x = y;
}
cout<<set.precision(6)<<fixed;
cout<<x<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:15: error: 'set' was not declared in this scope
18 | cout<<set.precision(6)<<fixed;
| ^~~
a.cc:4:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
3 | #include <iomanip>
+++ |+#include <set>
4 | using namespace std;
a.cc:19:16: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
19 | cout<<x<endl;
| ~~~~~~~^~~~~
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
19 | cout<<x<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
19 | cout<<x<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
19 | cout<<x<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
19 | cout<<x<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>'
19 | cout<<x<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
19 | cout<<x<endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
19 | cout<<x<endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: couldn't deduce template parameter '_CharT'
19 | cout<<x<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
19 | cout<<x<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
19 | cout<<x<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
19 | cout<<x<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:19:17: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::tuple<_UTypes ...>'
19 | cout<<x<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'const std::error_code&'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)'
507 | operator<(const error_condition& __lhs,
| ^~~~~~~~
/usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} to 'const std::error_condition&'
507 | operator<(const error_condition& __lhs,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
|
s848857344
|
p00080
|
C++
|
#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;
int main(void)
{
int a;
while(cin>>a)
{
if(a==-1)break;
double q = (double)a;
double x = q/2;
while(abs(x*x*x-q)>=0.00001*q)
{
double y = x-(x*x*x-q)/(3*x*x);
x = y;
}
printf(%.6lf/n,x);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:14: error: expected primary-expression before '%' token
18 | printf(%.6lf/n,x);
| ^
a.cc:18:15: error: unable to find numeric literal operator 'operator""lf'
18 | printf(%.6lf/n,x);
| ^~~~
a.cc:18:20: error: 'n' was not declared in this scope
18 | printf(%.6lf/n,x);
| ^
|
s472936705
|
p00080
|
C++
|
#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;
int main(void)
{
int a;
while(cin>>a)
{
if(a==-1)break;
double q = (double)a;
double x = q/2;
while(abs(x*x*x-q)>=0.00001*q)
{
double y = x-(x*x*x-q)/(3*x*x);
x = y;
}
printf(%.6lf\n,x);
}
return 0;
}
|
a.cc:18:19: error: stray '\' in program
18 | printf(%.6lf\n,x);
| ^
a.cc: In function 'int main()':
a.cc:18:14: error: expected primary-expression before '%' token
18 | printf(%.6lf\n,x);
| ^
a.cc:18:15: error: unable to find numeric literal operator 'operator""lf'
18 | printf(%.6lf\n,x);
| ^~~~
|
s852201695
|
p00080
|
C++
|
#include<iostream>
#include<cmath>
#include<iostream>
#include<cstdio>
using namespace std;
int main(void){
double q;
while(cin >> q,q!=-1){
double x=q/2;
while(abs(x*x*x-q)>0.00001*q)
x=x-(x*x*x-q)/(3*x*x);
printf("%.6lf\",x);
}
return 0;
}
|
a.cc:17:12: warning: missing terminating " character
17 | printf("%.6lf\",x);
| ^
a.cc:17:12: error: missing terminating " character
17 | printf("%.6lf\",x);
| ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:18:3: error: expected primary-expression before '}' token
18 | }
| ^
|
s979060445
|
p00080
|
C++
|
#include <iostream>
#include <cmath>
#include
using namespace std;
int main(){
int q;
while(cin>>q,q!=-1){
double x=q/2.0;
while(fabs(x*x*x-q)>=0.00001*q)x-=(x*x*x-q)/(3*x*x);
printf("%.6f\n", x);
}
return 0;
}
|
a.cc:3:9: error: #include expects "FILENAME" or <FILENAME>
3 | #include
| ^
|
s148507996
|
p00080
|
C++
|
#include <iostream>
#include <cmath>
#include <cstdio>
#include
using namespace std;
int main(){
int q;
while(cin>>q,q!=-1){
double x=q/2.0;
while(fabs(x*x*x-q)>=0.00001*q)x-=(x*x*x-q)/(3*x*x);
printf("%.6f\n", x);
}
return 0;
}
|
a.cc:4:9: error: #include expects "FILENAME" or <FILENAME>
4 | #include
| ^
|
s762362429
|
p00080
|
C++
|
#include <iostream>
#include <cmath>
#include <cstdio>
#include
using namespace std;
int main(){
int q;
while(cin>>q&&q!=-1){
double x=q/2.0;
while(fabs(x*x*x-q)>=0.00001*q)x-=(x*x*x-q)/(3*x*x);
printf("%.6f\n", x);
}
return 0;
}
|
a.cc:4:9: error: #include expects "FILENAME" or <FILENAME>
4 | #include
| ^
|
s217736167
|
p00080
|
C++
|
a#include <iostream>
#include <stdio.h>
#include <math.h>
#include <iomanip>
using namespace std;
double third_root(double xn, double q){
if((xn*xn*xn-q)>-0.00001 && (xn*xn*xn-q)<0.00001){
return xn;
}
xn = xn-((xn*xn*xn-q))/(3.0*xn*xn);
return third_root(xn, q);
}
int main(void)
{
long long int q;
while(cin>>q){
if(q==-1)break;
cout<<setprecision(7)<<third_root((double)q/2.0, (double)q)<<endl;;
}
}
|
a.cc:1:2: error: stray '#' in program
1 | a#include <iostream>
| ^
a.cc:1:1: error: 'a' does not name a type
1 | a#include <iostream>
| ^
In file included from /usr/include/math.h:275,
from /usr/include/c++/14/cmath:47,
from /usr/include/c++/14/math.h:36,
from a.cc:3:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mat
|
s278901483
|
p00080
|
C++
|
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,b,n) for(int i=b;i<n;i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
const int INF=1<<29;
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
int main(){
double q;
while( cin >> q){
if(q==-1) break;
double x = q / 2;
while(1){
x = x - (x*x*x - q)/(3*x*x);
if(abs(x*x*x-q) < 0.00001*q) break;
}
printf("%.6f\n",x);
}
return 0;
|
a.cc: In function 'int main()':
a.cc:51:18: error: expected '}' at end of input
51 | return 0;
| ^
a.cc:39:11: note: to match this '{'
39 | int main(){
| ^
|
s750580251
|
p00080
|
C++
|
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
typedef long long LL;
typedef double double DD;
int main(){
LL q;
DD x;
while(1){
cin>>q;
if(q==-1) break;
x=(DD)q/2;
while(abs(x*x*x-q)>=0.00001*q){
x=x-(x*x*x-q)/(3*x*x);
}
printf("%.6f\n",x);
}
}
|
a.cc:8:9: error: two or more data types in declaration of 'DD'
8 | typedef double double DD;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:13:9: error: 'DD' was not declared in this scope
13 | DD x;
| ^~
a.cc:20:17: error: 'x' was not declared in this scope
20 | x=(DD)q/2;
| ^
|
s846433270
|
p00080
|
C++
|
#include <iostream>
#include <deque>
#include <sstream>
#include <math.h>
using namespace std;
double distance(int r1, int r2)
{
double a = pow(abs(r1 - r2), 2);
double b = pow(r1 + r2, 2);
return sqrt(-a + b);
}
int main()
{
int box_width;
while (cin >> box_width) {
string line;
stringstream ss;
deque<int> cakes;
getline(cin, line);
ss << line;
int r;
while (ss >> r) {
cakes.push_back(r);
}
sort(cakes.begin(), cakes.end());
// for (int i = 0; i < cakes.size(); ++i) {
// cout << cakes[i] << endl;
// }
bool ok = false;
deque<int> save = cakes;
double length = cakes.front() * 2;
int prev = cakes.front();
cakes.pop_front();
bool front = false;
while (!cakes.empty()) {
int current;
if (front) {
current = cakes.front();
cakes.pop_front();
} else {
current = cakes.back();
cakes.pop_back();
}
length -= prev;
length += distance(prev, current);
length += current;
prev = current;
front = !front;
}
if (length <= box_width) {
ok = true;
}
// cout << length << ' ';
cakes = save;
length = cakes.back() * 2;
prev = cakes.back();
cakes.pop_back();
front = true;
while (!cakes.empty()) {
int current;
if (front) {
current = cakes.front();
cakes.pop_front();
} else {
current = cakes.back();
cakes.pop_back();
}
length -= prev;
length += distance(prev, current);
length += current;
prev = current;
front = !front;
}
if (length <= box_width) {
ok = true;
}
// cout << length << ' ';
if (ok) {
cout << "OK" << endl;
} else {
cout << "NA" << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:27:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
27 | sort(cakes.begin(), cakes.end());
| ^~~~
| sqrt
|
s356763286
|
p00080
|
C++
|
#include <iostream>
#include <deque>
#include <sstream>
#include <cmath>
using namespace std;
double distance(int r1, int r2)
{
double a = pow(abs(r1 - r2), 2);
double b = pow(r1 + r2, 2);
return sqrt(-a + b);
}
int main()
{
int box_width;
while (cin >> box_width) {
string line;
stringstream ss;
deque<int> cakes;
getline(cin, line);
ss << line;
int r;
while (ss >> r) {
cakes.push_back(r);
}
sort(cakes.begin(), cakes.end());
// for (int i = 0; i < cakes.size(); ++i) {
// cout << cakes[i] << endl;
// }
bool ok = false;
deque<int> save = cakes;
double length = cakes.front() * 2;
int prev = cakes.front();
cakes.pop_front();
bool front = false;
while (!cakes.empty()) {
int current;
if (front) {
current = cakes.front();
cakes.pop_front();
} else {
current = cakes.back();
cakes.pop_back();
}
length -= prev;
length += distance(prev, current);
length += current;
prev = current;
front = !front;
}
if (length <= box_width) {
ok = true;
}
// cout << length << ' ';
cakes = save;
length = cakes.back() * 2;
prev = cakes.back();
cakes.pop_back();
front = true;
while (!cakes.empty()) {
int current;
if (front) {
current = cakes.front();
cakes.pop_front();
} else {
current = cakes.back();
cakes.pop_back();
}
length -= prev;
length += distance(prev, current);
length += current;
prev = current;
front = !front;
}
if (length <= box_width) {
ok = true;
}
// cout << length << ' ';
if (ok) {
cout << "OK" << endl;
} else {
cout << "NA" << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:27:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
27 | sort(cakes.begin(), cakes.end());
| ^~~~
| sqrt
|
s556128926
|
p00080
|
C++
|
#include <cmath>
#include <iostream>
int main(){
int q;
while(std::cin>>q,q!=-1){
double x=q/2.0,a;
while(1){
a=x*x*x-q;
if(fabs(a)<1e-5*q)break;
x-=a/3/x/x;
}
printf "%.6f\n",x;
}
}
|
a.cc: In function 'int main()':
a.cc:12:23: error: expected ';' before string constant
12 | printf "%.6f\n",x;
| ^~~~~~~~~
| ;
|
s992908658
|
p00081
|
C
|
#include<stdio.h>
#include<math.h>
main(){
double x1,y1,x2,y2,xq,yq,ans_x,ans_y;
while(scanf("%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&xq,&yq)==6){
ans_x=(x2-xq)+x1;
ans_y=f(y2-y1)+y1;
printf("%lf %lf\n",ans_x,ans_y);
}
return 0;
}
|
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
4 | main(){
| ^~~~
main.c: In function 'main':
main.c:10:11: error: implicit declaration of function 'f' [-Wimplicit-function-declaration]
10 | ans_y=f(y2-y1)+y1;
| ^
|
s001641152
|
p00081
|
C
|
#include<stdio.h>
int main(void){
double x1,y1,x2,y2,xq,yq,x,y;
double a,b,A,B,cx,cy;
while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&xq,&yq)){
if(y1==0 && y2==0){
printf("%lf %lf\n",xq,-yq);
continue;
}
if(xx1==0 && x2==0){
printf("%lf %lf\n",-xq,yq);
continue;
}
a=(y2-y1)?(x2-x1)/(y2-y1):0;
b=y2-a*x2;
A=a?-1/a:0;
B=yq-A*xq;
cx=(a-A)?(B-b)/(a-A):0;
cy=A*cx+B;
x=2*cx-xq;
y=2*cy-yq;
printf("%lf %lf\n",x,y);
}
return 0;
}
|
main.c: In function 'main':
main.c:14:8: error: 'xx1' undeclared (first use in this function); did you mean 'x1'?
14 | if(xx1==0 && x2==0){
| ^~~
| x1
main.c:14:8: note: each undeclared identifier is reported only once for each function it appears in
|
s830366226
|
p00081
|
C
|
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(void){
double x1,y1,x2,y2,xq,yq,n,m,x,y;
while(scanf("%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&xq,&yq) != EOF){
if(x1 == x2){
printf("%lf %lf\n",xq+(x1-xq)*2,yq);
continue;
}
if(y1 == y2){
printf("%lf %lf\n",xq,yq+(y1-yq)*2);
continue;
}
m = (y2-y1)/(x2-x1);
n = -((x2-x1)/(y2-y1));
y = (2*m*xq+2*n+(m*m-1)*yq)/(m*m+1);
x = -m*y+xq+n*yq;
printf("%lf %lf\n",x,y);
}
}
|
main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s666824834
|
p00081
|
C
|
#include <cstdio>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> Vector;
double dot(const Vector &v1, const Vector &v2) {
return v1.real()*v2.real() + v1.imag()*v2.imag();
}
int main() {
double X1, Y1, X2, Y2, XQ, YQ;
while(scanf("%lf,%lf,%lf,%lf,%lf,%lf", &X1, &Y1, &X2, &Y2, &XQ, &YQ) != EOF) {
Vector p1(X1, Y1), p2(X2, Y2), q(XQ, YQ);
const double cosval = dot(q-p1, p2-p1) / abs(q-p1) / abs(p2-p1);
const double angle = acos(cosval);
Vector r(p1 + (q-p1)*polar(1.0, -angle*2));
printf("%.6f %.6f\n", r.real(), r.imag());
}
return 0;
}
|
main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s600612733
|
p00081
|
C++
|
#include <iostream>
#include <cstdio>
using namespace std;
#define rep2(x,from,to) for(int x = (from); x < (to); ++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
double x1,y1,x2,y2,qx,qy;
while(scanf("%lf,%lf,%lf,%lf,%lf,%lf", &x1,&y1,&x2,&y2,&qx,&qy) != EOF) {
qx -= x1, qy -= y1, x2 -= x1, y2 -= y1;
double cos = x2 / sqrt(x2*x2+y2*y2), sin = y2 / sqrt(x2*x2+y2*y2);
double bx = qx;
qx = cos*qx+sin*qy, qy = -sin*bx+cos*qy;
bx = qx;
qx = x1+cos*qx+sin*qy, qy = y1+sin*bx-cos*qy;
printf("%.6lf %.6lf\n", qx, qy);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:35: error: 'sqrt' was not declared in this scope
10 | double cos = x2 / sqrt(x2*x2+y2*y2), sin = y2 / sqrt(x2*x2+y2*y2);
| ^~~~
a.cc:12:29: error: 'sin' was not declared in this scope
12 | qx = cos*qx+sin*qy, qy = -sin*bx+cos*qy;
| ^~~
|
s282930392
|
p00081
|
C++
|
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
class Point {
public:
double x, y;
Point(double x = 0, double y = 0): x(x), y(y) {}
double norm(){return x*x + y*y;}
};
typedef Point Vector;
double dot(Vector a, Vector b){
return a.x*b.x + a.y*b.y;
}
struct Segment {
Point p1, p2;
};
Point project(Segment s, Point p){
Vector base = s.p2 - s.p1;
double r = dot(p-s.p1, base) / norm(base);
return s.p1 + base * r;
}
Point reflect(Segment s, Point p) {
return p + (project(s,p) - p) * 2.0;
}
int main(){
double x1,y1,x2,y2,xq,yq;
char c;
while(cin>>x1>>c>>y1>>c>>x2>>c>>y2>>c>>xq>>c>>yq){
Point P1(x1,y1);
Point P2(x2,y2);
Point q(xq,yq);
Segment s;
s.p1=P1,s.p2=P2;
Point p=project(s,q);
cout<<p.x<<" "<<p.y<<endl;
}
}
|
a.cc: In function 'Point project(Segment, Point)':
a.cc:25:24: error: no match for 'operator-' (operand types are 'Point' and 'Point')
25 | Vector base = s.p2 - s.p1;
| ~~~~ ^ ~~~~
| | |
| Point Point
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:25:28: note: 'Point' is not derived from 'const std::reverse_iterator<_Iterator>'
25 | Vector base = s.p2 - s.p1;
| ^~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:25:28: note: 'Point' is not derived from 'const std::move_iterator<_IteratorL>'
25 | Vector base = s.p2 - s.p1;
| ^~
a.cc:26:21: error: no match for 'operator-' (operand types are 'Point' and 'Point')
26 | double r = dot(p-s.p1, base) / norm(base);
| ~^~~~~
| | |
| | Point
| Point
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:26:24: note: 'Point' is not derived from 'const std::reverse_iterator<_Iterator>'
26 | double r = dot(p-s.p1, base) / norm(base);
| ^~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:26:24: note: 'Point' is not derived from 'const std::move_iterator<_IteratorL>'
26 | double r = dot(p-s.p1, base) / norm(base);
| ^~
a.cc:26:36: error: 'norm' was not declared in this scope
26 | double r = dot(p-s.p1, base) / norm(base);
| ^~~~
a.cc:27:24: error: no match for 'operator*' (operand types are 'Vector' {aka 'Point'} and 'double')
27 | return s.p1 + base * r;
| ~~~~ ^ ~
| | |
| | double
| Vector {aka Point}
a.cc: In function 'Point reflect(Segment, Point)':
a.cc:31:30: error: no match for 'operator-' (operand types are 'Point' and 'Point')
31 | return p + (project(s,p) - p) * 2.0;
| ~~~~~~~~~~~~ ^ ~
| | |
| Point Point
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:31:32: note: 'Point' is not derived from 'const std::reverse_iterator<_Iterator>'
31 | return p + (project(s,p) - p) * 2.0;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:31:32: note: 'Point' is not derived from 'const std::move_iterator<_IteratorL>'
31 | return p + (project(s,p) - p) * 2.0;
| ^
|
s126718862
|
p00081
|
C++
|
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
class Point {
public:
double x, y;
Point(double x = 0, double y = 0): x(x), y(y) {}
Point operator + (Point p) {return Point(x + p.x, y + p.y);}
Point operator - (Point p) {return Point(x - p.x, y - p.y);}
Point operator * (double a) {return Point(x * a, y * a);}
Point operator / (double a) {return Point(x / a, y / a);}
double abs() {return sqrt(norm());}
double norm(){return x*x + y*y;}
bool operator < (const Point &p) const {
return x != p.x ? x<p.x : y<p.y;
}
bool operator == (const Point &p) const {
return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
}
};
typedef Point Vector;
double dot(Vector a, Vector b){
return a.x*b.x + a.y*b.y;
}
struct Segment {
Point p1, p2;
};
Point project(Segment s, Point p){
Vector base = s.p2 - s.p1;
double r = dot(p-s.p1, base) / norm(base);
return s.p1 + base * r;
}
Point reflect(Segment s, Point p) {
return p + (project(s,p) - p) * 2.0;
}
int main(){
double x1,y1,x2,y2,xq,yq;
char c;
while(cin>>x1>>c>>y1>>c>>x2>>c>>y2>>c>>xq>>c>>yq){
Point P1(x1,y1);
Point P2(x2,y2);
Point q(xq,yq);
Segment s;
s.p1=P1,s.p2=P2;
Point p=project(s,q);
cout<<p.x<<" "<<p.y<<endl;
}
}
|
a.cc: In member function 'bool Point::operator==(const Point&) const':
a.cc:24:30: error: 'EPS' was not declared in this scope
24 | return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
| ^~~
a.cc: In function 'Point project(Segment, Point)':
a.cc:40:36: error: 'norm' was not declared in this scope
40 | double r = dot(p-s.p1, base) / norm(base);
| ^~~~
|
s494082984
|
p00081
|
C++
|
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#define EPS (1e-10)
class Point {
public:
double x, y;
Point(double x = 0, double y = 0): x(x), y(y) {}
Point operator + (Point p) {return Point(x + p.x, y + p.y);}
Point operator - (Point p) {return Point(x - p.x, y - p.y);}
Point operator * (double a) {return Point(x * a, y * a);}
Point operator / (double a) {return Point(x / a, y / a);}
double abs() {return sqrt(norm());}
double norm(){return x*x + y*y;}
bool operator < (const Point &p) const {
return x != p.x ? x<p.x : y<p.y;
}
bool operator == (const Point &p) const {
return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
}
};
typedef Point Vector;
double dot(Vector a, Vector b){
return a.x*b.x + a.y*b.y;
}
struct Segment {
Point p1, p2;
};
Point project(Segment s, Point p){
Vector base = s.p2 - s.p1;
double r = dot(p-s.p1, base) / norm(base);
return s.p1 + base * r;
}
Point reflect(Segment s, Point p) {
return p + (project(s,p) - p) * 2.0;
}
int main(){
double x1,y1,x2,y2,xq,yq;
char c;
while(cin>>x1>>c>>y1>>c>>x2>>c>>y2>>c>>xq>>c>>yq){
Point P1(x1,y1);
Point P2(x2,y2);
Point q(xq,yq);
Segment s;
s.p1=P1,s.p2=P2;
Point p=project(s,q);
cout<<p.x<<" "<<p.y<<endl;
}
}
|
a.cc: In function 'Point project(Segment, Point)':
a.cc:42:36: error: 'norm' was not declared in this scope
42 | double r = dot(p-s.p1, base) / norm(base);
| ^~~~
|
s545947018
|
p00081
|
C++
|
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#define EPS (1e-10)
class Point {
public:
double x, y;
Point(double x = 0, double y = 0): x(x), y(y) {}
Point operator + (Point p) {return Point(x + p.x, y + p.y);}
Point operator - (Point p) {return Point(x - p.x, y - p.y);}
Point operator * (double a) {return Point(x * a, y * a);}
Point operator / (double a) {return Point(x / a, y / a);}
double abs() {return sqrt(norm());}
double norm(){return x*x + y*y;}
bool operator < (const Point &p) const {
return x != p.x ? x<p.x : y<p.y;
}
bool operator == (const Point &p) const {
return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
}
};
typedef Point Vector;
double dot(Vector a, Vector b){
return a.x*b.x + a.y*b.y;
}
struct Segment {
Point p1, p2;
};
Point project(Segment s, Point p){
Vector base = s.p2 - s.p1;
double r = dot(p-s.p1, base) / norm(base);
return s.p1 + base * r;
}
Point reflect(Segment s, Point p) {
return p + (project(s,p) - p) * 2.0;
}
int main(){
double x1,y1,x2,y2,xq,yq;
char c;
while(cin>>x1>>c>>y1>>c>>x2>>c>>y2>>c>>xq>>c>>yq){
Point P1(x1,y1);
Point P2(x2,y2);
Point q(xq,yq);
Segment s;
s.p1=P1,s.p2=P2;
Point p=project(s,q);
cout<<p.x<<" "<<p.y<<endl;
}
}
|
a.cc: In function 'Point project(Segment, Point)':
a.cc:42:36: error: 'norm' was not declared in this scope
42 | double r = dot(p-s.p1, base) / norm(base);
| ^~~~
|
s115914718
|
p00081
|
C++
|
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#define EPS (1e-10)
class Point {
public:
double x, y;
Point(double x = 0, double y = 0): x(x), y(y) {}
Point operator + (Point p) {return Point(x + p.x, y + p.y);}
Point operator - (Point p) {return Point(x - p.x, y - p.y);}
Point operator * (double a) {return Point(x * a, y * a);}
Point operator / (double a) {return Point(x / a, y / a);}
double abs() {return sqrt(norm());}
bool operator < (const Point &p) const {
return x != p.x ? x<p.x : y<p.y;
}
bool operator == (const Point &p) const {
return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
}
};
double norm(Point p){return p.x*p.x + p.y*p.y;}
typedef Point Vector;
double dot(Vector a, Vector b){
return a.x*b.x + a.y*b.y;
}
struct Segment {
Point p1, p2;
};
Point project(Segment s, Point p){
Vector base = s.p2 - s.p1;
double r = dot(p-s.p1, base) / norm(base);
return s.p1 + base * r;
}
Point reflect(Segment s, Point p) {
return p + (project(s,p) - p) * 2.0;
}
int main(){
double x1,y1,x2,y2,xq,yq;
char c;
while(cin>>x1>>c>>y1>>c>>x2>>c>>y2>>c>>xq>>c>>yq){
Point P1(x1,y1);
Point P2(x2,y2);
Point q(xq,yq);
Segment s;
s.p1=P1,s.p2=P2;
Point p=project(s,q);
cout<<p.x<<" "<<p.y<<endl;
}
}
|
a.cc: In member function 'double Point::abs()':
a.cc:19:31: error: 'norm' was not declared in this scope
19 | double abs() {return sqrt(norm());}
| ^~~~
|
s952713591
|
p00081
|
C++
|
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
#define EPS (1e-10)
class Point {
public:
double x, y;
Point(double x = 0, double y = 0): x(x), y(y) {}
Point operator + (Point p) {return Point(x + p.x, y + p.y);}
Point operator - (Point p) {return Point(x - p.x, y - p.y);}
Point operator * (double a) {return Point(x * a, y * a);}
Point operator / (double a) {return Point(x / a, y / a);}
double norm(){return x*x + y*y;}
double abs() {return sqrt(norm());}
bool operator < (const Point &p) const {
return x != p.x ? x<p.x : y<p.y;
}
bool operator == (const Point &p) const {
return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
}
};
typedef Point Vector;
double dot(Vector a, Vector b){
return a.x*b.x + a.y*b.y;
}
struct Segment {
Point p1, p2;
};
Point project(Segment s, Point p){
Vector base = s.p2 - s.p1;
double r = dot(p-s.p1, base) / norm(base);
return s.p1 + base * r;
}
Point reflect(Segment s, Point p) {
return p + (project(s,p) - p) * 2.0;
}
int main(){
double x1,y1,x2,y2,xq,yq;
char c;
while(cin>>x1>>c>>y1>>c>>x2>>c>>y2>>c>>xq>>c>>yq){
Point P1(x1,y1);
Point P2(x2,y2);
Point q(xq,yq);
Segment s;
s.p1=P1,s.p2=P2;
Point p=project(s,q);
cout<<p.x<<" "<<p.y<<endl;
}
}
|
a.cc: In function 'Point project(Segment, Point)':
a.cc:43:36: error: 'norm' was not declared in this scope
43 | double r = dot(p-s.p1, base) / norm(base);
| ^~~~
|
s340097870
|
p00081
|
C++
|
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0081
//????§£?????????
//?????????????????????
#include<iostream>
#include<complex>
using namespace std;
typedef complex<double> xy_t;
double x[3], y[3];
double pro(xy_t a, xy_t b) {
return (conj(a)*b).real();
}
int main()
{
xy_t p[3], a, b, c, d;
char n;
while (cin >> x[0] >> n >> y[0] >> n >> x[1] >> n >> y[1]
>> n >> x[2] >> n >> y[2])
p[0] = xy_t(x[0], y[0]);
p[1] = xy_t(x[1], y[1]);
p[2] = xy_t(x[2], y[2]);
a = p[2] - p[0];
b = p[1] - p[0];
c = ((pro(a, b)*b) / norm(b)) + p[0];
d = c + c - p[2];
cout << d.real() <<" "<< d.imag() << endl;
}
return 0;
}
|
a.cc:29:5: error: expected unqualified-id before 'return'
29 | return 0;
| ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
30 | }
| ^
|
s523910010
|
p00081
|
C++
|
include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main(void){
int n;
double x1, x2, y1, y2, x3, y3, x, y, xx, yy;
cin >> n;
while(scanf("%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){
xx = (x2-x1)/(y2-y1);
yy = (y2-y1)/(x2-x1);
x = x1 + (y3-y1)*xx;
y = y1-yy*x1+yy*x3;
cout << x << y << endl;
}
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/cmath:45,
from a.cc:3:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
In file included from /usr/include/stdio.h:34,
from /usr/include/c++/14/cstdio:42,
from a.cc:2:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:65:
/usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type
125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
+++ |+#include <cstddef>
1 | // Types used in iterator implementation -*- C++ -*-
/usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type
214 | typedef ptrdiff_t difference_type;
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type
225 | typedef ptrdiff_t difference_type;
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
In file included from /usr/include/c++/14/bits/stl_algobase.h:66:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does not name a type
112 | ptrdiff_t
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
65 | #include <debug/assertions.h>
+++ |+#include <cstddef>
66 | #include <bits/stl_iterator_base_types.h>
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: error: 'ptrdiff_t' does not name a type
118 | ptrdiff_t
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
In file included from /usr/include/c++/14/bits/stl_iterator.h:67,
from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/ptr_traits.h:156:47: error: '
|
s244269348
|
p00081
|
C++
|
#include<math.h>
int main(void)
{
double x1,x2,xq,y1,y2,yq,a,b,c,xe,ye,t;
while(scanf("%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&xq,&yq)>0)
{
a = y1-y2;
b = x2-x1;
c = x1*(y2-y1)-y1*(x2-x1);
t=(a*xq+b*yq+c)/(a*a+b*b);
xe = xq-a*t;
ye = yq-b*t;
printf("%f %f\n", 2*xe-xq, 2*ye-yq);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:15: error: 'scanf' was not declared in this scope
5 | while(scanf("%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&xq,&yq)>0)
| ^~~~~
a.cc:13:17: error: 'printf' was not declared in this scope
13 | printf("%f %f\n", 2*xe-xq, 2*ye-yq);
| ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
1 | #include<math.h>
+++ |+#include <cstdio>
2 | int main(void)
|
s279239337
|
p00081
|
C++
|
#include <iostream>
#include <cmath>
#include <stdio.h>
#define INF 10000000
#include <stdio.h>
using namespace std;
void kaiten(double *a,double *b){
}
int main(){
double x1,x2,y1,y2,px,py;
char ch;
cin >> x1>>ch >> y1>>ch >> x2>>ch >> y2>>ch >> px >>ch>> py
double a = (y1 - y2)/(x1 - x2);
double m = y1 - a*x1;
double a1,a2,a3,a4;
if(fabs(a) > INF){
m = 0;
a1 = -1;
a2 = 0;
a3 = 0;
a4 = 1;
}else {
a1 = (1-a*a)/(a*a+1);
a2 = (2*a)/(a*a + 1);
a3 = (2*a)/(a*a + 1);
a4 = (a*a-1)/(a*a+1);
}
double ansx,ansy;
ansx = (px*a1 + px*a2) + m;
ansy = (py*a3 + py*a4) + m;
printf("%.6f %.6f\n",ansx,ansy);
}
|
a.cc: In function 'int main()':
a.cc:14:62: error: expected ';' before 'double'
14 | cin >> x1>>ch >> y1>>ch >> x2>>ch >> y2>>ch >> px >>ch>> py
| ^
| ;
15 |
16 | double a = (y1 - y2)/(x1 - x2);
| ~~~~~~
a.cc:17:19: error: 'a' was not declared in this scope
17 | double m = y1 - a*x1;
| ^
|
s742122895
|
p00082
|
Java
|
a.util.Scanner;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
while (scanner.hasNext()) {
StringTokenizer tokenizer = new StringTokenizer(scanner.nextLine()
);
int[] num = new int[8];
for (int i = 0; i < 8; i++) {
num[i] = Integer.parseInt(tokenizer.nextToken());
}
int[] a = { 1, 2, 1, 2, 1, 4, 1, 4 };
int[] b = { 0, 2, 6, 4, 1, 3, 7, 5 };
int min = Integer.MAX_VALUE;
int resut = 0;
for (int i = 0; i < 8; i++) {
int sum = 0;
for (int j = 0; j < 8; j++) {
int c = a[(j + b[i]) % 8];
sum += c - num[j] < 0 ? 0 : c - num[j];
}
if (min > sum) {
min = sum;
resut = i;
}
}
for (int i = 0; i < 8; i++) {
if (i != 0) {
System.out.print(" ");
}
System.out.print(a[(i + b[resut]) % 8]);
}
System.out.println();
}
}
}
|
Main.java:1: error: class, interface, enum, or record expected
a.util.Scanner;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.StringTokenizer;
^
2 errors
|
s829255938
|
p00082
|
Java
|
import java.util.*;
public class aoj0082 {
static final Scanner stdin = new Scanner(System.in);
static final int[] RIDE = {4, 1, 4, 1, 2, 1, 2, 1};
static final int[][] PAT = new int[8][8];
static final String[] sPAT = new String[8];
public static void main(String[] args) {
int[] c = new int[8];
for(int i = 0; i < 8; ++i){
StringBuilder s = new StringBuilder();
for(int j = 0; j < 8; ++j){
PAT[i][j] = RIDE[(i+j)%8];
s.append(' ');
s.append(PAT[i][j]);
}
sPAT[i] = s.substring(1);
}
while(stdin.hasNext()){
String minstr = sPAT[0];
int min = 0;
for(int i = 0; i < 8; ++i){
c[i] = stdin.nextInt();
min += (RIDE[i]-c[i] < 0 ? c[i] - RIDE[i] : 0);
}
for(int i = 1; i < 8; ++i){
int temp = 0;
for(int j = 0; j < 8; ++j)
temp += (PAT[i][j]-c[j] < 0 ? c[j] - PAT[i][j] : 0);
if(temp < min || (temp == min && sPAT[i].compareTo(minstr) < 0)){
minstr = sPAT[i];
min = temp;
}
}
System.out.println(minstr);
}
}
}
|
Main.java:2: error: class aoj0082 is public, should be declared in a file named aoj0082.java
public class aoj0082 {
^
1 error
|
s755066915
|
p00082
|
C
|
#include<stdio.h>
int main(){
int a[8],b[8]={1,4,1,2,1,2,1,4},x[8].z,mim;
while(scanf("%d %d %d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&a[4],&z[5],&a[6],&a[7])!=EOF){
c=8;
j=0;
mim=100000000;
whille(c--){
for(i=0;i<8;i++)
if(a[i]-b[i]>0)
x[c]+=a[i]-b[i];
z=a[7];
for(i=0;i<8;i++)
b[i+1]=b[i];
b[0]=z;
if(mim>x[c])
mim=x[c];
}
for(r=0;r<8;r++){
if(mim==x[r]){
f[j++]=a[7]+a[6]*10+a[5]*100+a[4]*1000+a[3]*10000+a[2]*100000+a[1]*1000000+a[0]*10000000;
if(j==1){
de=f[j-1];
for(q=0;q<8;q++)
u[q]=b[q];
}
else if(de>f[j-1]){
de=f[j-1];
for(q=0;q<8;q++)
u[q]=b[q];
}
}
z=a[7];
for(i=0;i<8;i++)
b[i+1]=b[i];
b[0]=z;
}
for(i=0;i<7;i++)
printf("%d ",b[i]);
printf("%d\n",b[7]);
}
return 0;
}
|
main.c: In function 'main':
main.c:3:53: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
3 | int a[8],b[8]={1,4,1,2,1,2,1,4},x[8].z,mim;
| ^
main.c:4:86: error: 'z' undeclared (first use in this function)
4 | while(scanf("%d %d %d %d %d %d %d %d",&a[0],&a[1],&a[2],&a[3],&a[4],&z[5],&a[6],&a[7])!=EOF){
| ^
main.c:4:86: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:25: error: 'c' undeclared (first use in this function)
5 | c=8;
| ^
main.c:6:25: error: 'j' undeclared (first use in this function)
6 | j=0;
| ^
main.c:7:25: error: 'mim' undeclared (first use in this function)
7 | mim=100000000;
| ^~~
main.c:8:25: error: implicit declaration of function 'whille' [-Wimplicit-function-declaration]
8 | whille(c--){
| ^~~~~~
main.c:8:36: error: expected ';' before '{' token
8 | whille(c--){
| ^
| ;
|
s851893652
|
p00082
|
C
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int c[]={4,1,4,1,2,1,2,1};
int pos[]={0,2,6,4,7,1,5,3};
int p[8],d=0,o,i,s,m,mp;
while(~scanf("%d",p+d)){
if(++d==8){
d=0;
m=0;
for(o=0;o<8;o++){
s=0;
for(i=0;i<8;i++){
s+=min(p[i],c[(pos[o]+i)%8]);
}
if(s>m){
m=s;
mp=pos[o];
}
}
for(i=0;i<8;i++){
printf("%d ",c[(mp+i)%8]);
}
puts("");
}
}
return 0;
}
|
main.c: In function 'main':
main.c:14:44: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
14 | s+=min(p[i],c[(pos[o]+i)%8]);
| ^~~
| main
|
s836957072
|
p00082
|
C
|
#include<stdio.h>
int main(void){
int i,j;
int p[8];
int c[16];
int curS,minS,minP;
for(i=0;i<16;i++)
if(i%2==0)
c[i]=1;
c[1]=2;
c[3]=2;
c[5]=4;
c[7]=4;
c[9]=2;
c[11]=2;
c[13]=4;
c[15]=4;
for( ; scanf("%d%d%d%d%d%d%d%d",
&p[0], &p[1], &p[2], &p[3],
&p[4], &p[5], &p[6], &p[7])==8 ; ){
for(j=0;j<8;j++)
if( p[j]-c[j] > 0 )
curS+=p[j]-c[j];
minS=curS;
for(i=0;i<8;i++){
curS=0;
for(j=0;j<8;j++)
if( p[j]-c[i+j] > 0 )
curS+=p[j]-c[i+j];
if(minS>curS){
minS=curS;
minP=i;
}
}
for(i=minP;i<minP+8;i++){
printf("%d",c[i]);
if(i!=minP+7)
printf(" ");
}
printf("\n");
}
return 0;
}
#include<stdio.h>
int main(void){
int i,j;
int p[8];
int c[16];
int curS,minS,minP;
for(i=0;i<16;i++)
if(i%2==0)
c[i]=1;
c[1]=2;
c[3]=2;
c[5]=4;
c[7]=4;
c[9]=2;
c[11]=2;
c[13]=4;
c[15]=4;
for( ; scanf("%d%d%d%d%d%d%d%d",
&p[0], &p[1], &p[2], &p[3],
&p[4], &p[5], &p[6], &p[7])==8 ; ){
for(j=0;j<8;j++)
if( p[j]-c[j] > 0 )
curS+=p[j]-c[j];
minS=curS;
for(i=0;i<8;i++){
curS=0;
for(j=0;j<8;j++)
if( p[j]-c[i+j] > 0 )
curS+=p[j]-c[i+j];
if(minS>curS){
minS=curS;
minP=i;
}
}
for(i=minP;i<minP+8;i++){
printf("%d",c[i]);
if(i!=minP+7)
printf(" ");
}
printf("\n");
}
return 0;
}
|
main.c:56:5: error: redefinition of 'main'
56 | int main(void){
| ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int(void)'
3 | int main(void){
| ^~~~
|
s959593048
|
p00082
|
C++
|
#include <cstdio>
#include <algorithm>
using namespace std;
const int r[] = {4, 1, 4, 1, 2, 1, 2, 1};
struct PA
{
int s;
int num;
int V;
};
bool cmp(PA A, PA B)
{
if (A.num == B.num){
return (A.V < B.V);
}
return (A.num < B.num);
}
int main()
{
int c[8];
PA pa[8];
while (1){
memset(pa, 0, sizeof(pa));
for (int i = 0; i < 8; i++){
if (scanf("%d", &c[i]) == EOF) return 0;
pa[i].s = i;
}
for (int i = 0; i < 8; i++){
for (int j = 0; j < 8; j++){
pa[i].V = pa[i].V * 10 + r[(i + j) % 8];
if (r[(i + j) % 8] < c[j]){
pa[i].num += c[j] - r[(i + j) % 8];
}
}
}
/*
for (int i = 0; i < 8; i++){
printf("%d %d\n", pa[i].V, pa[i].num);
}
*/
sort(pa, pa + 8, cmp);
bool f = false;
for (int i = 0; i < 8; i++){
if (f){
printf(" ");
}
f = true;
printf("%d", r[(pa[0].s + i) % 8]);
}
puts("");
}
}
|
a.cc: In function 'int main()':
a.cc:28:17: error: 'memset' was not declared in this scope
28 | memset(pa, 0, sizeof(pa));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <algorithm>
+++ |+#include <cstring>
3 | using namespace std;
|
s443970256
|
p00082
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main(){
int p[8], q[8]={4,1,4,1,2,1,2,1},a=0,m=999999999;
while(cin>>p[0]){
vector<pair<int,int> >vec;
for(int i=1;i<8;i++)
cin>>p[i];
for(int i=0;i<8;i++){
int t=0;
for(int j=0;j<8;j++)
if(p[j]>q[(i+j)%8])
t+=(p[j]-q[(i+j)%8]);
if(t<=m){
m=t;
int te=0;
for(int j=0;j<8;j++)
te=te*10+q[(a+j)%8];
vec.push_back(make_pair(te, i));
}
}
sort(vec.begin(),vec.end());
a=vec[0].second;
for(int i=0;i<7;i++)
cout<<q[(a+i)%8]<<" ";
cout<<q[(a+7)%8]<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:24:9: error: 'sort' was not declared in this scope; did you mean 'short'?
24 | sort(vec.begin(),vec.end());
| ^~~~
| short
|
s918705252
|
p00082
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main()
{
int f[]={4,1,4,1,2,1,2,1},p[8],r,P;
while(cin>>p[0]){
for(int i=1;i<8;i++)cin>>p[i];
for(int i=0;i<8;i++){
int n=0;
for(int j=0;j<8;j++)if(f[(i+j)%8]<p[j])n+=p[j]-f[(i+j)%8];
if(r>n||i==0){
r=n;
P=i;
}
else if(r==n){
for(int j=0;j<8&&f[(i+j)%8]<=fl[(P+j)%8];j++){
if(f[(i+j)%8]<f[(P+j)%8]){
P=i;
break;
}
}
}
}
for(int i=0;i<7;i++)cout<<f[(P+i)%8]<<" ";
cout<<f[(P+7)%8]<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:16:46: error: 'fl' was not declared in this scope; did you mean 'f'?
16 | for(int j=0;j<8&&f[(i+j)%8]<=fl[(P+j)%8];j++){
| ^~
| f
|
s928235103
|
p00082
|
C++
|
#include <stdio.h>
#include <algorithm>
int p[8], c[8] = { 1, 4, 1, 4, 1, 2, 1, 2 };
int main() {
while(~scanf("%d%d%d%d%d%d%d%d", &p[0], &p[1], &p[2], &p[3], &p[4], &p[5], &p[6], &p[7])) {
int ret = 999999999;
for(int i = 0; i < 8; i++) {
int res = 0;
for(int j = i; j < i + 8; j++) res += max(p[j - i] - c[j % 8], 0);
ret = min(ret, res);
}
printf("%d\n", ret);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:63: error: 'max' was not declared in this scope; did you mean 'std::max'?
9 | for(int j = i; j < i + 8; j++) res += max(p[j - i] - c[j % 8], 0);
| ^~~
| std::max
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
a.cc:10:31: error: 'min' was not declared in this scope; did you mean 'std::min'?
10 | ret = min(ret, res);
| ^~~
| std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
|
s206116976
|
p00082
|
C++
|
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
int mery[8] = { 4,1,4,1,2,1,2,1 };
void kaiten() {
int a = mery[0];
for (int b = 0; b < 7; b++)mery[b] = mery[b + 1];
mery[7] = a;
}
int k() {
int b = 0;
for (int a : mery) {
b = b * 10 + a;
}
return b;
}
signed main() {
int a[8];
while (cin >> a[0]) {
for (int b = 1; b < 8; b++)cin >> a[b];
int MIN = INT_MAX;
int o = 0;
for (int c = 0; c < 8; c++) {
kaiten();
int e = 0;
for (int d = 0; d < 8; d++) {
if (a[d] > mery[d])e += a[d] - mery[d];
}
if (e < MIN) {
MIN = e;
o = k();
}
if (e == MIN) {
o = min(o, k());
}
}
string p = to_string(o);
for (int q = 0; q < 8; q++) {
if (q)cout << " ";
cout << p[q];
}
cout << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:25:27: error: 'INT_MAX' was not declared in this scope
25 | int MIN = INT_MAX;
| ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
5 | #include<map>
+++ |+#include <climits>
6 | using namespace std;
|
s491160127
|
p00082
|
C++
|
int main()
{
int a[] = {1,2,1,2,1,4,1,4};
int p[8],i=0;
while(cin >> p[(i++)%8])
{
if(i%8==0)
{
int ans=0, md = 1e5, dist;
REP(j,8)
{
dist = 0;
REP(k,8) dist+=(p[k]>a[(k+j)%8])?p[k]-a[(k+j)%8]:0;
if(dist == md)
{
int s1=0, s2=0;
for(int k=0,d=1e7;k<8;k++,d/=10)
{
s1 += d*a[(k+ans)%8];
s2 += d*a[(k+j)%8];
}
if(s2 < s1) ans = j;
}
if(dist < md)
{
md = dist;
ans = j;
}
}
REP(j,8) printf("%d%s",a[(j+ans)%8],j==7?"\n":" ");
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
5 | while(cin >> p[(i++)%8])
| ^~~
a.cc:10:11: error: 'j' was not declared in this scope
10 | REP(j,8)
| ^
a.cc:10:7: error: 'REP' was not declared in this scope
10 | REP(j,8)
| ^~~
|
s028571218
|
p00082
|
C++
|
#include<iostream>
#include<cassert>
using namespace std;
#define N 8
static const int cap[N] = {4, 1, 4, 1, 2, 1, 2, 1};
int main(){
int Q[N];
while( cin >> Q[0] ){
for ( int i = 1; i < N; i++ ) cin >> Q[i];
int min = INT_MAX;
int minv = INT_MAX;
int start;
for ( int s = 0; s < N; s++ ){
int sum = 0;
for ( int i = 0; i < N; i++ ){
int rem = Q[i] - cap[(i+s)%N];
if ( rem > 0 ) sum += rem;
}
int value = 0;
int p = 1;
for ( int i= N-1; i >= 0; i-- ){
value += p * cap[(i+s)%N];
p *= 10;
}
if ( sum == min ) {
if ( value < minv ){
min = sum;
minv = value;
start = s;
}
} else if ( sum < min ){
min = sum;
minv = value;
start = s;
}
}
int j = 0;
for ( int i = start; i < N + start; i++ ){
if ( j ) cout << " ";
cout << cap[i%N];
j++;
}
cout << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:13:19: error: 'INT_MAX' was not declared in this scope
13 | int min = INT_MAX;
| ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include<cassert>
+++ |+#include <climits>
3 | using namespace std;
|
s389861030
|
p00082
|
C++
|
#include<iostream>
#include<climit>
using namespace std;
#define N 8
static const int cap[N] = {4, 1, 4, 1, 2, 1, 2, 1};
int main(){
int Q[N];
while( cin >> Q[0] ){
for ( int i = 1; i < N; i++ ) cin >> Q[i];
int min = INT_MAX;
int minv = INT_MAX;
int start;
for ( int s = 0; s < N; s++ ){
int sum = 0;
for ( int i = 0; i < N; i++ ){
int rem = Q[i] - cap[(i+s)%N];
if ( rem > 0 ) sum += rem;
}
int value = 0;
int p = 1;
for ( int i= N-1; i >= 0; i-- ){
value += p * cap[(i+s)%N];
p *= 10;
}
if ( sum == min ) {
if ( value < minv ){
min = sum;
minv = value;
start = s;
}
} else if ( sum < min ){
min = sum;
minv = value;
start = s;
}
}
int j = 0;
for ( int i = start; i < N + start; i++ ){
if ( j ) cout << " ";
cout << cap[i%N];
j++;
}
cout << endl;
}
}
|
a.cc:2:9: fatal error: climit: No such file or directory
2 | #include<climit>
| ^~~~~~~~
compilation terminated.
|
s809579808
|
p00082
|
C++
|
#include <iostream>
using namespace std;
int main() {
int p[8];
int c[8];
int temp[8]={4,1,4,1,2,1,2,1};
int men[8];
int min_men;
int ans[8];
long int v[8];
long int v_men;
int idx;
int answer;
while(cin >> p[0] >> p[1] >> p[2] >> p[3] >> p[4] >> p[5] >> p[6] >> p[7]) {
for(int i=0;i<8;i++) {
for(int j=0;j<8;j++) {
c[(j+i)%8]=temp[j];
}
men[i]=0;
for(int j=0;j<8;j++) {
men[i]+=max((p[j]-c[j]),0);
}
//for(int j=0;j<8;j++) cout << c[j] << " ";
//cout << endl;
}
min_men=100000;
for(int j=0;j<8;j++) {
min_men=min(men[j],min_men);
}
idx=0;
for(int j=0;j<8;j++) ans[j]=-1;
for(int j=0;j<8;j++) {
if(men[j]==min_men) {
ans[idx]=j;
idx++;
}
}
//for(int j=0;j<idx;j++) cout << ans[j] << " ";
//cout << endl;
for(int j=0;j<8;j++) v[j]=100000000;
for(int j=0;j<8;j++) {
for(int k=0;k<idx;k++) {
if(j==ans[k]) {
v[j]=10000000*temp[(j+0)%8]+1000000*temp[(j+1)%8]+100000*temp[(j+2)%8]+10000*temp[(j+3)%8]+1000*temp[(j+4)%8]+100*temp[(j+5)%8]+10*temp[(j+6)%8]+temp[(j+7)%8];
}
}
}
//for(int j=0;j<8;j++) cout << v[j] << " ";
//cout << endl;
v_men=100000000;
for(int j=0;j<8;j++) {
if(v_men>v[j]) {
v_men=v[j];
answer=j;
//cout << v_men << " " << j << endl;
}
}
/cout << answer << endl;
//for(int i=0;i<8;i++) cout << temp[i] << " ";
//cout << endl;
for(int i=0;i<8;i++) {
c[(i+answer)%8]=temp[i];
}
for(int i=0;i<8;i++) {
if(i==0) cout << c[i];
else cout << " " << c[i];
}
cout << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:99:5: error: expected primary-expression before '/' token
99 | /cout << answer << endl;
| ^
|
s937086102
|
p00082
|
C++
|
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<cstdlib>
#include<deque>
using namespace std;
int Jenny[8]={4,1,4,1,2,1,2,1};
vector<int>keys;
vector<int>value;
void t_sort(){
for(int y=0;y<keys.size()-1;y++)
for(int x=0;x<keys.size()-1;x++)
if(value[x]>=value[x+1])
if(value[x]==value[x+1]&&keys[x]>keys[x+1])
int t=keys[x]; keys[x]=keys[x+1]; keys[x+1]=t;
}else{
int t=value[x]; value[x]=value[x+1]; value[x+1]=t;
int tk=keys[x]; keys[x]=keys[x+1]; keys[x+1]=tk;
}
}
string IntToString(int t){
char cc[100];
sprintf(cc,"%d",t);
string ret=cc;
return ret;
}
int main(){
int p[8];
while(cin>>p[0]>>p[1]>>p[2]>>p[3]>>p[4]>>p[5]>>p[6]>>p[7]){
keys.clear(); value.clear();
for(int i=0;i<8;i++){
string tmp="";
int cost=0;
for(int x=0;x<8;x++){
int j_p=x+i>7?(x+i)-8:x+i;
int t=p[x]-Jenny[j_p];
tmp+=IntToString(Jenny[j_p]);
cost+=(t>0?t:0);
}
keys.push_back(atoi(tmp.c_str()));
value.push_back(cost);
}
t_sort();
string res=IntToString(keys[0]);
for(int x=0;x<res.size();x++){
cout<<res[x];
if(x==res.size()-1) cout<<endl;
else cout<<" ";
}
}
}
|
a.cc: In function 'void t_sort()':
a.cc:21:61: error: 'x' was not declared in this scope
21 | int t=keys[x]; keys[x]=keys[x+1]; keys[x+1]=t;
| ^
a.cc:21:85: error: 't' was not declared in this scope; did you mean 'tm'?
21 | int t=keys[x]; keys[x]=keys[x+1]; keys[x+1]=t;
| ^
| tm
a.cc: At global scope:
a.cc:22:34: error: expected unqualified-id before 'else'
22 | }else{
| ^~~~
a.cc:26:1: error: expected declaration before '}' token
26 | }
| ^
|
s273514931
|
p00082
|
C++
|
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <vector>
using namespace std;
// calc num of passengers
int calc(vector<int> passengers, string s){
int remain = 0;
int n;
for (int i = 0; i < 8; i++) {
n = passengers[i] - (s[i] - '0');
n = (n < 0) ? 0 : n;
remain += n;
}
return remain;
}
// convert string to int if there are same best answers
int getNum(string s, int location){
return atoi(s.substr(location, 8).c_str());
}
int main(){
vector<int> passengers;
int p[8];
int ans_remain;
int ans_location;
int tmp;
string s = "4121214141212141";
while (cin >> p[0] >> p[1] >> p[2] >> p[3] >> p[4] >> p[5] >> p[6] >> p[7]) {
ans_remain = INT_MAX;
ans_location = -1;
passengers.clear();
for (int i = 0; i < 8; i++) {
passengers.push_back(p[i]);
}
for (int i = 0; i < 8; i++) {
tmp = calc(passengers, s.substr(i, 8));
if(ans_remain > tmp){ // find new best answer
ans_remain = tmp;
ans_location = i;
}else if (ans_remain == tmp) { // same answer
if (getNum(s, ans_location) > getNum(s, i)) {
ans_remain = tmp;
ans_location = i;
}
}
}
// print ans
for (int i = 0; i < 7; i++) {
cout << s[ans_location+i] << " ";
}
cout << s[ans_location+7] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:33:30: error: 'INT_MAX' was not declared in this scope
33 | ans_remain = INT_MAX;
| ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
5 | #include <vector>
+++ |+#include <climits>
6 | using namespace std;
|
s396083468
|
p00082
|
C++
|
#include <iostream>
using namespace std;
int ArrayToInt(const int* arry, int ofs){
int result;
result = arry[ofs]*10000000
+ arry[ofs+1]*1000000
+ arry[ofs+2]*100000
+ arry[ofs+3]*10000
+ arry[ofs+4]*1000
+ arry[ofs+5]*100
+ arry[ofs+6]*10
+ arry[ofs+7];
return result;
}
//0082
int main(){
const int merry[15] = {1,2,1,2,1,4,1,4,1,2,1,2,1,4,1};
int human[8] = {0};
int remain[8] = {0};
while(1){
for(int i=0; i<8; ++i){
cin >> human[i];
if(cin.eof())break;
}
int min_remain = INT_MAX;
for(int start=0; start<8; ++start){
for(int i=0; i<8; ++i){
int t = human[i] - merry[start+i];
if(t>0){
remain[start] += t;
}
}
min_remain = ((min_remain < remain[start]) ? min_remain : remain[start]);
}
int x;
int prev = INT_MAX;
for(int i=0; i<8; ++i){
if(remain[i] == min_remain){
int t = ArrayToInt(merry, i);
if(prev > t){
prev = t;
x = i;
}
}
}
cout << merry[x+0] << " "
<< merry[x+1] << " "
<< merry[x+2] << " "
<< merry[x+3] << " "
<< merry[x+4] << " "
<< merry[x+5] << " "
<< merry[x+6] << " "
<< merry[x+7] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:29:34: error: 'INT_MAX' was not declared in this scope
29 | int min_remain = INT_MAX;
| ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include <iostream>
+++ |+#include <climits>
2 | using namespace std;
|
s292300790
|
p00082
|
C++
|
2 3 1 4 0 1 0 1
4 2 3 2 2 2 1 1
|
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 2 3 1 4 0 1 0 1
| ^
|
s401030343
|
p00082
|
C++
|
g#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
using namespace std;
int p[8];
int m[] = {4, 1, 4, 1, 2, 1, 2, 1, 4, 1, 4, 1, 2, 1, 2, 1};
int to_i(string s) {
istringstream is(s);
int n; is >> n;
return n;
}
int hash(int index) {
string s;
for (int i = index; i < index+8; i++)
s.push_back(m[i] + '0');
return to_i(s);
}
string to_s(int n) {
ostringstream os;
os << n;
return os.str();
}
string format(int n) {
string s = to_s(n);
string t;
t.push_back(s[0]);
for (int i = 1; i < 8; i++) {
t.push_back(' ');
t.push_back(s[i]);
}
return t;
}
const int INF = 1<<28;
int main() {
while (cin >> p[0]) {
for (int i = 1; i < 8; i++) cin >> p[i];
int min_wait = INF;
int min_hash = INF;
for (int i = 0; i < 8; i++) {
int wait = 0;
for (int j = 0; j < 8; j++) {
if (m[i+j] < p[j]) {
wait += (p[j] - m[i+j]);
}
}
if (min_wait > wait) {
min_wait = wait;
min_hash = hash(i);
}
}
cout << format(min_hash) << endl;
}
return 0;
}
|
a.cc:1:2: error: stray '#' in program
1 | g#include <iostream>
| ^
a.cc:1:1: error: 'g' does not name a type
1 | g#include <iostream>
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared
295 | template <typename _Tp, size_t = sizeof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared
984 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope
1451 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
63 | #include <bits/version.h>
+++ |+#include <cstddef>
64 |
/usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid
1451 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared
1453 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope
1454 | struct extent<_Tp[_Size], 0>
| ^~~~~
/usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid
1454 | struct extent<_Tp[_Size], 0>
| ^
/usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~
/usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid
1455 | : public integral_constant<size_t, _Size> { };
| ^
/usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid
/usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared
1457 | template<typename _Tp, unsigned _Uint, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope
1458 | struct extent<_Tp[_Size], _Uint>
| ^~~~~
/usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid
1458 | struct extent<_Tp[_Size], _Uint>
| ^
/usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope
1463 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid
1463 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type
1857 | { static constexpr size_t __size = sizeof(_Tp); };
| ^~~~~~
/usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~~
/usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~
/usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp'
1860 | struct __select;
| ^~~~~~~~
/usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared
1862 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^~~
/usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^
/usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared
1866 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^~~
/usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid
186
|
s683493720
|
p00083
|
Java
|
import java.util.*;
public class AOJ0083{
static long getHash(int y,int m,int o){
return (long)(y*10000+m*100+o);
}
public static void main(String[] args){
int Y,M,O;
Scanner in = new Scanner(System.in);
long premeiji = getHash(1868,9,7);
long meiji_u = getHash(1868,9,8),meiji_b = getHash(1912,7,29);
long taisho_u = getHash(1912,7,30),taisho_b = getHash(1926,12,24);
long showa_u = getHash(1926,12,25),showa_b = getHash(1989,1,7);
long heisei = getHash(1989,1,8);
while(in.hasNext()){
Y = in.nextInt();
M = in.nextInt();
O = in.nextInt();
long input = getHash(Y,M,O);
if(input <= premeiji)System.out.println("pre-meiji");
else if(meiji_u <= input && input <= meiji_b)System.out.println("meiji " + (Y-1867) + " " + M + " " + O);
else if(taisho_u <= input && input <= taisho_b)System.out.println("taisho " + (Y-1911) + " " + M + " " + O);
else if(showa_u <= input && input <= showa_b)System.out.println("showa " + (Y-1925) + " " + M + " " + O);
else if(heisei <= input)System.out.println("heisei " + (Y-1988) + " " + M + " " + O);
}
}
}
|
Main.java:3: error: class AOJ0083 is public, should be declared in a file named AOJ0083.java
public class AOJ0083{
^
1 error
|
s566774981
|
p00083
|
C
|
#include<stdio.h>
#include<string.h>
??
int y[9], m[9], d[9], i;
char s[9][20];
??
int main(){
?? ?? strcat(s[0],"pre-meiji");
?? ?? y[1] = 1868; m[1] = 9; d[1] = 8; strcat(s[1], "meiji");
?? ?? y[2] = 1912; m[2] = 7; d[2] = 30; strcat(s[2], "taisho");
?? ?? y[3] = 1926; m[3] = 12; d[3] = 25; strcat(s[3], "showa");
?? ?? y[4] = 1989; m[4] = 1; d[4] = 8; strcat(s[4], "heisei");
?? ?? while (scanf("%d%d%d", &y[0], &m[0], &d[0]) != EOF) {
?? ?? ?? ?? for(i = 4; i >= 0; i--) {
?? ?? ?? ?? ?? ?? if (i == 0) {
printf("%s\n", s[0]);
break;
} else if (y[0]>y[i]) {
?? ?? ?? ?? ?? ?? ?? ?? printf("%s %d %d %d\n", s[i], y[0] - y[i] + 1, m[0], d[0]);
?? ?? ?? ?? ?? ?? ?? ?? break;
?? ?? ?? ?? ?? ?? } else if (y[0] == y[i]) {
?? ?? ?? ?? ?? ?? ?? ?? if (m[0] > m[i]) {
printf("%s %d %d %d\n", s[i], y[0] - y[i] + 1, m[0], d[0]);
break;
?? ?? ?? ?? ?? ?? ?? ?? } else if (m[0] == m[i] && d[0] >= d[i]) {
printf("%s %d %d %d\n", s[i], y[0] - y[i] + 1, m[0], d[0]);
break;
}
?? ?? ?? ?? ?? ?? }
?? ?? ?? ?? }
?? ?? }
?? ?? return 0;
}
|
main.c:3:1: error: expected identifier or '(' before '?' token
3 | ??
| ^
main.c:6:1: error: expected identifier or '(' before '?' token
6 | ??
| ^
|
s073568272
|
p00083
|
C
|
#include<stdio.h>
#include<string.h>
??
int y[9], m[9], d[9], i;
char s[9][20];
??
int main(){
?? ?? strcat(s[0],"pre-meiji");
?? ?? y[1] = 1868; m[1] = 9; d[1] = 8; strcat(s[1], "meiji");
?? ?? y[2] = 1912; m[2] = 7; d[2] = 30; strcat(s[2], "taisho");
?? ?? y[3] = 1926; m[3] = 12; d[3] = 25; strcat(s[3], "showa");
?? ?? y[4] = 1989; m[4] = 1; d[4] = 8; strcat(s[4], "heisei");
?? ?? while (scanf("%d%d%d", &y[0], &m[0], &d[0]) != EOF) {
?? ?? ?? ?? for(i = 4; i >= 0; i--) {
?? ?? ?? ?? ?? ?? if (i == 0) {
printf("%s\n", s[0]);
break;
} else if (y[0]>y[i]) {
?? ?? ?? ?? ?? ?? ?? ?? printf("%s %d %d %d\n", s[i], y[0] - y[i] + 1, m[0], d[0]);
?? ?? ?? ?? ?? ?? ?? ?? break;
?? ?? ?? ?? ?? ?? } else if (y[0] == y[i]) {
?? ?? ?? ?? ?? ?? ?? ?? if (m[0] > m[i]) {
printf("%s %d %d %d\n", s[i], y[0] - y[i] + 1, m[0], d[0]);
break;
?? ?? ?? ?? ?? ?? ?? ?? } else if (m[0] == m[i] && d[0] >= d[i]) {
printf("%s %d %d %d\n", s[i], y[0] - y[i] + 1, m[0], d[0]);
break;
}
?? ?? ?? ?? ?? ?? }
?? ?? ?? ?? }
?? ?? }
?? ?? return 0;
}
|
main.c:3:1: error: expected identifier or '(' before '?' token
3 | ??
| ^
main.c:6:1: error: expected identifier or '(' before '?' token
6 | ??
| ^
|
s354425133
|
p00083
|
C++
|
#include<stdio.h>
void era_transformation(int year, int month, int day);
int main(void)
{
int year, month, day;
while(scanf("%d %d %d", &year, &month, &day) != EOF) {
era_transformation(year, month, day);
}
return 0;
}
void era_transformation(int year, int month, int day)
{
int date_number = year * 10000 + month * 100 + day;
int meiji_number = 1868 * 10000 + 9 * 100 + 8;
int taisho_number = 1912 * 10000 + 7 * 100 + 30;
int showa_number = 1926 * 10000 + 12 * 100 + 25;
int heisei_number = 1989 * 10000 + 1 * 100 + 8;
if (date_number < meiji_number) {
printf(''pre_meiji'');
}
else if (date_number < taisho_number) {
printf(''meiji'');
printf('' %d %d %d\n'', year - 1867, month, day);
}
else if (date_number < showa_number) {
printf(''taisho'');
printf('' %d %d %d\n'', year - 1911, month, day);
}
else if (date_number < heisei_number) {
printf(''showa'');
printf('' %d %d %d\n'', year - 1925, month, day);
} else {
printf(''heisei'');
printf('' %d %d %d\n'', year - 1988, month, day);
}
}
|
a.cc:22:14: error: empty character constant
22 | printf(''pre_meiji'');
| ^~
a.cc:22:17: error: stray '#' in program
22 | printf(''pre_meiji'');
| ^
a.cc:22:31: error: empty character constant
22 | printf(''pre_meiji'');
| ^~
a.cc:25:14: error: empty character constant
25 | printf(''meiji'');
| ^~~~~~~
a.cc:25:21: error: empty character constant
25 | printf(''meiji'');
| ^~
a.cc:26:14: error: empty character constant
26 | printf('' %d %d %d\n'', year - 1867, month, day);
| ^~
a.cc:26:25: error: stray '\' in program
26 | printf('' %d %d %d\n'', year - 1867, month, day);
| ^
a.cc:26:27: error: empty character constant
26 | printf('' %d %d %d\n'', year - 1867, month, day);
| ^~
a.cc:26:30: error: stray '#' in program
26 | printf('' %d %d %d\n'', year - 1867, month, day);
| ^
a.cc:29:14: error: empty character constant
29 | printf(''taisho'');
| ^~~~~~~~
a.cc:29:22: error: empty character constant
29 | printf(''taisho'');
| ^~
a.cc:30:14: error: empty character constant
30 | printf('' %d %d %d\n'', year - 1911, month, day);
| ^~
a.cc:30:25: error: stray '\' in program
30 | printf('' %d %d %d\n'', year - 1911, month, day);
| ^
a.cc:30:27: error: empty character constant
30 | printf('' %d %d %d\n'', year - 1911, month, day);
| ^~
a.cc:30:30: error: stray '#' in program
30 | printf('' %d %d %d\n'', year - 1911, month, day);
| ^
a.cc:33:14: error: empty character constant
33 | printf(''showa'');
| ^~
a.cc:33:17: error: stray '#' in program
33 | printf(''showa'');
| ^
a.cc:33:27: error: empty character constant
33 | printf(''showa'');
| ^~
a.cc:33:30: error: stray '#' in program
33 | printf(''showa'');
| ^
a.cc:34:14: error: empty character constant
34 | printf('' %d %d %d\n'', year - 1925, month, day);
| ^~
a.cc:34:17: error: stray '#' in program
34 | printf('' %d %d %d\n'', year - 1925, month, day);
| ^
a.cc:34:31: error: stray '\' in program
34 | printf('' %d %d %d\n'', year - 1925, month, day);
| ^
a.cc:34:33: error: empty character constant
34 | printf('' %d %d %d\n'', year - 1925, month, day);
| ^~
a.cc:36:14: error: empty character constant
36 | printf(''heisei'');
| ^~
a.cc:36:17: error: stray '#' in program
36 | printf(''heisei'');
| ^
a.cc:36:28: error: empty character constant
36 | printf(''heisei'');
| ^~
a.cc:37:14: error: empty character constant
37 | printf('' %d %d %d\n'', year - 1988, month, day);
| ^~
a.cc:37:17: error: stray '#' in program
37 | printf('' %d %d %d\n'', year - 1988, month, day);
| ^
a.cc:37:31: error: stray '\' in program
37 | printf('' %d %d %d\n'', year - 1988, month, day);
| ^
a.cc:37:33: error: empty character constant
37 | printf('' %d %d %d\n'', year - 1988, month, day);
| ^~
a.cc:37:36: error: stray '#' in program
37 | printf('' %d %d %d\n'', year - 1988, month, day);
| ^
a.cc: In function 'void era_transformation(int, int, int)':
a.cc:22:21: error: expected ')' before ';' token
22 | printf(''pre_meiji'');
| ~ ^
| )
a.cc:22:22: error: 'pre_meiji' was not declared in this scope
22 | printf(''pre_meiji'');
| ^~~~~~~~~
a.cc:25:14: error: unable to find character literal operator 'operator""meiji' with 'char' argument
25 | printf(''meiji'');
| ^~~~~~~
a.cc:26:18: error: 'd' was not declared in this scope
26 | printf('' %d %d %d\n'', year - 1867, month, day);
| ^
a.cc:26:35: error: expected primary-expression before ',' token
26 | printf('' %d %d %d\n'', year - 1867, month, day);
| ^
a.cc:29:14: error: unable to find character literal operator 'operator""taisho' with 'char' argument
29 | printf(''taisho'');
| ^~~~~~~~
a.cc:30:18: error: 'd' was not declared in this scope
30 | printf('' %d %d %d\n'', year - 1911, month, day);
| ^
a.cc:30:35: error: expected primary-expression before ',' token
30 | printf('' %d %d %d\n'', year - 1911, month, day);
| ^
a.cc:33:21: error: expected ')' before ';' token
33 | printf(''showa'');
| ~ ^
| )
a.cc:33:22: error: 'showa' was not declared in this scope
33 | printf(''showa'');
| ^~~~~
a.cc:33:35: error: expected primary-expression before ')' token
33 | printf(''showa'');
| ^
a.cc:34:21: error: expected ')' before ';' token
34 | printf('' %d %d %d\n'', year - 1925, month, day);
| ~ ^
| )
a.cc:34:23: error: expected primary-expression before '%' token
34 | printf('' %d %d %d\n'', year - 1925, month, day);
| ^
a.cc:34:24: error: 'd' was not declared in this scope
34 | printf('' %d %d %d\n'', year - 1925, month, day);
| ^
a.cc:36:21: error: expected ')' before ';' token
36 | printf(''heisei'');
| ~ ^
| )
a.cc:36:22: error: 'heisei' was not declared in this scope
36 | printf(''heisei'');
| ^~~~~~
a.cc:37:21: error: expected ')' before ';' token
37 | printf('' %d %d %d\n'', year - 1988, month, day);
| ~ ^
| )
a.cc:37:23: error: expected primary-expression before '%' token
37 | printf('' %d %d %d\n'', year - 1988, month, day);
| ^
a.cc:37:24: error: 'd' was not declared in this scope
37 | printf('' %d %d %d\n'', year - 1988, month, day);
| ^
a.cc:37:41: error: expected primary-expression before ',' token
37 | printf('' %d %d %d\n'', year - 1988, month, day);
| ^
|
s777646471
|
p00083
|
C++
|
#include<stdio.h>
void era_transformation(int year, int month, int day);
int main(void)
{
int year, month, day;
while(scanf("%d %d %d", &year, &month, &day) != EOF) {
era_transformation(year, month, day);
}
return 0;
}
void era_transformation(int year, int month, int day)
{
int date_number = year * 10000 + month * 100 + day;
int meiji_number = 1868 * 10000 + 9 * 100 + 8;
int taisho_number = 1912 * 10000 + 7 * 100 + 30;
int showa_number = 1926 * 10000 + 12 * 100 + 25;
int heisei_number = 1989 * 10000 + 1 * 100 + 8;
if (date_number < meiji_number) {
printf(”pre_meiji”);
}
else if (date_number < taisho_number) {
printf(”meiji”);
printf(” %d %d %d\n”, year - 1867, month, day);
}
else if (date_number < showa_number) {
printf(”taisho”);
printf(” %d %d %d\n”, year - 1911, month, day);
}
else if (date_number < heisei_number) {
printf(”showa”);
printf(” %d %d %d\n”, year - 1925, month, day);
} else {
printf(”heisei”);
printf(” %d %d %d\n”, year - 1988, month, day);
}
}
|
a.cc:22:14: error: extended character ” is not valid in an identifier
22 | printf(”pre_meiji”);
| ^
a.cc:22:14: error: extended character ” is not valid in an identifier
a.cc:25:14: error: extended character ” is not valid in an identifier
25 | printf(”meiji”);
| ^
a.cc:25:14: error: extended character ” is not valid in an identifier
a.cc:26:14: error: extended character ” is not valid in an identifier
26 | printf(” %d %d %d\n”, year - 1867, month, day);
| ^
a.cc:26:24: error: stray '\' in program
26 | printf(” %d %d %d\n”, year - 1867, month, day);
| ^
a.cc:26:25: error: extended character ” is not valid in an identifier
26 | printf(” %d %d %d\n”, year - 1867, month, day);
| ^
a.cc:29:14: error: extended character ” is not valid in an identifier
29 | printf(”taisho”);
| ^
a.cc:29:14: error: extended character ” is not valid in an identifier
a.cc:30:14: error: extended character ” is not valid in an identifier
30 | printf(” %d %d %d\n”, year - 1911, month, day);
| ^
a.cc:30:24: error: stray '\' in program
30 | printf(” %d %d %d\n”, year - 1911, month, day);
| ^
a.cc:30:25: error: extended character ” is not valid in an identifier
30 | printf(” %d %d %d\n”, year - 1911, month, day);
| ^
a.cc:33:14: error: extended character ” is not valid in an identifier
33 | printf(”showa”);
| ^
a.cc:33:14: error: extended character ” is not valid in an identifier
a.cc:34:14: error: extended character ” is not valid in an identifier
34 | printf(” %d %d %d\n”, year - 1925, month, day);
| ^
a.cc:34:24: error: stray '\' in program
34 | printf(” %d %d %d\n”, year - 1925, month, day);
| ^
a.cc:34:25: error: extended character ” is not valid in an identifier
34 | printf(” %d %d %d\n”, year - 1925, month, day);
| ^
a.cc:36:14: error: extended character ” is not valid in an identifier
36 | printf(”heisei”);
| ^
a.cc:36:14: error: extended character ” is not valid in an identifier
a.cc:37:14: error: extended character ” is not valid in an identifier
37 | printf(” %d %d %d\n”, year - 1988, month, day);
| ^
a.cc:37:24: error: stray '\' in program
37 | printf(” %d %d %d\n”, year - 1988, month, day);
| ^
a.cc:37:25: error: extended character ” is not valid in an identifier
37 | printf(” %d %d %d\n”, year - 1988, month, day);
| ^
a.cc: In function 'void era_transformation(int, int, int)':
a.cc:22:14: error: '\U0000201dpre_meiji\U0000201d' was not declared in this scope
22 | printf(”pre_meiji”);
| ^~~~~~~~~~~
a.cc:25:14: error: '\U0000201dmeiji\U0000201d' was not declared in this scope
25 | printf(”meiji”);
| ^~~~~~~
a.cc:26:14: error: '\U0000201d' was not declared in this scope
26 | printf(” %d %d %d\n”, year - 1867, month, day);
| ^
a.cc:26:17: error: 'd' was not declared in this scope
26 | printf(” %d %d %d\n”, year - 1867, month, day);
| ^
a.cc:29:14: error: '\U0000201dtaisho\U0000201d' was not declared in this scope
29 | printf(”taisho”);
| ^~~~~~~~
a.cc:30:14: error: '\U0000201d' was not declared in this scope
30 | printf(” %d %d %d\n”, year - 1911, month, day);
| ^
a.cc:30:17: error: 'd' was not declared in this scope
30 | printf(” %d %d %d\n”, year - 1911, month, day);
| ^
a.cc:33:14: error: '\U0000201dshowa\U0000201d' was not declared in this scope
33 | printf(”showa”);
| ^~~~~~~
a.cc:34:14: error: '\U0000201d' was not declared in this scope
34 | printf(” %d %d %d\n”, year - 1925, month, day);
| ^
a.cc:34:17: error: 'd' was not declared in this scope
34 | printf(” %d %d %d\n”, year - 1925, month, day);
| ^
a.cc:36:14: error: '\U0000201dheisei\U0000201d' was not declared in this scope
36 | printf(”heisei”);
| ^~~~~~~~
a.cc:37:14: error: '\U0000201d' was not declared in this scope
37 | printf(” %d %d %d\n”, year - 1988, month, day);
| ^
a.cc:37:17: error: 'd' was not declared in this scope
37 | printf(” %d %d %d\n”, year - 1988, month, day);
| ^
|
s424992018
|
p00083
|
C++
|
#include<stdio.h>
void era_transform(int year, int month, int day);
int main(void)
{
int year, month, day;
while(scanf("%d %d %d", &year, &month, &day) != EOF) {
era_transform(year, month, day);
}
return 0;
}
void era_transform(int year, int month, int day)
{
int date_number = year * 10000 + month * 100 + day;
int meiji_number = 1868 * 10000 + 9 * 100 + 8;
int taisho_number = 1912 * 10000 + 7 * 100 + 30;
int showa_number = 1926 * 10000 + 12 * 100 + 25;
int heisei_number = 1989 * 10000 + 1 * 100 + 8;
if (date_number < meiji_number) {
printf("pre-meiji");
} else if (date_number < taisho_number) {
printf("meiji %d %d %d\n", year - 1867, month, day);
} else if (date_number < showa_number) {
printf("taisho %d %d %d\n", year - 1911, month, day);
} else if (date_number < heisei_number) {
printf("showa %d %d %d\n", year - 1925, month, day);
} else {
printf("heisei %d %d %d\n", year - 1988, month, day);
}
}
|
a.cc:30:1: error: extended character is not valid in an identifier
30 | printf("heisei %d %d %d\n", year - 1988, month, day);
| ^
a.cc:30:1: error: extended character is not valid in an identifier
a.cc:30:1: error: extended character is not valid in an identifier
a.cc: In function 'void era_transform(int, int, int)':
a.cc:30:1: error: '\U00003000\U00003000\U00003000printf' was not declared in this scope
30 | printf("heisei %d %d %d\n", year - 1988, month, day);
| ^~~~~~~~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.