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

#include<iostream>
#include<algorithm>
#include<vector>
int main(){
  int N, max = 0, m = 0;
  cin >> N;
  vector<int> p(N);
  
  for(int i = 0; i < N; i++){
    ans = p.at(i);
    if(p.at(i) > p.at(m)){
      m = i;
    }
  }
  
  ans -= p.at(m);
  
  cout << ans << endl;
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> p(N);
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/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:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> p(N);
      |          ^~~
a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     ans = p.at(i);
      |     ^~~
      |     abs
a.cc:10:11: error: 'p' was not declared in this scope
   10 |     ans = p.at(i);
      |           ^
a.cc:16:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   ans -= p.at(m);
      |   ^~~
      |   abs
a.cc:16:10: error: 'p' was not declared in this scope
   16 |   ans -= p.at(m);
      |          ^
a.cc:18:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |   cout << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
int main(){
  int N max = 0, m = 0;
  cin >> N;
  vector<int> p(N);
  
  for(int i = 0; i < N; i++){
    ans = p.at(i);
    if(p.at(i) > p.at(m)){
      m = i;
    }
  }
  
  ans -= p.at(m);
  
  cout << ans << endl;
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected initializer before 'max'
    5 |   int N max = 0, m = 0;
      |         ^~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N;
      |          ^
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> p(N);
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/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:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> p(N);
      |          ^~~
a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     ans = p.at(i);
      |     ^~~
      |     abs
a.cc:10:11: error: 'p' was not declared in this scope
   10 |     ans = p.at(i);
      |           ^
a.cc:11:23: error: 'm' was not declared in this scope
   11 |     if(p.at(i) > p.at(m)){
      |                       ^
a.cc:16:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   ans -= p.at(m);
      |   ^~~
      |   abs
a.cc:16:10: error: 'p' was not declared in this scope
   16 |   ans -= p.at(m);
      |          ^
a.cc:16:15: error: 'm' was not declared in this scope; did you mean 'tm'?
   16 |   ans -= p.at(m);
      |               ^
      |               tm
a.cc:18:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |   cout << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long i = 0; i < n; i++)
#define erep(i, n) for(long i = 1; i <= n; i++)
const long MOD = 1000000007;
#define all(a) a.begin(), a.end()
#define eall(a) a.begin()+1, a.end()
#define show(ans)  cout << ans << endl;


int main(){long N;
cin >> N;
vector<long> vec(N+1);
erep(i, N){
    cin >> vec[i];
}
vec.sort(eall(vec));
long sum = 0;
vec[N] = vec[N] / 2;
erep(i, N){
    sum += vec[i];
}









cout << sum << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'class std::vector<long int>' has no member named 'sort'
   17 | vec.sort(eall(vec));
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<vector>
using namespace std;
using ll = long long;
#define MM = 1000000000;
#define mod = MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005
#define NIL -1
int main(){
    int n; cin >> n;
    int p[i];
    int mx = 0;
    ll sum = 0;
    for(int i = 0; i < n; i++){
        cin >> p[i];
        mx = max(mx, p[i]);
        sum += p[i];
    }
    cout << sum - mx/2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: 'i' was not declared in this scope
   16 |     int p[i];
      |           ^
a.cc:20:16: error: 'p' was not declared in this scope
   20 |         cin >> p[i];
      |                ^
Language: C++

#include <cstdio>
#include <conio.h>
using namespace std;
     
int main()
{
    int N = 0;
    int v, maxV = 0;
    int t = 0;
    scanf_s("%d",&N);
    for( int i = 0; i < N; ++i){
    scanf_s("%d", &v);
    t += v;
    if( maxV < v )
        maxV = v;
    }
    t -= maxV /2;
    printf("%d\n",t);	
}

Compiler output:
a.cc:2:10: fatal error: conio.h: No such file or directory
    2 | #include <conio.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <cstdin>
using namespace std;

int main()
{
  int N = 0;
  int v, maxV = 0;
  int t = 0;
  scanf("%d",&N);
  for( int i = 0; i < N; ++i) ){
    scanf("%d", &v);
   	t += v;
    if( maxV < v )
      maxV = v
  }
  t -= maxV /2;
  printf("%d",&t);
}

Compiler output:
a.cc:1:10: fatal error: cstdin: No such file or directory
    1 | #include <cstdin>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int N;
  cin >> N;
  int p[N];
  for (int i = 0; i < N; i++)
  {
    cin >> p[i];
  }
  sort(p, p + N);
  int ans = 0;
  for (int i = 0; i < N - 1; i++)
  {
    ans += p[i];
  }
  ans += p[N - 1] / 2;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(p, p + N);
      |   ^~~~
      |   short
Language: C++

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



int main()
{
	int n,num,sum,ans;
    sum=0;
	cin >> n;
	int a[max_n];
	for (int i = 0; i < n; i++){
		cin >> a[i];
        sum += a[i];
		if (i == 1) num = max({ a[0], a[1] });
		else if (i>1) num = max({ num, a[i] });
	}
	ans = sum - (num/2);
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'max_n' was not declared in this scope
   13 |         int a[max_n];
      |               ^~~~~
a.cc:15:24: error: 'a' was not declared in this scope
   15 |                 cin >> a[i];
      |                        ^
a.cc:17:38: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   17 |                 if (i == 1) num = max({ a[0], a[1] });
      |                                   ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
a.cc:18:40: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   18 |                 else if (i>1) num = max({ num, a[i] });
      |                                     ~~~^~~~~~~~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

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



int main()
{
	int n,num,sum,ans;
    sum=0;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++){
		cin >> a[i];
        sum += a[i];
		if (i == 1) num = max({ a[0], a[1] });
		else if (i>1) num = max({ num, a[i] });
	}
	ans = sum - (num/2);
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:38: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   17 |                 if (i == 1) num = max({ a[0], a[1] });
      |                                   ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
a.cc:18:40: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   18 |                 else if (i>1) num = max({ num, a[i] });
      |                                     ~~~^~~~~~~~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

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



int main()
{
	int n,num,sum,ans;
    sum=0;
	cin >> n;
	int a[n];
	for (int i = 0; i < n; i++){
		cin >> a[i];
        sum += a[i];
		if (i == 1) num = max({ a[0], a[1] });
		else if (i>1) num = max({ num, a[i] });
	}
	ans = sum - (num/2);
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:38: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   17 |                 if (i == 1) num = max({ a[0], a[1] });
      |                                   ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
a.cc:18:40: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   18 |                 else if (i>1) num = max({ num, a[i] });
      |                                     ~~~^~~~~~~~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

#include <iostream>
#include <vector>
#include <algoithm>

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());
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (i == n-1) {
      ans += p[i]/2;
    } else {
      ans += p[i];
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:3:10: fatal error: algoithm: No such file or directory
    3 | #include <algoithm>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <functional>

using namespace std;
#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(x) x.begin(),x.end()

#define CAPITAL
void Yes(bool ex=true){
	#ifdef CAPITAL
	cout<<"YES"<<endl;
	#else
	cout<<"Yes"<<endl;
	#endif
	if(ex)exit(0);
}
void No(bool ex=true){
	#ifdef CAPITAL
	cout<<"NO"<<endl;
	#else
	cout<<"No"<<endl;
	#endif
	if(ex)exit(0);
}

int main() {
	int n;
	cin >> n;
    vector<int> vi(n);
    REP(i, n) {
        cin >> vi[i];
    }
    int ans = accumulate(ALL(vi), 0);
    ans -= *max_element(ALL(vi)) / 2;
    printf("%d", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:15: error: 'accumulate' was not declared in this scope
   42 |     int ans = accumulate(ALL(vi), 0);
      |               ^~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>




using namespace std;
typedef long long ll;
struct point{
  int x;
  int y;

};
int gcd(int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd
int lcm( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
int input(){
  int x;
  cin>>x;
  return x;
}

int moji(char in)
{
    int ans = (int)in-(int)'a';
    if((ans < 0) || (ans > 25)){
        ans = 26;
    }
    return ans;
}
const int VV=10;//場合に応じてVVの値のみ変更する必要あり
//dijkstra(s)sがスタート地点でそこからの最短距離を配列dで表す。正の重みのみ使用可能
int cost[VV][VV];
int d[VV];
bool used[VV];
void dijkstra(int s){
  fill(d,d+VV,100000);
  fill(used,used+VV,false);
  d[s]=0;
  while(true){
    int v=-1;
    for(int u=0;u<VV;u++){
      if(!used[u]&&(v==-1||d[u]<d[v]))v=u;
    }
    if(v==-1)break;
    used[v]=true;
    for(int u=0;u<VV;u++){
      d[u]=min(d[u],d[v]+cost[v][u]);
    }
  }

}

int compare_int(const void *a, const void *b)//qsort(quick sort利用時に使用)
{
    return *(int*)a - *(int*)b;
}

int binary_searchh(long long x,long long k[],int n){
  int l=0;
  int r=n;
  while(r-l>=1){
    int i=(l+r)/2;
    if(k[i]==x)return i;
    else if(k[i]<x)l=i+1;
    else r=i;
  }
  return -1;
}




int main(){
  int N;
  cin>>N;
  int p[i];
  for(int i=0;i<N;i++){
    cin>>p[i];
  }
  sort(p,p+N);
  int sum=0;
  for(int i=0;i<N;i++){
    if(i!=N-1){
      sum+=p[i];
    }else{
      sum+=p[i]/2;
    }
  }
  cout<<sum<<endl;





  

  



}


  
  



Compiler output:
a.cc: In function 'int main()':
a.cc:103:9: error: 'i' was not declared in this scope
  103 |   int p[i];
      |         ^
a.cc:105:10: error: 'p' was not declared in this scope
  105 |     cin>>p[i];
      |          ^
a.cc:107:8: error: 'p' was not declared in this scope
  107 |   sort(p,p+N);
      |        ^
Language: C++

#include<iostream>
using namespace std;
int main () {
  int N;
  cin >> N;
  int to = 0;
  int max = 0;
  for (int i = 0; i < N; i ++) {
    int k;
    cin >> k;
    to += k;
    if (max < k) max = k;
  }
  to -= k / 2;
  cout << to << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'k' was not declared in this scope
   14 |   to -= k / 2;
      |         ^
Language: C

#include <stdio.h>

int main(){
  int num;
  scanf("%d",&num);
  
  int p[num],i,j,sum,tmp;
  
    for(i=0;i<n;i++){
    scanf("%d",&p[i]);
  }
  
  for(i=0;i<num-1;i++){
    for(j=i+1;j<num;j++){
      if(p[j]>p[i]){
        tmp = p[j];
        p[j]=p[i];
        p[i]=tmp;
      }
    }
  }
  
  sum = p[0]/2;
  for(i=1;i<num;i++){
    sum += p[i];
  }
  
  printf("%d\n",sum);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:15: error: 'n' undeclared (first use in this function)
    9 |     for(i=0;i<n;i++){
      |               ^
main.c:9:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(){
  int num;
  scanf("%d",&num);
  
  int p[num],i,j,sum,tmp;
  
    for(i=0;i<n;i++){
    scanf("%d",&p[i]);
  }
  
  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      if(p[j]>p[i]){
        tmp = p[j];
        p[j]=p[i];
        p[i]=tmp;
      }
    }
  }
  
  sum = p[0]/2;
  for(i=1;i<n;i++){
    sum += p[i];
  }
  
  printf("%d\n",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:15: error: 'n' undeclared (first use in this function)
    9 |     for(i=0;i<n;i++){
      |               ^
main.c:9:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(void){
	int N,i,p[10],max=0,res=0;
	scanf(“%d/n”,&N);
	for(i=0;i<N;i++){
		scanf(“%d/n”,&p[i]);
	}
	
	for(i=0;i<N;i++){
		if(max<=p[i]){
			max=p[i];
			p[i]=0;
		}
	}
	
	for(i=0;i<N;i++){
		res+=p[i];
	}
	res+=max;

	printf(“%d”,res);
}
	

Compiler output:
main.c: In function 'main':
main.c:5:15: error: stray '\342' in program
    5 |         scanf(<U+201C>%d/n<U+201D>,&N);
      |               ^~~~~~~~
main.c:5:16: error: expected expression before '%' token
    5 |         scanf(“%d/n”,&N);
      |                ^
main.c:5:20: error: stray '\342' in program
    5 |         scanf(<U+201C>%d/n<U+201D>,&N);
      |                           ^~~~~~~~
main.c:7:23: error: stray '\342' in program
    7 |                 scanf(<U+201C>%d/n<U+201D>,&p[i]);
      |                       ^~~~~~~~
main.c:7:24: error: expected expression before '%' token
    7 |                 scanf(“%d/n”,&p[i]);
      |                        ^
main.c:7:28: error: stray '\342' in program
    7 |                 scanf(<U+201C>%d/n<U+201D>,&p[i]);
      |                                   ^~~~~~~~
main.c:22:16: error: stray '\342' in program
   22 |         printf(<U+201C>%d<U+201D>,res);
      |                ^~~~~~~~
main.c:22:17: error: expected expression before '%' token
   22 |         printf(“%d”,res);
      |                 ^
main.c:22:19: error: stray '\342' in program
   22 |         printf(<U+201C>%d<U+201D>,res);
      |                          ^~~~~~~~
Language: C

#include<stdio.h>

int main(void){
	int N,i,p[10],max=0,res=0;
	scanf(“%d¥n”,&N);
	for(i=0;i<N;i++){
		scanf(“%d¥n”,&p[i]);
	}
	
	for(i=0;i<N;i++){
		if(max<=p[i]){
			max=p[i];
			p[i]=0;
		}
	}
	
	for(i=0;i<N;i++){
		res+=p[i];
	}
	res+=max;

	return(res);
}
	

Compiler output:
main.c: In function 'main':
main.c:5:15: error: stray '\342' in program
    5 |         scanf(<U+201C>%d<U+00A5>n<U+201D>,&N);
      |               ^~~~~~~~
main.c:5:16: error: expected expression before '%' token
    5 |         scanf(“%d¥n”,&N);
      |                ^
main.c:5:18: error: stray '\302' in program
    5 |         scanf(<U+201C>%d<U+00A5>n<U+201D>,&N);
      |                         ^~~~~~~~
main.c:5:20: error: stray '\342' in program
    5 |         scanf(<U+201C>%d<U+00A5>n<U+201D>,&N);
      |                                  ^~~~~~~~
main.c:7:23: error: stray '\342' in program
    7 |                 scanf(<U+201C>%d<U+00A5>n<U+201D>,&p[i]);
      |                       ^~~~~~~~
main.c:7:24: error: expected expression before '%' token
    7 |                 scanf(“%d¥n”,&p[i]);
      |                        ^
main.c:7:26: error: stray '\302' in program
    7 |                 scanf(<U+201C>%d<U+00A5>n<U+201D>,&p[i]);
      |                                 ^~~~~~~~
main.c:7:28: error: stray '\342' in program
    7 |                 scanf(<U+201C>%d<U+00A5>n<U+201D>,&p[i]);
      |                                          ^~~~~~~~
Language: C++

#include<iostream>

using namespace std;

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

  int p[N];
  for (int i = 0; i < N; i++) {
    cin >> p[i];
  }

  sort(p, p + N);

  int sum = 0;
  for (int i = 0; i < N; i++) {
    if (i == N -1) {
      sum += p[i] / 2;
    } else {
      sum += p[i];
    }
  }

  cout << sum << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |   sort(p, p + N);
      |   ^~~~
      |   short
Language: C++

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

bool comp(const int& e1, const int& e2) {
  return e1 > e2;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |     sort(p.begin(), p.end(), comp);
      |     ^~~~
      |     short
Language: C++

#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
using namespace std;

int main(){
    int N;
    cin >> N;
    int P[N];
    for(int i=0;i<N;i++){
        cin >> P[i];
    }
    sort(P, P+N);
    reverse(P,P+N);
    P[0] = P[0]/2;
    int sum = std::accumulate(P, P + N, 0);
    cout << sum <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:20: error: 'accumulate' is not a member of 'std'
   29 |     int sum = std::accumulate(P, P + N, 0);
      |                    ^~~~~~~~~~
Language: C++

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

int main(){
    int N;
    cin >> N;
    int P[N];
    for(int i=0;i<N;i++){
        cin >> P[i];
    }
    sort(P, P+N);
    reverse(P,P+N);
    P[0] = P[0]/2;
    int sum = std::accumulate(P, P + N, 0);
    cout << sum <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |     sort(P, P+N);
      |     ^~~~
      |     short
a.cc:13:5: error: 'reverse' was not declared in this scope
   13 |     reverse(P,P+N);
      |     ^~~~~~~
Language: C++

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

int main(){
    int N;
    cin >> N;
    int P[N];
    for(int i=0;i<N;i++){
        cin >> P[i];
    }
    const size_t size = sizeof(P) / sizeof(P[0]);
    int sum = std::accumulate(P, P + size, 0);
    sort(P, P+N);
    sum = sum - P[0]/2;
    cout << sum <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |     sort(P, P+N);
      |     ^~~~
      |     short
Language: Java

import java.util.Scanner;

public class Main{
public static void main(){
  int N=0;
  int Max=0;
  Scanner s=new Scanner(System.in);
  int all=0; 
  int P[]=new int[N];
  P={0};

  N=s.nextInt();

  for(int i=0;i<N;i++){
   P[i]=s.nextInt();
   all+=P[i];

    if(Max<P[i]){
     Max=P[i];
   }

  }
 all-=Max/2;
 System.out.System.out.println(all);
 }
}

Compiler output:
Main.java:10: error: illegal start of expression
  P={0};
    ^
Main.java:10: error: not a statement
  P={0};
     ^
Main.java:10: error: ';' expected
  P={0};
      ^
3 errors
Language: Java

import java.util.Scanner;

public class Main{
public static void main(){
  int N=0;
  int Max=0;
  Scanner s=new Scanner(System.in);
  int all=0; 
  int P[]=new int[N];

  N=s.nextInt();

  for(int i=0;i<N;i++){
   P[i]=s.nextInt();
   all+=P[i];

    if(Max<P[i]){
     Max=P[i];
   }

  }
 all-=Max/2;
 System.out.System.out.println(all);
 }
}

Compiler output:
Main.java:23: error: cannot find symbol
 System.out.System.out.println(all);
           ^
  symbol:   variable System
  location: variable out of type PrintStream
1 error
Language: Java

import java.util.Scanner;

public class main{
public static void main(){
  int N=0;
  int Max=0;
  Scanner s=new Scanner(System.in);
  int all=0; 
  int P[]=new int[N];
  P={0};

  N=s.nextInt();

  for(int i=0;i<N;i++){
   P[i]=s.nextInt();
   all+=P[i];

    if(Max<P[i]){
     Max=P[i];
   }

  }
 all-=Max/2;
 System.out.System.out.println(all);
 }
}

Compiler output:
Main.java:10: error: illegal start of expression
  P={0};
    ^
Main.java:10: error: not a statement
  P={0};
     ^
Main.java:10: error: ';' expected
  P={0};
      ^
3 errors
Language: Java

import java.util.Scanner;

public class main{
public static void main(){
  int N=0;
  int Max=0;
  Scanner s=new Scanner(System.in);
  int all=0; 
  int P[]=new int[N];
  P={0};

  N=s.nextInt();

  for(int i=0;i<N;i++){
   P[i]=s.nextInt();
   all+=P[i];

    if(Max<P[i]){
     Max=P[i];
   }

  }
 all-=Max/2;
 }
}

Compiler output:
Main.java:10: error: illegal start of expression
  P={0};
    ^
Main.java:10: error: not a statement
  P={0};
     ^
Main.java:10: error: ';' expected
  P={0};
      ^
3 errors
Language: Java

import java.util.Scanner;

public class main{
public static void main(){
  int N=0;
  int Max=0;
  Scanner s=new Scanner(System.in);
  int all=0; 
  int P[]=new int[N];
  P={0};

  N=s.nextInt();

  for(int i=0;i<N;i++){
   P[i]=s.nextInt();
   all+=P[i];

    if(Max<P[i]){
     Max=save;
   }

  }
 all-=Max;
 all+=Max/2;
 }
}

Compiler output:
Main.java:10: error: illegal start of expression
  P={0};
    ^
Main.java:10: error: not a statement
  P={0};
     ^
Main.java:10: error: ';' expected
  P={0};
      ^
3 errors
Language: Java

import java.util.Scanner;

public class Main{
public static void main(){
  int N=0;
  int Max=0;
  Scanner s=new Scanner(System.in);
  int all=0; 
  int save=0;

  N=s.nextInt();

  for(int i=0;i<N;i++){
   save=s.nextInt();
   all+=save

    if(Max<save){
     Max=save;
   }

  }
 all-=Max;
 all+=Max/2;
 }
}

Compiler output:
Main.java:15: error: ';' expected
   all+=save
            ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
public static void main(){
  int N=0;
  int Max=0;
  Scanner s=new Scanner(System.in);
  int all=0; 
  int save=0;
 
  N=s.nextInt();
 
  for(int i=0;i<N;i++){
   save=s.nextInt();
   all+=save
 
    if(Max<save){
     Max=save;
   }
 
  }
 all-=Max;
 all+=Max/2;
 }
}

Compiler output:
Main.java:10: error: illegal character: '\u00a0'
?
^
Main.java:12: error: illegal character: '\u00a0'
?
^
Main.java:16: error: illegal character: '\u00a0'
?
^
Main.java:20: error: illegal character: '\u00a0'
?
^
4 errors
Language: Java

import java.util.Scanner;
 
public Class Main{
public static void main(){
  int N=0;
  int Max=0;
  Scanner s=new Scanner(System.in);
  int all=0; 
  int save=0;

  N=s.nextInt();

  for(int i=0;i<N;i++){
   save=s.nextInt();
   all+=save

    if(Max<save){
     Max=save;
   }

  }
 all-=Max;
 all+=Max/2;
 }
}

Compiler output:
Main.java:2: error: illegal character: '\u00a0'
?
^
Main.java:3: error: class, interface, enum, or record expected
public Class Main{
       ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
public static void main(){
              ^
  (use --enable-preview to enable unnamed classes)
Main.java:15: error: ';' expected
   all+=save
            ^
Main.java:25: error: class, interface, enum, or record expected
}
^
5 errors
Language: Java

import java.util.Scanner;

public class Main{
public static void main(){
  int N=0;
  int Max=0;
  Scanner s=new Scanner(System.in);
  int all=0; 
  int save=0;

  N=s.nextInt();
 
  for(int i=0;i<N;i++){
   save=s.nextInt();
   all+=save

    if(Max<save){
     Max=save;
   }

  }

Compiler output:
Main.java:12: error: illegal character: '\u00a0'
?
^
Main.java:15: error: ';' expected
   all+=save
            ^
Main.java:21: error: reached end of file while parsing
  }
   ^
3 errors
Language: Java

import java.util.Scanner;
 
public class Main{
public static void main(){
  int N=0;
  int Max=0;
  Scanner s=new Scanner(System.in);
  int all=0; 
  int save=0;
 
  N=s.nextInt();
 
  for(int i=0;i<N;i++){
   save=s.nextInt();
   all+=save
 
    if(Max<save){
     Max=save;
   }
 
  }
all-=Max;
all+=Max/2;
 }
}

Compiler output:
Main.java:2: error: illegal character: '\u00a0'
?
^
Main.java:10: error: illegal character: '\u00a0'
?
^
Main.java:12: error: illegal character: '\u00a0'
?
^
Main.java:16: error: illegal character: '\u00a0'
?
^
Main.java:20: error: illegal character: '\u00a0'
?
^
5 errors
Language: Java

import java.util.Scanner;

public void Main(){
  int N=0;
  int Max=0;
  Scanner s=new Scanner(System.in);
  int all=0; 
  int save=0;

  N=s.nextInt();

  for(int i=0;i<N;i++){
   save=s.nextInt();
   all+=save

    if(Max<save){
     Max=save;
   }

  }
all-=Max;
all+=Max/2;
 }

Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public void Main(){
       ^
  (use --enable-preview to enable unnamed classes)
Main.java:14: error: ';' expected
   all+=save
            ^
2 errors
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(void){
  int N,P,M=0,sum=0;
  cin >> N;
  for(int i=0;i<N;i++)
    cin >> P;
  	M=max(M,P);
    sum+=P;
  }
  cout << sum-M/2 << endl;
  return 0;
}

Compiler output:
a.cc:12:3: error: 'cout' does not name a type
   12 |   cout << sum-M/2 << endl;
      |   ^~~~
a.cc:13:3: error: expected unqualified-id before 'return'
   13 |   return 0;
      |   ^~~~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(void){
  int N,pi[15],sum=0;
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> pi[i];
  	sort(pi[],N);
    if(i==0)pi[0]/=2;
    sum+=pi[i];
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected primary-expression before ']' token
    9 |         sort(pi[],N);
      |                 ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  cin >> N;
  
  int a[N];
  int m=0;
  int n=0;
  
  for(int i=0;i<N;i++){
    cin >> a[i];
    if(m <= a[i]){
      m = a[i];
    }
    n += a[i]
  }
  
  m = m/2;
  
  cout << n-m;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: expected ';' before '}' token
   17 |     n += a[i]
      |              ^
      |              ;
   18 |   }
      |   ~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  cin >> N;
  
  int a[N];
  int m=0;
  int n=0;
  
  for(int i=0;i<N;i++){
    cin a[i];
    if(m <= a[i]){
      m = a[i];
    }
    n += a[i]
  }
  
  m = m/2;
  
  cout << n-m;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: expected ';' before 'a'
   13 |     cin a[i];
      |        ^~
      |        ;
a.cc:17:14: error: expected ';' before '}' token
   17 |     n += a[i]
      |              ^
      |              ;
   18 |   }
      |   ~
Language: C++

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

int N, sum, Max;

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


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;
      |         ^~~
      |         abs
a.cc:14:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |     printf("%d", ans - (Max/2));
      |                  ^~~
      |                  abs
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'll' was not declared in this scope
    6 |   ll a[N] ;
      |   ^~
a.cc:7:38: error: 'a' was not declared in this scope
    7 |   for(int i =0 ; i < N ;i++) cin  >> a[i] ;
      |                                      ^
a.cc:9:11: error: 'a' was not declared in this scope
    9 |     cout<<a[0]/2<<endl;
      |           ^
a.cc:12:8: error: 'a' was not declared in this scope
   12 |   sort(a,a+N) ;
      |        ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(p.begin(), p.end());
      |   ^~~~
      |   short
a.cc:13:3: error: 'reverse' was not declared in this scope
   13 |   reverse(p.begin(), p.end());
      |   ^~~~~~~
a.cc:15:8: error: 'i' was not declared in this scope
   15 |   p.at(i) /= 2;
      |        ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> p(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> p(N);
      |          ^~~
a.cc:10:12: error: 'p' was not declared in this scope
   10 |     cin >> p.at(i);
      |            ^
a.cc:11:8: error: 'p' was not declared in this scope
   11 |   sort(p.begin(), p.end());
      |        ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(p.begin(), p.end());
      |   ^~~~
      |   short
a.cc:12:3: error: 'reverse' was not declared in this scope
   12 |   reverse(p.begin(), p.end());
      |   ^~~~~~~
a.cc:14:8: error: 'i' was not declared in this scope
   14 |   p.at(i) /= 2;
      |        ^
Language: C++

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

int main(int argc, const char * argv[])
{
    int N;
    std::vector<int> p(10);
    int answer = 0;

    std::cin >> N;

    for (int i : p)
        std::cin >> i;

    std::sort(p.begin(), p.end(), std::greater<int>());

    p[0] /= 2;

    for (int i : p)
        answer += i;

    std::cout << answer;

    return 0;
}


Compiler output:
a.cc:3:1: error: stray '##' in program
    3 | ##include <algorithm>
      | ^~
a.cc:3:3: error: 'include' does not name a type
    3 | ##include <algorithm>
      |   ^~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <functional>

int main(int argc, const char * argv[])
{
    int N;
    std::vector<int> p(10);
    int answer = 0;

    std::cin >> N;

    for (int i : p)
        std::cin >> i;

    std::sort(p.begin(), p.end(), std::greater<int>());

    p[0] /= 2;
    
    for (int i : p)
        answer += i;

    std::cout << answer;

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:16:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   16 |     std::sort(p.begin(), p.end(), std::greater<int>());
      |          ^~~~
      |          qsort
Language: C++

#include <stdio.h>
#include <iostream>
#include <vector>
#include <functional>

int main(int argc, char const *argv[])
{
  int N;
  int answer = 0;
  std::vector<int> p(10);

  std::cin >> N;

  for (int i = 0; i < N; i++)
    std::cin >> p[i];

  sort(p.begin(),p.end(), std::greater<int>());

  answer += p[0] /2;

  for (int i = 1; i < N; i++)
    answer += p[i];

  std::cout << answer << '\n';

  return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:17:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |   sort(p.begin(),p.end(), std::greater<int>());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void)
{
    int n = 0;
    int ans = 0;
    vector<int> p(n);
    cin >> n;
    for (size_t i : p)
    {
        cin >> p[i];
        ans += p[i];
    }
    for (size_t i : p)
    {
        ans -= (*max_element(p.begin(), p.end())) / 2;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: 'max_element' was not declared in this scope
   17 |         ans -= (*max_element(p.begin(), p.end())) / 2;
      |                  ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define all(v) v.begin(),v.end()
#define ll long long
#define pb(a) push_back(a)
#define pf(a) push_flont(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
        int n;
        cin >> n;
        vector<int> p;
        p.reserve(n);
        REP(i,n){
                cin >> p.at(i);
        }
        p.sort(all(p));
        int sum = 0;
        REP(i,n-1){
                sum+=p[i];
        }
        sum+=p[n-1]/2;
        cout << sum << endl;
        
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:11: error: 'class std::vector<int>' has no member named 'sort'
   30 |         p.sort(all(p));
      |           ^~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define all(v) v.begin(),v.end()
#define ll long long
#define pb(a) push_back(a)
#define pf(a) push_flont(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
        int n;
        cin >> n;
        vector<int> p;
        p.reserve(n);
        REP(i,n){
                cin >> p.at(i);
        }
        p.sort(all(p));
        int sum = 0;
        REP(i,n-1){
                sum+=p[i];
        }
        sum+=p.back()/2;
        cout << sum << endl;
        
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:11: error: 'class std::vector<int>' has no member named 'sort'
   30 |         p.sort(all(p));
      |           ^~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define all(v) v.begin(),v.end()
#define ll long long
#define pb(a) push_back(a)
#define pf(a) push_flont(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
        int n;
        cin >> n;
        vector<int> p;
        p.reserve(n);
        REP(i,n){
                cin >> p.at(i);
        }
        p.sort(all(p));
        int sum = 0;
        REP(i,n-1){
                sum+=p[i];
        }
        sum+=p[p.end()]/2;
        cout << sum << endl;
        
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:11: error: 'class std::vector<int>' has no member named 'sort'
   30 |         p.sort(all(p));
      |           ^~~~
a.cc:35:15: error: no match for 'operator[]' (operand types are 'std::vector<int>' and 'std::vector<int>::iterator')
   35 |         sum+=p[p.end()]/2;
      |               ^
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:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1128:28: note:   no known conversion for argument 1 from 'std::vector<int>::iterator' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1147:28: note:   no known conversion for argument 1 from 'std::vector<int>::iterator' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define all(v) v.begin(),v.end()
#define ll long long
#define pb(a) push_back(a)
#define pf(a) push_flont(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
        int n;
        cin >> n;
        vector<int> p;
        p.reserve(n);
        REP(i,n){
                cin >> p.at(i);
        }
        p.sort(all(p));
        int sum = 0;
        REP(i,n-1){
                sum+=p[i];
        }
        sum+=p[i]/2;
        cout << sum << endl;
        
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:11: error: 'class std::vector<int>' has no member named 'sort'
   30 |         p.sort(all(p));
      |           ^~~~
a.cc:35:16: error: 'i' was not declared in this scope
   35 |         sum+=p[i]/2;
      |                ^
Language: C++

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

int main() {
  int N; //入力の個数
  cin >> N;
  
  int M; //最大値を保持する変数
  int S; //求める合計値
  
  for (int i=0; i<N; i++) {
    int p;
    cin >> p; //入力
    S += p;
    M = max(p, M);　//最大値を更新
  }
  int ans = S - M / 2 ;
  cout << ans << endl;
}

Compiler output:
a.cc:15:19: error: extended character 　 is not valid in an identifier
   15 |     M = max(p, M);　//最大値を更新
      |                   ^
a.cc: In function 'int main()':
a.cc:15:19: error: '\U00003000' was not declared in this scope
   15 |     M = max(p, M);　//最大値を更新
      |                   ^~