Saldainių dalybos

Taškai: 0

Compile: FAIL

saldainiai.cpp: In function ‘int main()’: saldainiai.cpp:11:34: error: conversion from ‘int’ to non-scalar type ‘std::vector<int>’ requested vector<int> max_n = 1000*100+100; ^ saldainiai.cpp:14:26: error: size of array ‘dp’ has non-integral type ‘std::vector<int>’ vector<bool> dp[max_n]; ^ saldainiai.cpp:15:11: error: no match for ‘operator=’ (operand types are ‘std::vector<bool>’ and ‘bool’) dp[0] = true; ^ In file included from /usr/include/c++/5/vector:65:0, from /usr/include/c++/5/bits/random.h:34, from /usr/include/c++/5/random:49, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:64, from saldainiai.cpp:1: /usr/include/c++/5/bits/stl_bvector.h:680:5: note: candidate: std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>] operator=(const vector& __x) ^ /usr/include/c++/5/bits/stl_bvector.h:680:5: note: no known conversion for argument 1 from ‘bool’ to ‘const std::vector<bool>&’ /usr/include/c++/5/bits/stl_bvector.h:711:5: note: candidate: std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>] operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move()) ^ /usr/include/c++/5/bits/stl_bvector.h:711:5: note: no known conversion for argument 1 from ‘bool’ to ‘std::vector<bool>&&’ /usr/include/c++/5/bits/stl_bvector.h:741:5: note: candidate: std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::initializer_list<bool>) [with _Alloc = std::allocator<bool>] operator=(initializer_list<bool> __l) ^ /usr/include/c++/5/bits/stl_bvector.h:741:5: note: no known conversion for argument 1 from ‘bool’ to ‘std::initializer_list<bool>’ saldainiai.cpp:22:22: error: cannot convert ‘std::vector<int>’ to ‘int’ in initialization for (int j = max_n; j>=0; j--) ^ saldainiai.cpp:24:21: error: could not convert ‘dp[j]’ from ‘std::vector<bool>’ to ‘bool’ if (dp[j]) {dp[sald[i]+j] = true;} ^ saldainiai.cpp:24:39: error: no match for ‘operator=’ (operand types are ‘std::vector<bool>’ and ‘bool’) if (dp[j]) {dp[sald[i]+j] = true;} ^ In file included from /usr/include/c++/5/vector:65:0, from /usr/include/c++/5/bits/random.h:34, from /usr/include/c++/5/random:49, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:64, from saldainiai.cpp:1: /usr/include/c++/5/bits/stl_bvector.h:680:5: note: candidate: std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>] operator=(const vector& __x) ^ /usr/include/c++/5/bits/stl_bvector.h:680:5: note: no known conversion for argument 1 from ‘bool’ to ‘const std::vector<bool>&’ /usr/include/c++/5/bits/stl_bvector.h:711:5: note: candidate: std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>] operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move()) ^ /usr/include/c++/5/bits/stl_bvector.h:711:5: note: no known conversion for argument 1 from ‘bool’ to ‘std::vector<bool>&&’ /usr/include/c++/5/bits/stl_bvector.h:741:5: note: candidate: std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::initializer_list<bool>) [with _Alloc = std::allocator<bool>] operator=(initializer_list<bool> __l) ^ /usr/include/c++/5/bits/stl_bvector.h:741:5: note: no known conversion for argument 1 from ‘bool’ to ‘std::initializer_list<bool>’ saldainiai.cpp:31:17: error: could not convert ‘dp[i]’ from ‘std::vector<bool>’ to ‘bool’ if (dp[i]){ ^

nr.resulttimemessage