#4462
ashima
Se dă un șir A
, ale cărui elemente sunt definite prin relația \( {A}_{i} = {i}^{k} \cdot {2}^{i} \) pentru orice 1 ≤ i
, unde K
este un număr natural dat. Elementele acestui șir se așează într-o matrice M
, formată din L
linii și C
coloane. Ashima vă cere să răspundeți la Q
cerințe de forma: \(l_1\ l_2\ c_1\ c_2\) : care este suma elementelor \(M_{i,j}\) din matricea M
astfel încât \(l_1 \leq i\leq l_2\) și \( c_1 \leq j \leq c_2\)?
Lot informatică 2023
Problema | ashima | Operații I/O |
![]() ashima.in /ashima.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 256 MB
/
Stivă 64 MB
|
Id soluție | #51033161 | Utilizator | |
Fișier | ashima.cpp | Dimensiune | 1.62 KB |
Data încărcării | 20 Mai 2024, 14:34 | Scor / rezultat | Eroare de compilare |
ashima.cpp: In function 'int main()': ashima.cpp:44:22: error: 'make_tuple' is not a member of 'std' queries[i] = std::make_tuple(l1, l2, c1, c2); ^ ashima.cpp:50:9: error: 'tie' is not a member of 'std' std::tie(l1, l2, c1, c2) = queries[i]; ^ In file included from /usr/include/c++/4.8/vector:64:0, from ashima.cpp:2: /usr/include/c++/4.8/bits/stl_vector.h: In instantiation of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::reference = std::tuple<int, int, int, int>&; std::vector<_Tp, _Alloc>::size_type = unsigned int]': ashima.cpp:44:18: required from here /usr/include/c++/4.8/bits/stl_vector.h:771:41: error: invalid use of incomplete type 'class std::tuple<int, int, int, int>' { return *(this->_M_impl._M_start + __n); } ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, 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 ashima.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:83:11: error: declaration of 'class std::tuple<int, int, int, int>' class tuple; ^ In file included from /usr/include/c++/4.8/vector:64:0, from ashima.cpp:2: /usr/include/c++/4.8/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >]': /usr/include/c++/4.8/bits/stl_vector.h:270:23: required from 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<std::tuple<int, int, int, int> >]' ashima.cpp:40:58: required from here /usr/include/c++/4.8/bits/stl_vector.h:161:9: error: invalid use of incomplete type 'class std::tuple<int, int, int, int>' - this->_M_impl._M_start); } ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, 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 ashima.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:83:11: error: declaration of 'class std::tuple<int, int, int, int>' class tuple; ^ In file included from /usr/include/c++/4.8/vector:64:0, from ashima.cpp:2: /usr/include/c++/4.8/bits/stl_vector.h: In instantiation of 'void std::_Vector_base<_Tp, _Alloc>::_M_create_storage(std::size_t) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::size_t = unsigned int]': /usr/include/c++/4.8/bits/stl_vector.h:136:30: required from 'std::_Vector_base<_Tp, _Alloc>::_Vector_base(std::size_t, const allocator_type&) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::size_t = unsigned int; std::_Vector_base<_Tp, _Alloc>::allocator_type = std::allocator<std::tuple<int, int, int, int> >]' /usr/include/c++/4.8/bits/stl_vector.h:270:23: required from 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<std::tuple<int, int, int, int> >]' ashima.cpp:40:58: required from here /usr/include/c++/4.8/bits/stl_vector.h:183:59: error: invalid use of incomplete type 'class std::tuple<int, int, int, int>' this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n; ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, 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 ashima.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:83:11: error: declaration of 'class std::tuple<int, int, int, int>' class tuple; ^ In file included from /usr/include/c++/4.8/vector:62:0, from ashima.cpp:2: /usr/include/c++/4.8/bits/stl_construct.h: In instantiation of 'void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = std::tuple<int, int, int, int>*]': /usr/include/c++/4.8/bits/stl_construct.h:151:31: required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with _ForwardIterator = std::tuple<int, int, int, int>*; _Tp = std::tuple<int, int, int, int>]' /usr/include/c++/4.8/bits/stl_vector.h:416:30: required from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >]' ashima.cpp:40:58: required from here /usr/include/c++/4.8/bits/stl_construct.h:127:27: error: invalid use of incomplete type '_Value_type {aka class std::tuple<int, int, int, int>}' __destroy(__first, __last); ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, 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 ashima.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:83:11: error: declaration of '_Value_type {aka class std::tuple<int, int, int, int>}' class tuple; ^ In file included from /usr/include/c++/4.8/vector:63:0, from ashima.cpp:2: /usr/include/c++/4.8/bits/stl_uninitialized.h: In instantiation of 'void std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = std::tuple<int, int, int, int>*; _Size = unsigned int]': /usr/include/c++/4.8/bits/stl_uninitialized.h:605:50: required from 'void std::__uninitialized_default_n_a(_ForwardIterator, _Size, std::allocator<_Tp>&) [with _ForwardIterator = std::tuple<int, int, int, int>*; _Size = unsigned int; _Tp = std::tuple<int, int, int, int>]' /usr/include/c++/4.8/bits/stl_vector.h:1225:28: required from 'void std::vector<_Tp, _Alloc>::_M_default_initialize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::size_type = unsigned int]' /usr/include/c++/4.8/bits/stl_vector.h:271:34: required from 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<std::tuple<int, int, int, int> >]' ashima.cpp:40:58: required from here /usr/include/c++/4.8/bits/stl_uninitialized.h:544:33: error: invalid use of incomplete type '_ValueType {aka class std::tuple<int, int, int, int>}' __uninit_default_n(__first, __n); ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, 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 ashima.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:83:11: error: declaration of '_ValueType {aka class std::tuple<int, int, int, int>}' class tuple; ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/c++allocator.h:33:0, from /usr/include/c++/4.8/bits/allocator.h:46, from /usr/include/c++/4.8/string:41, 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 ashima.cpp:1: /usr/include/c++/4.8/ext/new_allocator.h: In instantiation of '_Tp* __gnu_cxx::new_allocator<_Tp>::allocate(__gnu_cxx::new_allocator<_Tp>::size_type, const void*) [with _Tp = std::tuple<int, int, int, int>; __gnu_cxx::new_allocator<_Tp>::pointer = std::tuple<int, int, int, int>*; __gnu_cxx::new_allocator<_Tp>::size_type = unsigned int]': /usr/include/c++/4.8/bits/stl_vector.h:168:25: required from 'std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::_Vector_base<_Tp, _Alloc>::pointer = std::tuple<int, int, int, int>*; std::size_t = unsigned int]' /usr/include/c++/4.8/bits/stl_vector.h:181:25: required from 'void std::_Vector_base<_Tp, _Alloc>::_M_create_storage(std::size_t) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::size_t = unsigned int]' /usr/include/c++/4.8/bits/stl_vector.h:136:30: required from 'std::_Vector_base<_Tp, _Alloc>::_Vector_base(std::size_t, const allocator_type&) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::size_t = unsigned int; std::_Vector_base<_Tp, _Alloc>::allocator_type = std::allocator<std::tuple<int, int, int, int> >]' /usr/include/c++/4.8/bits/stl_vector.h:270:23: required from 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<std::tuple<int, int, int, int> >]' ashima.cpp:40:58: required from here /usr/include/c++/4.8/ext/new_allocator.h:104:54: error: invalid application of 'sizeof' to incomplete type 'std::tuple<int, int, int, int>' return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp))); ^ /usr/include/c++/4.8/ext/new_allocator.h: In instantiation of '__gnu_cxx::new_allocator<_Tp>::size_type __gnu_cxx::new_allocator<_Tp>::max_size() const [with _Tp = std::tuple<int, int, int, int>; __gnu_cxx::new_allocator<_Tp>::size_type = unsigned int]': /usr/include/c++/4.8/ext/new_allocator.h:101:10: required from '_Tp* __gnu_cxx::new_allocator<_Tp>::allocate(__gnu_cxx::new_allocator<_Tp>::size_type, const void*) [with _Tp = std::tuple<int, int, int, int>; __gnu_cxx::new_allocator<_Tp>::pointer = std::tuple<int, int, int, int>*; __gnu_cxx::new_allocator<_Tp>::size_type = unsigned int]' /usr/include/c++/4.8/bits/stl_vector.h:168:25: required from 'std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::_Vector_base<_Tp, _Alloc>::pointer = std::tuple<int, int, int, int>*; std::size_t = unsigned int]' /usr/include/c++/4.8/bits/stl_vector.h:181:25: required from 'void std::_Vector_base<_Tp, _Alloc>::_M_create_storage(std::size_t) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::size_t = unsigned int]' /usr/include/c++/4.8/bits/stl_vector.h:136:30: required from 'std::_Vector_base<_Tp, _Alloc>::_Vector_base(std::size_t, const allocator_type&) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::size_t = unsigned int; std::_Vector_base<_Tp, _Alloc>::allocator_type = std::allocator<std::tuple<int, int, int, int> >]' /usr/include/c++/4.8/bits/stl_vector.h:270:23: required from 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<std::tuple<int, int, int, int> >]' ashima.cpp:40:58: required from here /usr/include/c++/4.8/ext/new_allocator.h:114:35: error: invalid application of 'sizeof' to incomplete type 'std::tuple<int, int, int, int>' { return size_t(-1) / sizeof(_Tp); } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ashima 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ă.