202022026-01-04 19:24:34algoproA szomjas pincércpp17Compilation error
// UUID: 91e95be7-11b1-4543-bcb6-02031459769f
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, s=0;
	cin>>n;
	vector <int> v(n);
	for (int i=0; i<n; i++){
		cin>>v[i];
	}
	for (int i=0; i<n-1; i++){       // i<n-ig kell menni, különben az utolsó elemet nem nézi
		if(v[i]>0){  //
			s+=v[i]-1;
		}
	}
	cout<<v-s;               //az s-et kell csak kiirni!! vektorból nem tudsz kivonni egy számot egyébként sem, csak a vektor egy eleméből
}
Compilation error
open /var/local/lib/isolate/404/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:17:16: error: no match for 'operator-' (operand types are 'std::vector<int>' and 'int')
   17 |         cout<<v-s;               //az s-et kell csak kiirni!! vektorból nem tudsz kivonni egy számot egyébként sem, csak a vektor egy eleméből
      |               ~^~
      |               | |
      |               | int
      |               std::vector<int>
In file included from /usr/include/c++/12/bits/stl_algobase.h:67,
                 from /usr/include/c++/12/bits/specfun.h:45,
                 from /usr/include/c++/12/cmath:1935,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:41,
                 from main.cpp:2:
/usr/include/c++/12/bits/stl_iterator.h:621:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  621 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:621:5: note:   template argument deduction/substitution failed:
main.cpp:17:17: note:   'std::vector<int>' is not derived from 'const std::reverse_iterator<_Iterator>'
   17 |         cout<<v-s;               //az s-et kell csak kiirni!! vektorból nem tudsz kivonni egy számot egyébként sem, csak a vektor egy eleméből
      |                 ^
/usr/include/c++/12/bits/stl_iterator.h:1778:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1778 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/12/bits/stl_iterator.h:1778:5: note:   template argument deduction/substitution failed:
main.cpp:17:17: note:   'std::vector<int>' is not derived from 'const std::move_iterator<_IteratorL>'
   17 |         cout<<v-s;...