criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,all;x;
  cin >> n;
  vector<int>n;
  for(int i=0;i<n;i++){
    cin >> p.at(i);
  }
  all=0;
  for(int i=0;i<n;i++){
    all += p.at(0) 
  }
  x = p.at(0);
  for(int i=1;i<n;i++){
    if(x<=p.at(i)){
      x = p.at(i);
    }
  }
  cout << all - x/2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: 'x' was not declared in this scope
    4 |   int n,all;x;
      |             ^
a.cc:6:14: error: conflicting declaration 'std::vector<int> n'
    6 |   vector<int>n;
      |              ^
a.cc:4:7: note: previous declaration as 'int n'
    4 |   int n,all;x;
      |       ^
a.cc:8:12: error: 'p' was not declared in this scope
    8 |     cin >> p.at(i);
      |            ^
a.cc:12:12: error: 'p' was not declared in this scope
   12 |     all += p.at(0)
      |            ^
a.cc:14:7: error: 'p' was not declared in this scope
   14 |   x = p.at(0);
      |       ^
Language: C++

#include <bits/stdc++.h>
#define INF 1000000000
using namespace std;

int main() {

int N,sum=0; cin>>N;
  vector<int> A(N);
  for(int i=0;i<N;i++){
    cin>>A[i]; }
  sort(A.begin(),A,end());
  for(int i=0; i<N-1;i++){
    sum+=A[i];}
  cout<<sum+(A[N-1]/2)<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: no matching function for call to 'end()'
   11 |   sort(A.begin(),A,end());
      |                    ~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   candidate expects 1 argument, 0 provided
Language: C++

//無断転用の一切を禁ずるよ//////////////////////////
#include<iostream>
#include<stdio.h>//printするよ
#include<vector>
#include<algorithm>//辞書順はnext_permutationだよ
#include<set>
#include<string>
#include<string.h>
#include<time.h>
#include<random>
#include<cmath>
#include<math.h>
#include<queue>
#include<time.h>
#include<iomanip>
#include<utility>//swapで数値交換するよ
#define rt "\n"//改行を最速化するよ
#define rep(i,n) for(int i=0;i<n;i++)
#define rop(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define yes(ans) if(ans)cout<<"yes"<<rt;else cout<<"no"<<rt;
#define Yes(ans) if(ans)cout<<"Yes"<<rt;else cout<<"No"<<rt;
#define YES(ans) if(ans)cout<<"YES"<<rt;else cout<<"NO"<<rt;
#define sort(s) sort(s.begin(),s.end())
#define reve(s) reverse(s.begin(),s.end())
#define asas int ans=0
#define cncn int cnt=0
#define smsm int sum=0
#define please return
#define AC 0
/////////////////////////////////////////////////
using namespace std;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vcha;
typedef long long int llint;
typedef pair<int, int> pint;
typedef pair<llint, llint> pllint;
typedef vector<llint> vllint;
typedef vector<pint> vpint;
typedef vector<pair<llint, llint>> vpllint;
typedef vector<vector<int>> vvint;
typedef vector<vector<llint>> vvllint;
typedef vector<vector<pint>> vvpint;
typedef vector<bool> vbool; 
//////////////////////////////////////////////////
//最大公約数（GCD）を求めるよ
//最小公倍数（LCM）は＜＜　（A＋B）÷ GCD　 ＞＞で求まるよ

long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}


int main(void) {
	int n;
	cin >> n;
	vint p(n);
	rep(i, n)cin >> p[i];
	cncn,asas;
	rep(i, n) {
		ans += p[i];
		if (cnt < p[i]) {
			cnt += p[i];
		}
	}
	ans -= cnt / 2;
	cout << ans << rt;
	please AC;
}

// abc : 141 , aoj : ITP1_6_D
//sort, abs, swap, reverse, max, min
//__gcd, sbstring, erase, push_back,stoll、stoi

Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: expected unqualified-id before 'int'
   26 | #define asas int ans=0
      |              ^~~
a.cc:61:14: note: in expansion of macro 'asas'
   61 |         cncn,asas;
      |              ^~~~
a.cc:63:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   63 |                 ans += p[i];
      |                 ^~~
      |                 abs
