Language: C++

#include<cstdio>
#include<vector>
using namespace std;
vector<int> Na;//???????´???????
vector<int> Ma;
vector<int> Nw;//?????¨????????????????????????
vector<int> Mw;
int main(void){
	int i,j,ans=0,a=0,N=0,M=0;
	scanf("%d %d",&N,&M);
	Na.push_back(0);
	Ma.push_back(0);
	for(i=0;i<N;i++){
		scanf("%d",&a);
		a+=Na[i];
		Na.push_back(a);
	}
	for(i=0;i<M;i++){
		scanf("%d",&a);
		a+=Ma[i];
		Ma.push_back(a);
	}
	for(i=0;i<N;i++){
		for(j=i+1;j<N;j++){
			Nw.push_back(Na[j]-Na[i])
		}
	}
	for(i=0;i<M;i++){
		for(j=i+1;j<M;j++){
			Mw.push_back(Ma[j]-Ma[i])
		}
	}
	sort(Nw.begin(),Nw.end());
	sort(Mw.begin(),Mw.end());
	for(i=0;i<Nw.end();i++){
		ans+=Mw.lower_bound(Mw.begin(),Mw.end(),Nw[i])-Mw.upper_bound(Mw.begin(),Mw.end(),Nw[i]);
	}
	printf("%d",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:50: error: expected ';' before '}' token
   25 |                         Nw.push_back(Na[j]-Na[i])
      |                                                  ^
      |                                                  ;
   26 |                 }
      |                 ~                                 
a.cc:30:50: error: expected ';' before '}' token
   30 |                         Mw.push_back(Ma[j]-Ma[i])
      |                                                  ^
      |                                                  ;
   31 |                 }
      |                 ~                                 
a.cc:33:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   33 |         sort(Nw.begin(),Nw.end());
      |         ^~~~
      |         short
a.cc:35:18: error: no match for 'operator<' (operand types are 'int' and 'std::vector<int>::iterator')
   35 |         for(i=0;i<Nw.end();i++){
      |                 ~^~~~~~~~~
      |                 |       |
      |                 int     std::vector<int>::iterator
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/vector:62,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1045 |     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note:   template argument deduction/substitution failed:
a.cc:35:26: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
   35 |         for(i=0;i<Nw.end();i++){
      |                          ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  448 |     operator<(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note:   template argument deduction/substitution failed:
a.cc:35:26: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   35 |         for(i=0;i<Nw.end();i++){
      |                          ^
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  493 |     operator<(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note:   template argument deduction/substitution failed:
a.cc:35:26: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   35 |         for(i=0;i<Nw.end();i++){
      |                          ^
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1694 |     operator<(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note:   template argument deduction/substitution failed:
a.cc:35:26: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   35 |         for(i=0;i<Nw.end();i++){
      |                          ^
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1760 |     operator<(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note:   template argument deduction/substitution failed:
a.cc:35:26: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   35 |         for(i=0;i<Nw.end();i++){
      |                          ^
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
 2089 |     operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2089:5: note:   template argument deduction/substitution failed:
a.cc:35:26: note:   mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
   35 |         for(i=0;i<Nw.end();i++){
      |                          ^
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/vector:87:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
 2600 |     operator<(const tuple<_TElements...>& __t,
      |     ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note:   template argument deduction/substitution failed:
a.cc:35:26: note:   mismatched types 'const std::tuple<_UTypes ...>' and 'int'
   35 |         for(i=0;i<Nw.end();i++){
      |                          ^
/usr/include/c++/14/bits/stl_iterator.h:1241:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_IteratorL, _Container>&, const __normal_iterator<_IteratorR, _Container>&)'
 1241 |     operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1241:5: note:   template argument deduction/substitution failed:
a.cc:35:26: note:   mismatched types 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>' and 'int'
   35 |         for(i=0;i<Nw.end();i++){
      |                          ^
/usr/include/c++/14/bits/stl_iterator.h:1249:5: note: candidate: 'template<class _Iterator, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_Iterator, _Container>&, const __normal_iterator<_Iterator, _Container>&)'
 1249 |     operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1249:5: note:   template argument deduction/substitution failed:
a.cc:35:26: note:   mismatched types 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>' and 'int'
   35 |         for(i=0;i<Nw.end();i++){
      |                          ^
a.cc:36:25: error: 'class std::vector<int>' has no member named 'lower_bound'
   36 |                 ans+=Mw.lower_bound(Mw.begin(),Mw.end(),Nw[i])-Mw.upper_bound(Mw.begin(),Mw.end(),Nw[i]);
      |                         ^~~~~~~~~~~
a.cc:36:67: error: 'class std::vector<int>' has no member named 'upper_bound'
   36 |                 ans+=Mw.lower_bound(Mw.begin(),Mw.end(),Nw[i])-Mw.upper_bound(Mw.begin(),Mw.end(),Nw[i]);
      |                                                                   ^~~~~~~~~~~