Detalii evaluare #53944974

Rezumat problemă

Arhipelagul Zopopan este format din n insule de formă triunghiulară numerotate de la 1 la n. Fiecare insulă este localizată prin coordonatele carteziene ale vârfurilor.

Administrația dorește să cumpere elicoptere pentru a realiza transportul între insule. Un elicopter va putea să asigure o rută între două insule pe distanța minimă obținută pe orizontală sau verticală (paralel cu axele de coordonate). În plus, datorită capacității rezervorului o astfel de rută nu poate să depășească o valoare k – număr natural. Elicopterele parcurg rutele în ambele sensuri.
Investiția trebuie să îndeplinească următoarele condiții:

  1. Numărul de elicoptere cumpărate să fie minim.
  2. Numărul de perechi de insule între care se poate realiza transportul, folosind unul sau mai multe elicoptere să fie maxim.
  3. Suma lungimii tuturor rutelor să fie minimă.

Să se scrie un program care pentru n, k şi coordonatele vârfurilor insulelor cunoscute, determină:

  1. numărul minim de elicoptere ce vor fi cumpărate de administraţie;
  2. numărul perechilor neordonate de insule între care se poate realiza transportul prin elicoptere direct sau indirect;
  3. suma distantelor parcurse de toate elicopterele cumpărate (distanța parcursă de un elicopter se consideră distanța dintre insulele între care acesta asigură transportul).

Detalii

Problema Elicoptere Operații I/O elicoptere.in/elicoptere.out
Limita timp 0.2 secunde Limita memorie Total: 4 MB / Stivă 4 MB
Id soluție #53944974 Utilizator Trâmbițaș Alexandru-Luca (Alex_Tr123)
Fișier elicoptere.cpp Dimensiune 3.26 KB
Data încărcării 15 Noiembrie 2024, 13:16 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

elicoptere.cpp: In function 'double distX(punct, punct, punct)':
elicoptere.cpp:37:39: error: call of overloaded 'abs(double)' is ambiguous
     double dist = 1.0*abs(xp - 1.0*p.x);

                                       ^
elicoptere.cpp:37:39: note: candidates are:
In file included from /usr/include/c++/4.8/cstdlib:72:0,
                 from /usr/include/c++/4.8/ext/string_conversions.h:41,
                 from /usr/include/c++/4.8/bits/basic_string.h:2815,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/stdlib.h:775:12: note: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^
In file included from /usr/include/c++/4.8/ext/string_conversions.h:41:0,
                 from /usr/include/c++/4.8/bits/basic_string.h:2815,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/cstdlib:174:3: note: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^
/usr/include/c++/4.8/cstdlib:166:3: note: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^
elicoptere.cpp: In function 'double distY(punct, punct, punct)':
elicoptere.cpp:52:39: error: call of overloaded 'abs(double)' is ambiguous
     double dist = 1.0*abs(yp - 1.0*p.y);

                                       ^
elicoptere.cpp:52:39: note: candidates are:
In file included from /usr/include/c++/4.8/cstdlib:72:0,
                 from /usr/include/c++/4.8/ext/string_conversions.h:41,
                 from /usr/include/c++/4.8/bits/basic_string.h:2815,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/stdlib.h:775:12: note: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^
In file included from /usr/include/c++/4.8/ext/string_conversions.h:41:0,
                 from /usr/include/c++/4.8/bits/basic_string.h:2815,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/cstdlib:174:3: note: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^
/usr/include/c++/4.8/cstdlib:166:3: note: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^
elicoptere.cpp: In function 'double calcDist(int, int)':
elicoptere.cpp:61:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distX(trg[i].A, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:61:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:61:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].A, trg[j].A, trg[j].B));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:61:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].A, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:62:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distX(trg[i].A, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:62:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:62:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].A, trg[j].B, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:62:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].A, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:63:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distX(trg[i].A, trg[j].A, trg[j].C));

                                                   ^
elicoptere.cpp:63:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:63:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].A, trg[j].A, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:63:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].A, trg[j].A, trg[j].C));

                                                   ^
elicoptere.cpp:65:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distX(trg[i].B, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:65:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:65:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].B, trg[j].A, trg[j].B));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:65:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].B, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:66:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distX(trg[i].B, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:66:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:66:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].B, trg[j].B, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:66:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].B, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:67:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distX(trg[i].B, trg[j].A, trg[j].C));

                                                   ^
elicoptere.cpp:67:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:67:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].B, trg[j].A, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:67:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].B, trg[j].A, trg[j].C));

                                                   ^
elicoptere.cpp:69:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distX(trg[i].C, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:69:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:69:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].C, trg[j].A, trg[j].B));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:69:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].C, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:70:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distX(trg[i].C, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:70:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:70:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].C, trg[j].B, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:70:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].C, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:71:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distX(trg[i].C, trg[j].A, trg[j].C));

                                                   ^
elicoptere.cpp:71:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:71:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].C, trg[j].A, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:71:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distX(trg[i].C, trg[j].A, trg[j].C));

                                                   ^
elicoptere.cpp:74:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distY(trg[i].A, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:74:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:74:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].A, trg[j].A, trg[j].B));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:74:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].A, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:75:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distY(trg[i].A, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:75:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:75:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].A, trg[j].B, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:75:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].A, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:76:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distY(trg[i].A, trg[j].A, trg[j].C));

                                                   ^
elicoptere.cpp:76:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:76:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].A, trg[j].A, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:76:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].A, trg[j].A, trg[j].C));

                                                   ^
elicoptere.cpp:78:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distY(trg[i].B, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:78:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:78:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].B, trg[j].A, trg[j].B));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:78:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].B, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:79:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distY(trg[i].B, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:79:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:79:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].B, trg[j].B, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:79:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].B, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:80:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distY(trg[i].B, trg[j].A, trg[j].C));

                                                   ^
elicoptere.cpp:80:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:80:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].B, trg[j].A, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:80:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].B, trg[j].A, trg[j].C));

                                                   ^
elicoptere.cpp:82:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distY(trg[i].C, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:82:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:82:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].C, trg[j].A, trg[j].B));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:82:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].C, trg[j].A, trg[j].B));

                                                   ^
elicoptere.cpp:83:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distY(trg[i].C, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:83:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:83:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].C, trg[j].B, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:83:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].C, trg[j].B, trg[j].C));

                                                   ^
elicoptere.cpp:84:51: error: no matching function for call to 'min(long double&, double)'
     d = min(d, distY(trg[i].C, trg[j].A, trg[j].C));

                                                   ^
elicoptere.cpp:84:51: note: candidates are:
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:193:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:84:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].C, trg[j].A, trg[j].C));

                                                   ^
In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0,
                 from /usr/include/c++/4.8/ios:40,
                 from /usr/include/c++/4.8/ostream:38,
                 from /usr/include/c++/4.8/iostream:39,
                 from elicoptere.cpp:1:
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/include/c++/4.8/bits/stl_algobase.h:239:5: note:   template argument deduction/substitution failed:
elicoptere.cpp:84:51: note:   deduced conflicting types for parameter 'const _Tp' ('long double' and 'double')
     d = min(d, distY(trg[i].C, trg[j].A, trg[j].C));

                                                   ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema Elicoptere face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.