a.cc:68:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   68 |         ans -= cnt / 2;
      |         ^~~
      |         abs
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  int N,p[N],sum = 0;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> p.at(i);
  sort(p.begin(), p.end()); 
  reverse(p.begin(), p.end());
  for (int i = 0; i < N; i++){
    if (i == 0) p[i] /= 2;
    sum += p[i];
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:40: error: request for member 'at' in 'p', which is of non-class type 'int [N]'
    7 |   for (int i = 0; i < N; i++) cin >> p.at(i);
      |                                        ^~
a.cc:8:10: error: request for member 'begin' in 'p', which is of non-class type 'int [N]'
    8 |   sort(p.begin(), p.end());
      |          ^~~~~
a.cc:8:21: error: request for member 'end' in 'p', which is of non-class type 'int [N]'
    8 |   sort(p.begin(), p.end());
      |                     ^~~
a.cc:9:13: error: request for member 'begin' in 'p', which is of non-class type 'int [N]'
    9 |   reverse(p.begin(), p.end());
      |             ^~~~~
a.cc:9:24: error: request for member 'end' in 'p', which is of non-class type 'int [N]'
    9 |   reverse(p.begin(), p.end());
      |                        ^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> v(n);
  int m=0,mi=0;
  for (int i=0; i< n;i++){
    cin >> v[i];
    if (v[i] > m){
      m=v[i];
      mi=i;
    }
  }
  int sum=0;
  for (int j=0;j < n;j++){
    if (i==mi) {
      sum+=v[i]/2;
      continue;
    }
    sum+=v[i];
  }
  cout << sum << endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'i' was not declared in this scope
   19 |     if (i==mi) {
      |         ^
a.cc:23:12: error: 'i' was not declared in this scope
   23 |     sum+=v[i];
      |            ^
Language: C++

#include<iostream>
using namespace std;
#defiine lli long long int
#include<vector>
#include<algorithm>
int main(){
  lli n,sum=0;
  cin>>n;
  vector<lli>v(n);
  for(lli i=0;i<n;i++){
    cin>>v[i];
    sum+=v[i];
  }
  lli k=*max_element(v.begin(),v.end());
  sum-=k/2;
  cout<<sum;
  return 0;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #defiine; did you mean #define?
    3 | #defiine lli long long int
      |  ^~~~~~~
      |  define
a.cc: In function 'int main()':
a.cc:7:3: error: 'lli' was not declared in this scope; did you mean 'lldiv'?
    7 |   lli n,sum=0;
      |   ^~~
      |   lldiv
a.cc:8:8: error: 'n' was not declared in this scope
    8 |   cin>>n;
      |        ^
a.cc:9:13: error: template argument 2 is invalid
    9 |   vector<lli>v(n);
      |             ^
a.cc:10:10: error: expected ';' before 'i'
   10 |   for(lli i=0;i<n;i++){
      |          ^~
      |          ;
a.cc:10:15: error: 'i' was not declared in this scope
   10 |   for(lli i=0;i<n;i++){
      |               ^
a.cc:12:5: error: 'sum' was not declared in this scope
   12 |     sum+=v[i];
      |     ^~~
a.cc:14:6: error: expected ';' before 'k'
   14 |   lli k=*max_element(v.begin(),v.end());
      |      ^~
      |      ;
a.cc:15:3: error: 'sum' was not declared in this scope
   15 |   sum-=k/2;
      |   ^~~
a.cc:15:8: error: 'k' was not declared in this scope
   15 |   sum-=k/2;
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
 
int main() {
 int N;
 cin >> N;
 vector<int> A(N);
 int sum = 0;
 for(int i = 0; i < N; i++){
 cin >> A.at(i);
 sum += A.at(i);
 }
 int x;
 x = max_element({A.begin(),A.end()});
 cout << sum - (x / 2);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: no matching function for call to 'max_element(<brace-enclosed initializer list>)'
   15 |  x = max_element({A.begin(),A.end()});
      |      ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5641:5: note: candidate: 'template<class _FIter> constexpr _FIter std::max_element(_FIter, _FIter)'
 5641 |     max_element(_ForwardIterator __first, _ForwardIterator __last)
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5641:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:5666:5: note: candidate: 'template<class _FIter, class _Compare> constexpr _FIter std::max_element(_FIter, _FIter, _Compare)'
 5666 |     max_element(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5666:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:524:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::max_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Compare)'
  524 | max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Compare __comp);
      | ^~~~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:524:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:528:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::max_element(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator)'
  528 | max_element(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
      | ^~~~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:528:1: note:   candidate expects 3 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
 
int main() {
 int N;
 cin >> N;
 vector<int> A(N);
 int sum = 0;
 for(int i = 0; i < N; i++){
 cin >> A.at(i);
 sum += A.at(i);
 }
 int x = max(A.begin(),A.end());
 cout << sum - (x / 2);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   14 |  int x = max(A.begin(),A.end());
      |          ~~~^~~~~~~~~~~~~~~~~~~
      |             |
      |             const __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
 
int main() {
 int N;
 cin >> N;
 vector<int> A(N);
 int sum = 0;
 for(int i = 0; i < N; i++){
 cin >> A.at(i);
 sum += A.at(i);
 }
 int x;
 x = max_element(A.begin(),A.end());
 cout << sum - (x / 2);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: cannot convert '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   15 |  x = max_element(A.begin(),A.end());
      |      ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
      |                 |
      |                 __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
 
int main() {
 int N;
 cin >> N;
 vector<int> A(N);
 int sum = 0;
 for(int i = 0; i < N; i++){
 cin >> A.at(i);
 sum += A.at(i);
 }
 int x;
 x = max(A.begin(),A.end());
 cout << sum - (x / 2);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in assignment
   15 |  x = max(A.begin(),A.end());
      |      ~~~^~~~~~~~~~~~~~~~~~~
      |         |
      |         const __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n
  int ans = 0, mx = 0;
  for(int i=0; i<n; i++) {
    int a; cin >> a; ans += a; mx = max(mx, a);
  }
  
  cout << (ans-mx/2) << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected ';' before 'int'
    6 |   cin >> n
      |           ^
      |           ;
    7 |   int ans = 0, mx = 0;
      |   ~~~      
a.cc:9:22: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     int a; cin >> a; ans += a; mx = max(mx, a);
      |                      ^~~
      |                      abs
a.cc:9:32: error: 'mx' was not declared in this scope
    9 |     int a; cin >> a; ans += a; mx = max(mx, a);
      |                                ^~
a.cc:12:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   cout << (ans-mx/2) << endl;
      |            ^~~
      |            abs
a.cc:12:16: error: 'mx' was not declared in this scope
   12 |   cout << (ans-mx/2) << endl;
      |                ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n
  int ans = 0, mx = 0;
  for(int i=0; i<n; i++) {
    int a; cin >> a; ans += a; mx = max(mx, a);
  }
  
  cout << ans-mx/2 << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected ';' before 'int'
    6 |   cin >> n
      |           ^
      |           ;
    7 |   int ans = 0, mx = 0;
      |   ~~~      
a.cc:9:22: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     int a; cin >> a; ans += a; mx = max(mx, a);
      |                      ^~~
      |                      abs
a.cc:9:32: error: 'mx' was not declared in this scope
    9 |     int a; cin >> a; ans += a; mx = max(mx, a);
      |                                ^~
a.cc:12:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   cout << ans-mx/2 << endl;
      |           ^~~
      |           abs
a.cc:12:15: error: 'mx' was not declared in this scope
   12 |   cout << ans-mx/2 << endl;
      |               ^~
Language: C++

#include <algorithm> // max
2 #include <iostream>
3 using namespace std;
4 int main(){
5 int N;
6 cin >> N;
7 int S = 0, M = 0;
8 for(int i = 0; i < N; ++i){ // ここでは商品番号を 0, 1, ..., N-1 とする
9 int p;
10 cin >> p;
11 S += p;
12 M = max(M, p); // M と p のうち大きい方。かなり便利! ちなみに小さい方は min
13 }
14 int ans = S - M / 2;
15 cout << ans << endl;
16 }

Compiler output:
a.cc:2:3: error: stray '#' in program
    2 | 2 #include <iostream>
      |   ^
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2 #include <iostream>
      | ^
a.cc:4:1: error: expected unqualified-id before numeric constant
    4 | 4 int main(){
      | ^
Language: Java

import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int[] pi = new int[N];
   for(int i = 0;i<N;i++)
   {
    pi[i] = sc.nextInt();
   }
   
   Arrays.sort(pi,Collections.reverseOrder());
   pi[0] = pi[0]/2;
   int ans =0;
   for(int i = 0;i<N;i++)
   {
    ans += pi[i]; 
   }
   System.out.println(ans);
 }
}

Compiler output:
Main.java:12: error: no suitable method found for sort(int[],Comparator<Object>)
   Arrays.sort(pi,Collections.reverseOrder());
         ^
    method Arrays.<T#1>sort(T#1[],Comparator<? super T#1>) is not applicable
      (inference variable T#1 has incompatible bounds
        equality constraints: int
        upper bounds: Object)
    method Arrays.<T#2>sort(T#2[],int,int,Comparator<? super T#2>) is not applicable
      (cannot infer type-variable(s) T#2
        (actual and formal argument lists differ in length))
  where T#1,T#2 are type-variables:
    T#1 extends Object declared in method <T#1>sort(T#1[],Comparator<? super T#1>)
    T#2 extends Object declared in method <T#2>sort(T#2[],int,int,Comparator<? super T#2>)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int[] pi = new int[N];
   for(int i = 0;i<N;i++)
   {
    pi[i] = sc.nextInt();
   }
   
   Arrays.sort(pi);
   pi.reverse();
   pi[0] = pi[0]/2;
   int ans =0;
   for(int i = 0;i<N;i++)
   {
    ans += pi[i]; 
   }
   System.out.println(ans);
 }
}

Compiler output:
Main.java:13: error: cannot find symbol
   pi.reverse();
     ^
  symbol:   method reverse()
  location: variable pi of type int[]
1 error
Language: Java

import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int[] pi = new int[N];
   for(int i = 0;i<N;i++)
   {
    pi[i] = sc.nextInt();
   }
   
   Arrays.sort(pi);
   pi.reverse();
   pi[0] == pi[0]/2;
   int ans =0;
   for(int i = 0;i<N;i++)
   {
    ans += pi[i]; 
   }
   System.out.println(ans);
 }
}

Compiler output:
Main.java:14: error: not a statement
   pi[0] == pi[0]/2;
         ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define F(n) for(int i=0;i<n;++i)

int main()
{
    int n;
    cin >> n;
    int p;
    priority_queue<int> pq;
    F(n){
        cin >> p;
        pq.push(p);
    }c
    int sum=pq.top()/2;
    if(!pq.empty()) pq.pop();
    F(n-1){
        sum += pq.top();
        if(!pq.empty()) pq.pop();
    }
    cout << sum << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:6: error: 'c' was not declared in this scope
   14 |     }c
      |      ^
a.cc:18:9: error: 'sum' was not declared in this scope
   18 |         sum += pq.top();
      |         ^~~
a.cc:21:13: error: 'sum' was not declared in this scope
   21 |     cout << sum << endl;
      |             ^~~
Language: Java

import java.util.Scanner;
import java.util.ArrayList;

public class main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int sum = 0;
    int max = -1;
    int max_index = -1;
    int[] array = new int[n];

    for(int i=0; i<n; i++){
      array[i] = sc.nextInt();
      if(array[i]>max){
        max = array[i];
        max_index = i;
      }
    }
    array[max_index] /= 2;
    for(int i=0; i<n; i++){
      sum += array[i];
    }

    System.out.println(sum);
  }

}

Compiler output:
Main.java:4: error: class main is public, should be declared in a file named main.java
public class main{
       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  
  int N;
  cin >> N;
  
  vector<int> p(N);
  
  int num = -1e9;
  int num2 = 0;
  
  for(int i = 0;i < N;++i){
    cin >> p[i];
  }
  
  for(int i = 0;i < N;++i){
    num = p(L[i],num);
  }
  
  num = num / 2;
  
  for(int i = 0;i < N;++i){
    num2 = num2 + p[i];
  }
  
  int num3 = num2 - num;
  
  cout << num3 << endl;
  
  
}




Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'L' was not declared in this scope
   19 |     num = p(L[i],num);
      |             ^
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
using namespace std;

int main(){
   int a,b[15],c;
  cin >> a;
  
  for(int i=0;i<a;i++){
    cin>>b[i];
  }

  sort(b,b+a,greater<int>());
  c = d[0]/2;
  for(int i =1;i<a;i++){
    c += d[i];
  }
  
  cout << c << endl;
}
    
  
 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'd' was not declared in this scope
   15 |   c = d[0]/2;
      |       ^
Language: Java

import java.util.*;

public class B {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] price = new int[n];
		int maxp = 0;
		int sum = 0;
		for( int i = 0; i < n; i++ ) {
			price[i] = in.nextInt();
			maxp = Math.max(price[i], maxp);
			sum += price[i];
		}
		System.out.println(sum-maxp+(maxp/2));
	}
}

