Language: C++

#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>
#include<limits>
#include<bitset>
#include<functional>
#include<type_traits>
#include<queue>
#include<stack>
#include<array>
#include<random>
#include<utility>
#include<cstdlib>
#include<ctime>

using namespace std;

#define rep(i,n) for(int i=0;i<(int)n;i++)

int main(){
    int N,M;
   cin>>N>>M;
   vector<int> value;
   for(int i=0;i<N:i++){
       cin>>value.at(i);
   }
   for(int i=0;i<M:i++){
   sort(value.begin(),value.end(),greater<int>());
   value.at(0)/=2;
   }
   int64_t sum=0;
   for(int i=0;i<N:i++){
       sum+=value.at(i);
   }
   cout<<sum<<endl;
    return 0; 
}




Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   28 |    for(int i=0;i<N:i++){
      |                ^
a.cc:28:19: error: found ':' in nested-name-specifier, expected '::'
   28 |    for(int i=0;i<N:i++){
      |                   ^
      |                   ::
a.cc:28:18: error: 'N' is not a class, namespace, or enumeration
   28 |    for(int i=0;i<N:i++){
      |                  ^
a.cc:31:4: error: expected primary-expression before 'for'
   31 |    for(int i=0;i<M:i++){
      |    ^~~
a.cc:30:5: error: expected ';' before 'for'
   30 |    }
      |     ^
      |     ;
   31 |    for(int i=0;i<M:i++){
      |    ~~~
a.cc:31:4: error: expected primary-expression before 'for'
   31 |    for(int i=0;i<M:i++){
      |    ^~~
a.cc:30:5: error: expected ')' before 'for'
   30 |    }
      |     ^
      |     )
   31 |    for(int i=0;i<M:i++){
      |    ~~~
a.cc:28:7: note: to match this '('
   28 |    for(int i=0;i<N:i++){
      |       ^
a.cc:31:16: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   31 |    for(int i=0;i<M:i++){
      |                ^
a.cc:31:19: error: found ':' in nested-name-specifier, expected '::'
   31 |    for(int i=0;i<M:i++){
      |                   ^
      |                   ::
a.cc:31:18: error: 'M' is not a class, namespace, or enumeration
   31 |    for(int i=0;i<M:i++){
      |                  ^
a.cc:36:4: error: expected primary-expression before 'for'
   36 |    for(int i=0;i<N:i++){
      |    ^~~
a.cc:35:18: error: expected ')' before 'for'
   35 |    int64_t sum=0;
      |                  ^
      |                  )
   36 |    for(int i=0;i<N:i++){
      |    ~~~            
a.cc:31:7: note: to match this '('
   31 |    for(int i=0;i<M:i++){
      |       ^
a.cc:36:16: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   36 |    for(int i=0;i<N:i++){
      |                ^
a.cc:36:19: error: found ':' in nested-name-specifier, expected '::'
   36 |    for(int i=0;i<N:i++){
      |                   ^
      |                   ::
a.cc:36:18: error: 'N' is not a class, namespace, or enumeration
   36 |    for(int i=0;i<N:i++){
      |                  ^
a.cc:40:5: error: expected primary-expression before 'return'
   40 |     return 0;
      |     ^~~~~~
a.cc:39:20: error: expected ')' before 'return'
   39 |    cout<<sum<<endl;
      |                    ^
      |                    )
   40 |     return 0;
      |     ~~~~~~          
a.cc:36:7: note: to match this '('
   36 |    for(int i=0;i<N:i++){
      |       ^