Language: C++

#icnlude<iostream>
#include<vector>
using namespace std;

int main(){
int n,m;
long long ans=0,sum=0;
cin>>n>>m;
vector<long long> a(n);
for(int i=0;i<n;i++){
cin>>a[i];
ans+=a[i];
}
for(int j=0;j<m;j++){
  int x=0;
for(int i=0;i<n;i++){
  x=max(x,a[i]);
}
for(int i=0;i<n;i++){
if(a==x){
ansｰ=a[i]/2;
break;
}
}
}
cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #icnlude; did you mean #include?
    1 | #icnlude<iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:1: error: 'cin' was not declared in this scope
    8 | cin>>n>>m;
      | ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<vector>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:17:8: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
   17 |   x=max(x,a[i]);
      |     ~~~^~~~~~~~
In file included from /usr/include/c++/14/vector:62,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:17:8: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   17 |   x=max(x,a[i]);
      |     ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
a.cc:20:5: error: no match for 'operator==' (operand types are 'std::vector<long long int>' and 'int')
   20 | if(a==x){
      |    ~^~~
      |    |  |
      |    |  int
      |    std::vector<long long int>
In file included from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1033 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note:   template argument deduction/substitution failed:
a.cc:20:7: note:   'std::vector<long long int>' is not derived from 'const std::pair<_T1, _T2>'
   20 | if(a==x){
      |       ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  441 |     operator==(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note:   template argument deduction/substitution failed:
a.cc:20:7: note:   'std::vector<long long int>' is not derived from 'const std::reverse_iterator<_Iterator>'
   20 | if(a==x){
      |       ^
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  486 |     operator==(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note:   template argument deduction/substitution failed:
a.cc:20:7: note:   'std::vector<long long int>' is not derived from 'const std::reverse_iterator<_Iterator>'
   20 | if(a==x){
      |       ^
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1667 |     operator==(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note:   template argument deduction/substitution failed:
a.cc:20:7: note:   'std::vector<long long int>' is not derived from 'const std::move_iterator<_IteratorL>'
   20 | if(a==x){
      |       ^
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1737 |     operator==(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note:   template argument deduction/substitution failed:
a.cc:20:7: note:   'std::vector<long long int>' is not derived from 'const std::move_iterator<_IteratorL>'
   20 | if(a==x){
      |       ^
In file included from /usr/include/c++/14/vector:63:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_Tp1>&, const allocator<_T2>&)'
  235 |     operator==(const allocator<_T1>&, const allocator<_T2>&)
      |     ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note:   template argument deduction/substitution failed:
a.cc:20:7: note:   'std::vector<long long int>' is not derived from 'const std::allocator<_Tp1>'
   20 | if(a==x){
      |       ^
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:2050:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator==(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
 2050 |     operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2050:5: note:   template argument deduction/substitution failed:
a.cc:20:7: note:   mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
   20 | if(a==x){
      |       ^
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:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
 2558 |     operator==(const tuple<_TElements...>& __t,
      |     ^~~~~~~~
/usr/include/c++/14/tuple:2558:5: note:   template argument deduction/substitution failed:
a.cc:20:7: note:   'std::vector<long long int>' is not derived from 'const std::tuple<_UTypes ...>'
   20 | if(a==x){
      |       ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33,
                 from /usr/include/c++/14/bits/allocator.h:46:
/usr/include/c++/14/bits/new_allocator.h:215:9: note: candidate: 'template<class _Up> bool std::operator==(const __new_allocator<long long int>&, const __new_allocator<_Tp>&)'
  215 |         operator==(const __new_allocator&, const __new_allocator<_Up>&)
      |         ^~~~~~~~
/usr/include/c++/14/bits/new_allocator.h:215:9: note:   template argument deduction/substitution failed:
a.cc:20:7: note:   mismatched types 'const std::__new_allocator<_Tp>' and 'int'
   20 | if(a==x){
      |       ^
/usr/include/c++/14/bits/allocator.h:214:7: note: candidate: 'bool std::operator==(const allocator<long long int>&, const allocator<long long int>&)'
  214 |       operator==(const allocator&, const allocator&) _GLIBCXX_NOTHROW
      |       ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:214:18: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'const std::allocator<long long int>&'
  214 |       operator==(const allocator&, const allocator&) _GLIBCXX_NOTHROW
      |                  ^~~~~~~~~~~~~~~~
a.cc:21:1: error: 'ans\U0000ff70' was not declared in this scope
   21 | ansｰ=a[i]/2;
      | ^~~~
a.cc:26:1: error: 'cout' was not declared in this scope
   26 | cout<<ans<<endl;
      | ^~~~
a.cc:26:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:12: error: 'endl' was not declared in this scope
   26 | cout<<ans<<endl;
      |            ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<vector>
  +++ |+#include <ostream>
    3 | using namespace std;