Compiler output:
Main.java:3: error: class B is public, should be declared in a file named B.java
public class B {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std

int main(){
  int n;
  cin >> n;
  priority_queue<int> que;
  rep(i,n){
    int tmp;
    cin >> tmp;
    que.push(tmp);
  }
  int ans=0;
  ans += que.top()/2;
  que.pop();
  while(!que.empty()){
    ans+=que.top();
    que.pop();
  }
  cout << ans << endl;
}

Compiler output:
a.cc:3:20: error: expected ';' before 'int'
    3 | using namespace std
      |                    ^
      |                    ;
    4 | 
    5 | int main(){
      | ~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    int N, a = 0, sum = 0;
    cin >> N;
    for (int i = 0; i < N; i++) {
        int b;
        cin >> b;
        if (a < b) {
            a = b;
        }
        sum += b;
    }
    cout << sum - b / 2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: 'b' was not declared in this scope
   15 |     cout << sum - b / 2 << endl;
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main () {
	int n; cin >> n;
  	int a[n], m = 0;
  bool ok = 0;
 	for (int i =0 ; i < n; i++) {
      cin >> a[i];
      m = max(m,a[i]);
    }
  int ans = 0;
  for (int i = 0; i < n; i++) {
   	if (m == a[i] && !ok) {
      ok = 1;
      ans += a[i]/2;
    } else ans += a[i];
    
  }
  cout << a[i] << endl;
  
	return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'i' was not declared in this scope
   20 |   cout << a[i] << endl;
      |             ^
Language: C

N = int(input())
p = [int(input()) for i in range(N)]
p.sort()
hangaku = p[N-1]/2
sum = 0
for i in range(N) :
    sum += p[i]
sum -= hangaku
print(sum)


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N = int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:5: error: expected expression before 'int'
    1 | N = int(input())
      |     ^~~
Language: C++

#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main(){
    int n;cin>>n;
    vector<int> p(n);
    for(int i=0;i<n;i++){
        cin>>p[i];
    }
    sort(p.begin(),p.end());
    for(int i=0;i<n-1;i++){
        ans+=p[i];
    }
    ans+=p[n-1]/2;
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |         ans+=p[i];
      |         ^~~
      |         abs
a.cc:14:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |     ans+=p[n-1]/2;
      |     ^~~
      |     abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;cin>>n;
    vector<int> p(n);
    for(int i=0;i<n;i++){
        cin>>p[i];
    }
    sort(p.begin(),p.end());
    for(int i=0;i<n-1;i++){
        ans+=p[i];
    }
    ans+=p[n-1]/2;
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |         ans+=p[i];
      |         ^~~
      |         abs
a.cc:13:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |     ans+=p[n-1]/2;
      |     ^~~
      |     abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
  ll n,sum,maxi;
  cin>>n;
  sum=0;
  int a[n];
  maxi=0;
  rep(i,n){
    cin>>a[i];
    sum+=a[i];
    maxi=max(maxi,a[i]);
  }
  cout<<sum-maxi/2<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: no matching function for call to 'max(ll&, int&)'
   15 |     maxi=max(maxi,a[i]);
      |          ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/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:15:13: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   15 |     maxi=max(maxi,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
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:15:13: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   15 |     maxi=max(maxi,a[i]);
      |          ~~~^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
  ll n,sum;
  cin>>n;
  sum=0;
  int a[n];
  maxi=0;
  rep(i,n){
    cin>>a[i];
    sum+=a[i];
    maxi=max(maxi,a[i]);
  }
  cout<<sum-maxi/2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'maxi' was not declared in this scope
   11 |   maxi=0;
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin>>n;
    int a[n];
    int maxi=0;
    int wa=0;
    for(int i=0;i<n;i++) [
        cin>>a[i];
        maxi=max(maxi, a[i]);
        wa+=a[i];
    }
    cout<<wa-max/2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: warning: capture of variable 'std::cin' with non-automatic storage duration
   11 |         cin>>a[i];
      |         ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::istream std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:12: error: expected ',' before '>>' token
   11 |         cin>>a[i];
      |            ^~
      |            ,
a.cc:11:12: error: expected identifier before '>>' token
   11 |         cin>>a[i];
      |            ^~
a.cc:11:18: error: expected ']' before ';' token
   11 |         cin>>a[i];
      |                  ^
      |                  ]
a.cc: In lambda function:
a.cc:11:18: error: expected '{' before ';' token
a.cc: In function 'int main()':
a.cc:12:26: error: 'i' was not declared in this scope
   12 |         maxi=max(maxi, a[i]);
      |                          ^
a.cc: At global scope:
a.cc:15:5: error: 'cout' does not name a type
   15 |     cout<<wa-max/2<<endl;
      |     ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>

int main()
{
    int N;
    std::cin >> N;

    int p;
    int pmax = 0;
    int psum = 0;
    for (int i = 0; i < N; i++) {
        std::cin >> p;
        psum += p;
        pmax = std::max(pmmax, p);
    }

    std::cout << (psum - (pmax / 2)) << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: 'pmmax' was not declared in this scope; did you mean 'pmax'?
   15 |         pmax = std::max(pmmax, p);
      |                         ^~~~~
      |                         pmax
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  
  int n;
  cin >> n;
  
  vector<int> v(n);
  for(int i; i < n; i++)
    cin >> v.at(i);
  
  sort(v.begin(), v.end());
  
  int j =0;
  int s =0;
  
  while(j < n-1){
    s += v.at(j);
    j++;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:20:4: error: expected '}' at end of input
   20 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) {
		MyScanner in = new MyScanner();
		int n = in.nextInt();
		int[] p = in.nextIntArray(n);
		Arrays.sort(p);
		int sum = 0;
		for (int i = 0; i < p.length; i++) {
			if (i==p.length-1) {
				sum += p[i]/2;
			} else {
				sum += p[i];
			}
		}
		System.out.println(suma);
		
	}
	
	private static class MyScanner {
		static Scanner sc = new Scanner(System.in);
		
		String next() {
			return sc.next();
		}
		
		String nextLine() {
			return sc.nextLine();
		}
		
		int nextInt() {
			return Integer.parseInt(sc.next());
		}
		
		double nextDouble() {
			return Double.parseDouble(next());
		}
		
		long nextLong() {
			return Long.parseLong(next());
		}
		
		int[] nextIntArray(int n) {
			int[] array = new int[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextInt();
			}
			return array;
		}
		
		double[] nextDoubleArray(int n) {
			double[] array = new double[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextDouble();
			}
			return array;
		}
		
		long[] nextLongArray(int n) {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}
			return array;
		}
		
	}
}

Compiler output:
Main.java:17: error: cannot find symbol
		System.out.println(suma);
		                   ^
  symbol:   variable suma
  location: class Main
1 error
Language: C++

// Be name khoda
#include <bits/stdc++.h>
using namespace std;

const int MAX_N = 1e5 + 5;
int n;

int main() {
 	ios::sync_with_stdio(false), cin.tie(0);
  	cin >> n;
  	for (int i = 0; i < n; i++)
      	cin >> Arr[i];
  
  	sort(Arr, Arr + n);
  	int ans = 0;
  	for (int i = 0; i < n; i++)
      	ans += Arr[i];
  	ans -= Arr[n - 1] / 2;
  	cout << ans << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'Arr' was not declared in this scope
   12 |         cin >> Arr[i];
      |                ^~~
a.cc:14:14: error: 'Arr' was not declared in this scope
   14 |         sort(Arr, Arr + n);
      |              ^~~
Language: C

#include<stdio.h>
#include<string.h>

int main(){
	int n;
	scanf("%d", &n);
	int price[n];
	for(int i=0; i<n; i++){
		scanf("%d", price[i]);
	}
	
	int max=0, sum=0;
	for(int i=0; i<n; i++){
		sum+=price[i];
		if(max<price[i]) max=price[i];
	}
	printf("%d", sum-price/2);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:31: error: invalid operands to binary / (have 'int *' and 'int')
   17 |         printf("%d", sum-price/2);
      |                         ~     ^
      |                         |
      |                         int *
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main (void)
{
  vector<int> v;
  int n;
  for (int i = 0; i < n; ++i)
  {
    int x;
    cin>>x;
    v.push_back(x);
  }
  int m = *max_element(v.begin(),v.end());
  int sm = 0;
  bool done = false;
  for (int i = 0; i < n; ++i )
    {
     if(v[i] == m && !done)
       {
          sum+=v[i];
          done = true;
       }
    else sum += v[i];
   }
cout<<sum;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: 'sum' was not declared in this scope; did you mean 'sm'?
   20 |           sum+=v[i];
      |           ^~~
      |           sm
a.cc:23:10: error: 'sum' was not declared in this scope; did you mean 'sm'?
   23 |     else sum += v[i];
      |          ^~~
      |          sm
a.cc:25:7: error: 'sum' was not declared in this scope; did you mean 'sm'?
   25 | cout<<sum;
      |       ^~~
      |       sm
Language: C++

#include<bits/stdc++.h>
using namespace;
int main (void)
{
  vector<int> v;
  int n;
  for (int i = 0; i < n; ++i)
  {
    int x;
    cin>>x;
    v.push_back(x);
  }
  int m = *maximum_element(v.begin(),v.end());
  int sm = 0;
  bool done = false;
  for (int i = 0; i < n; ++i )
    {
     if(v[i] == m && !done)
       {
          sum+=v[i];
          done = true;
       }
    else sum += v[i];
   }
cout<<sum;
	
}

Compiler output:
a.cc:2:16: error: expected identifier before ';' token
    2 | using namespace;
      |                ^
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> v;
      |   ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> v;
      |          ^~~
a.cc:10:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |     cin>>x;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:5: error: 'v' was not declared in this scope
   11 |     v.push_back(x);
      |     ^
a.cc:13:28: error: 'v' was not declared in this scope
   13 |   int m = *maximum_element(v.begin(),v.end());
      |                            ^
a.cc:13:12: error: 'maximum_element' was not declared in this scope
   13 |   int m = *maximum_element(v.begin(),v.end());
      |            ^~~~~~~~~~~~~~~
a.cc:20:11: error: 'sum' was not declared in this scope; did you mean 'sm'?
   20 |           sum+=v[i];
      |           ^~~
      |           sm
a.cc:23:10: error: 'sum' was not declared in this scope; did you mean 'sm'?
   23 |     else sum += v[i];
      |          ^~~
      |          sm
a.cc:25:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 | cout<<sum;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:7: error: 'sum' was not declared in this scope; did you mean 'sm'?
   25 | cout<<sum;
      |       ^~~
      |       sm
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    int p[n];
    vector<int> v;
    for (int n = 0; i < n; i++) {
        cin >> p[i];
        v.push_back(p[i]);
    }

    sort(v.begin(), v.end());

    v[n-1] /= 2;

    int ans = 0;
    for (int i = 0; i < n; i++) {
        ans += v[i];
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: 'i' was not declared in this scope
    9 |     for (int n = 0; i < n; i++) {
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin >> N;
  int A[N];
  int ans = 0;
  for(int i=;i<N;i++){
    cin >> A[i];
    ans += A[i];
  }
  sort(A, A+N);
  cout << ans-A[N-1]/2 << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected primary-expression before ';' token
    9 |   for(int i=;i<N;i++){
      |             ^
Language: C++

#include<bits/stc++.h>
using namespace std;
int main(){
  int n,a=0;cin>>n;
  vector<int>p(n);
  for(int i=0;i<n;i++){
    cin>>p.at(i);
    a+=p.at(i);
  }
  sort(p.begin(),p.end());
  a-=p.at(n-1)/2;
  cout<<a<<endl;
}
  

Compiler output:
a.cc:1:9: fatal error: bits/stc++.h: No such file or directory
    1 | #include<bits/stc++.h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,p,s=0,m=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>p;
        s+=p:
        m=max(m,p);
    }
    cout<<s-m/2<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: found ':' in nested-name-specifier, expected '::'
    9 |         s+=p:
      |             ^
      |             ::
a.cc:9:12: error: 'p' is not a class, namespace, or enumeration
    9 |         s+=p:
      |            ^
Language: C

#include<stdio.h>

int max(int *N,int size){
  int max=N[0],i;
  for(i=1;i<size;i++){
    if(max<N[i]){
      max=N[i];
    }
  }
  return max;
}

int main(void){
  int N,i,max,ans=0;
  scanf("%d",&N);
  int p[N];
  for(i=0;i<N;i++){
    scanf("%d",&p[i]);
  }
  max=max(p,N);
  for(i=0;i<N;i++){
    ans=ans+p[i];
  }
  ans=ans-max/2;
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:7: error: called object 'max' is not a function or function pointer
   20 |   max=max(p,N);
      |       ^~~
main.c:14:11: note: declared here
   14 |   int N,i,max,ans=0;
      |           ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i <= (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;

int main() {
  int N; cin >> N;
  int S = 0, M = 0;
  rep(i,N) {
    int p;
    cin >> p;
    S += P;
    M = max(M,p);
  }
  int ans = S - M/2;
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:10: error: 'P' was not declared in this scope
   27 |     S += P;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N; cin >> N;
  vector<int> MY(N);
  for(int i=0;i<N;i++){
    cin >> MY.at(i);
  }
  sort(MY.begin(), MY.end());
  count=0;
  for(int i=0;i<N-1;i++){
    count+=MY.at(i);
  }
  cout << count+MY.at(N-1)/2 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: overloaded function with no contextual type information
   11 |   count=0;
      |         ^
a.cc:13:19: error: overloaded function with no contextual type information
   13 |     count+=MY.at(i);
      |                   ^
a.cc:15:16: error: invalid operands of types '<unresolved overloaded function type>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to binary 'operator+'
   15 |   cout << count+MY.at(N-1)/2 << endl;
      |           ~~~~~^~~~~~~~~~~~~
Language: C++

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

int main() {
  int n;cin>>n;
  vector<int> item(n);
  for(int i=0;i<n;++i) cin>>item[i];
  sort(item.begin(),item.end(),[&](int x,int y){
    return x>y;
  });
  item[0] /= 2;
  int sum=0;
  for(int i=0;i<n;++i){
    sum += item[i];
  }
  cout<<sum<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |   sort(item.begin(),item.end(),[&](int x,int y){
      |   ^~~~
      |   short
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  int a; cin >> a;
  vector<int> p(a);
  int money=0;
  int x=10000;
  for (int i=0;i<a;i++) {
    cin >> p[i];
   x=min(x,p(i));
  }
  for(int i=0;i<a;i++) {
    money+=p[i];
  }
  money-=x/2;
  cout << money << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: no match for call to '(std::vector<int>) (int&)'
   10 |    x=min(x,p(i));
      |            ~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main () {
  int N,sum=0;
  cin>>N;
  vector<int> a(N);
  for(int i=0;i<N;i++){
    cin>>a[i];
  }
  sort(a.begin().a.end());
  a[N-1]=a[N-1]/2;
  for(int i=0;i<N;i++){
    sum=sum+a[i];
  }
  cout<<sum<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'std::vector<int>::iterator' has no member named 'a'
   10 |   sort(a.begin().a.end());
      |                  ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> p(N);
  int ans=0;
  for(int i=0; i<N; i++){
    cin >> p[i];
    ans+=p[i];
  }
  sort(p.begin(), p.end(), greater<int> ());
  cout << ans-p[N-1]/2 << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: expected '}' at end of input
   17 |   cout << ans-p[N-1]/2 << endl;
      |                                ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> p(N);
  int ans=0;
  for(int i=0; i<N; i++){
    cin >> p[i];
    ans+=p[i];
  }
  sort(p.begin(), p.end(), greater<int> ());
  cout << ans-p[i]/2 << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'i' was not declared in this scope
   17 |   cout << ans-p[i]/2 << endl;
      |                 ^
a.cc:17:30: error: expected '}' at end of input
   17 |   cout << ans-p[i]/2 << endl;
      |                              ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <stdio.h>
#include <algorithm>

using namespace std;

int N;
int price[10];
int ans = 0;

int main()
{
	scanf("%d", &N);

	for (int i = 0; i < N; i++)
	{
		scanf("%d", &price[i]);
	}

	sort(price, price + 10, greater<int>());

	for (int i = 0; i < N; i++)
	{
		if (i == 0) ans += price[i] / 2;
		else ans += price[i];
	}

	printf("%d", ans);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: 'greater' was not declared in this scope
   19 |         sort(price, price + 10, greater<int>());
      |                                 ^~~~~~~
a.cc:19:41: error: expected primary-expression before 'int'
   19 |         sort(price, price + 10, greater<int>());
      |                                         ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, ans=0, max=0;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    int p;
    cin >> p;
    ans += p;
    max = max(max,p);
  }
  max /= 2;
  ans -= max;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'max' cannot be used as a function
   12 |     max = max(max,p);
      |           ~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  
  int prices[N];
  int max_price = 0;
  
  for (int i = 0; i < N; i++) {
    cin >> prices[i];
  }
  
  sort(prices.begin(), prices.end(), greater<int>());
  
  int total = 0;
  
  for (int i = 0; i < N; i++) {
    if (i == 0) {
      prices[i] = prices[i] / 2;
    }
    total += prices[i];
  }
  
  cout << total << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: request for member 'begin' in 'prices', which is of non-class type 'int [N]'
   15 |   sort(prices.begin(), prices.end(), greater<int>());
      |               ^~~~~
a.cc:15:31: error: request for member 'end' in 'prices', which is of non-class type 'int [N]'
   15 |   sort(prices.begin(), prices.end(), greater<int>());
      |                               ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
     
int main() {
  
  int N, ans;
  cin >> N;
  
  vector<int> p(N);
  
  for (int i = 0 ; i < N ; i++)
    cin >> p.at(i);
  
  sort(p.begin(),p.end());
  
  for (int i = 0 ; i < p.size() ; i++){
    if (i == p.size() - 1){
      ans += p.at(i) / 2;
      #cout << "half: " << p.at(i) << endl;
    }
    else{
      ans += p.at(i);
      #cout << "teika:" << p.at(i) << endl;
    }
  }
  
  cout << ans << endl;
    
  
}

Compiler output:
a.cc:19:8: error: invalid preprocessing directive #cout
   19 |       #cout << "half: " << p.at(i) << endl;
      |        ^~~~
a.cc:23:8: error: invalid preprocessing directive #cout
   23 |       #cout << "teika:" << p.at(i) << endl;
      |        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int sum=0;
  vector<int> p(N);
  for(i=0;i<N;i++){
    cin >> p[i];
  }
  sort(p.begin(),p.end());
  for(i=0;i<N-1;i++){
    sum+=p[i];
  }
  sum+=p[N-1];
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=0;i<N;i++){
      |       ^
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   for(i=0;i<N-1;i++){
      |       ^
Language: C++

#include<stdio.h>
int main(){
int sum=0;
  int a[10];
  int n;
int max=0;
  cin>>n;
  for(int i=0;i<n;i++){
  cin>>a[i];
    sum+=a[i];
    if(max <a[i]){
    max=a[i];
    }
  }
  cout<<sum-max/2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>n;
      |   ^~~
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout<<sum-max/2<<endl;
      |   ^~~~
a.cc:15:20: error: 'endl' was not declared in this scope
   15 |   cout<<sum-max/2<<endl;
      |                    ^~~~
Language: C++

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

  int main(){
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n;i++){
      cin >> a[i];
    }
    sort(a, a+n);
    int ma = a[n-1]/2;
    for(int i = 0; i < n-1; i++){
      int ans = 0;
      ans += a[i];
    }
    cout << ans + a[n-1]/2 << endl;
    
  }


  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |     cout << ans + a[n-1]/2 << endl;
      |             ^~~
      |             abs