#4199
Grădina Academiei Shuchi’in are forma unui pătrat cu latura de N
metri și este împărțit în N × N
parcele pătrate cu dimensiunea de 1
metru. Harta grădinii arată că parcelele sunt aranjate pe linii și coloane și sunt notate cu perechi (r, c)
, unde r
este linia și c
coloana pe care o ocupă parcela. Unele parcele, marcate cu 0
pe harta grădinii, conțin copaci străvechi care nu au putut fi mutați sau tăiați când grădina a fost restaurată. Alte parcele, marcate cu 1
, conțin flori. Notăm cu F
numărul total de parcele care conțin flori. Kaguya definește gradul de înflorire a unei parcele ca fiind suma distanțelor de la parcela curentă la cele mai apropiate K
parcele care conțin flori. Ea vrea să știe gradul de înflorire al fiecărei parcele.
Problema | flowers | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 256 MB
/
Stivă 64 MB
|
Id soluție | #46685733 | Utilizator | |
Fișier | flowers.cpp | Dimensiune | 1.93 KB |
Data încărcării | 20 Noiembrie 2023, 18:29 | Scor / rezultat | Eroare de compilare |
flowers.cpp: In lambda function: flowers.cpp:40:25: error: no matching function for call to 'max(long long int, int&)' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ flowers.cpp:40:25: 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template argument deduction/substitution failed: flowers.cpp:40:25: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template argument deduction/substitution failed: flowers.cpp:40:25: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template<class _Tp> _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^ /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template argument deduction/substitution failed: flowers.cpp:40:25: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template argument deduction/substitution failed: flowers.cpp:40:25: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ flowers.cpp:40:44: error: no matching function for call to 'max(long long int, int&)' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ flowers.cpp:40:44: 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template argument deduction/substitution failed: flowers.cpp:40:44: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template argument deduction/substitution failed: flowers.cpp:40:44: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template<class _Tp> _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^ /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template argument deduction/substitution failed: flowers.cpp:40:44: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template argument deduction/substitution failed: flowers.cpp:40:44: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ flowers.cpp:40:63: error: no matching function for call to 'max(long long int, int&)' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ flowers.cpp:40:63: 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template argument deduction/substitution failed: flowers.cpp:40:63: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template argument deduction/substitution failed: flowers.cpp:40:63: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template<class _Tp> _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^ /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template argument deduction/substitution failed: flowers.cpp:40:63: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template argument deduction/substitution failed: flowers.cpp:40:63: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ flowers.cpp:40:82: error: no matching function for call to 'max(long long int, int&)' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ flowers.cpp:40:82: 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template argument deduction/substitution failed: flowers.cpp:40:82: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template argument deduction/substitution failed: flowers.cpp:40:82: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int') x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template<class _Tp> _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^ /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template argument deduction/substitution failed: flowers.cpp:40:82: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^ 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 flowers.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template argument deduction/substitution failed: flowers.cpp:40:82: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int' x1 = max(1ll, x1), y1 = max(1ll, y1), x2 = max(1ll, x2), y2 = max(1ll, y2); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema flowers 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ă.