F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_13781293_30580.cpp: In function 'double calculateArea(polygon&)':
0_0_13781293_30580.cpp:24:24: error: invalid initialization of non-const reference of type 'vector& {aka std::complex<double>&}' from an rvalue of type 'std::complex<double>'
   a += crossProduct(*p - poly[0], *(p + 1) - poly[0]);
                        ^
0_0_13781293_30580.cpp:16:8: note: in passing argument 1 of 'double crossProduct(vector&, vector&)'
 double crossProduct(::vector &a, ::vector &b)
        ^
0_0_13781293_30580.cpp: In function 'vertex lineIntersection(line&, line&)':
0_0_13781293_30580.cpp:33:31: error: invalid initialization of non-const reference of type 'vector& {aka std::complex<double>&}' from an rvalue of type 'std::complex<double>'
  double c = crossProduct(a.pb - a.pa, b.pb - b.pa);
                               ^
0_0_13781293_30580.cpp:16:8: note: in passing argument 1 of 'double crossProduct(vector&, vector&)'
 double crossProduct(::vector &a, ::vector &b)
        ^
0_0_13781293_30580.cpp:36:48: error: invalid initialization of non-const reference of type 'vector& {aka std::complex<double>&}' from an rvalue of type 'std::complex<double>'
  return a.pa + (a.pb-a.pa) * (crossProduct(b.pb- b.pa, a.pa - b.pa) / c);
                                                ^
0_0_13781293_30580.cpp:16:8: note: in passing argument 1 of 'double crossProduct(vector&, vector&)'
 double crossProduct(::vector &a, ::vector &b)
        ^
0_0_13781293_30580.cpp: In function 'int side_count(line&, int, int)':
0_0_13781293_30580.cpp:53:26: error: invalid initialization of non-const reference of type 'vector& {aka std::complex<double>&}' from an rvalue of type 'std::complex<double>'
    if (crossProduct(l.pb - l.pa, verties[i] - l.pa) > 0)
                          ^
0_0_13781293_30580.cpp:16:8: note: in passing argument 1 of 'double crossProduct(vector&, vector&)'
 double crossProduct(::vector &a, ::vector &b)
        ^
0_0_13781293_30580.cpp: In function 'int main()':
0_0_13781293_30580.cpp:88:66: error: invalid initialization of non-const reference of type 'polygon& {aka std::vector<std::complex<double> >&}' from an rvalue of type 'polygon {aka std::vector<std::complex<double> >}'
   printf("Case #%d: %f\n", cc, calculateArea(createPolygon(lines)));
                                                                  ^
0_0_13781293_30580.cpp:20:8: note: in passing argument 1 of 'double calculateArea(polygon&)'
 double calculateArea(polygon &poly)
        ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-06-29 16:14:38, Gzip enabled