#2424
puncte3
Considerăm că toate punctele de coordonate întregi din plan sunt colorate în negru, cu excepţia a n
puncte care sunt colorate în roşu. Două puncte roşii aflate pe aceeaşi linie orizontală sau pe aceeaşi linie verticală (adică puncte care au aceeaşi ordonată sau aceeaşi abscisă) pot fi unite printr-un segment. Colorăm în roşu toate punctele de coordonate întregi de pe acest segment. Repetăm operaţia cât timp se obţin puncte roşii noi. Cunoscând coordonatele celor n
puncte care erau iniţial roşii, aflaţi numărul maxim de puncte roşii care vor exista în final.
ONI 2004 clasa a X-a
Problema | puncte3 | Operații I/O |
puncte3.in /puncte3.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #42176485 | Utilizator | |
Fișier | puncte3.cpp | Dimensiune | 1.54 KB |
Data încărcării | 21 Februarie 2023, 16:03 | Scor / rezultat | Eroare de compilare |
puncte3.cpp:13:20: error: 'int y1' redeclared as different kind of symbol int x1 = 1e9, x2 , y1 = 1e9 , y2; ^ In file included from /usr/include/features.h:374:0, from /usr/include/assert.h:35, from /usr/include/c++/4.8/cassert:43, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:33, from puncte3.cpp:1: /usr/include/i386-linux-gnu/bits/mathcalls.h:241:1: error: previous declaration of 'double y1(double)' __MATHCALL (y1,, (_Mdouble_)); ^ puncte3.cpp: In function 'int main()': puncte3.cpp:36:24: error: no matching function for call to 'min(double (&)(double)throw (), int&)' y1 = min(y1 , y); ^ puncte3.cpp:36:24: 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from puncte3.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: puncte3.cpp:36:24: note: deduced conflicting types for parameter 'const _Tp' ('double(double)throw ()' and 'int') y1 = min(y1 , y); ^ 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/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from puncte3.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: puncte3.cpp:36:24: note: deduced conflicting types for parameter 'const _Tp' ('double(double)throw ()' and 'int') y1 = min(y1 , y); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from puncte3.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4221:5: note: template<class _Tp> _Tp std::min(std::initializer_list<_Tp>) min(initializer_list<_Tp> __l) ^ /usr/include/c++/4.8/bits/stl_algo.h:4221:5: note: template argument deduction/substitution failed: puncte3.cpp:36:24: note: mismatched types 'std::initializer_list<_Tp>' and 'double (*)(double)throw ()' y1 = min(y1 , y); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from puncte3.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4226:5: note: template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare) min(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algo.h:4226:5: note: template argument deduction/substitution failed: puncte3.cpp:36:24: note: mismatched types 'std::initializer_list<_Tp>' and 'double (*)(double)throw ()' y1 = min(y1 , y); ^ puncte3.cpp:54:17: error: invalid conversion from 'double (*)(double)throw ()' to 'int' [-fpermissive] for(int j = y1;j <= y2; ++j){ ^ puncte3.cpp:17:40: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("puncte3.in" , "r" , stdin); ^ puncte3.cpp:18:42: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("puncte3.out" , "w" , stdout); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema puncte3 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
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ă.