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

#include <bits/stdc++.h>

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

const int N = 1e5 + 5;
int n, m, k, ans;

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


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

#include <iostream>
using namespace std;

int main() {
	int N;
  int seged=0;
  vector <int> szamok5alma;
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> seged;
    szamok5alma.push_back(seged);
  }
  seged=0;
  for(int j=0;j<N;j++){
    if(szamok5alma[seged]<szamok5alma[i]){
      seged=i;
    }
  }
  int seged2=0;
  szamok5alma[seged]/=2;
  for(int k=0;k<N;k++){
    seged2+=szamok5alma[k];
  }
  cout << seged2;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector <int> szamok5alma;
      |   ^~~~~~
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:7:11: error: expected primary-expression before 'int'
    7 |   vector <int> szamok5alma;
      |           ^~~
a.cc:11:5: error: 'szamok5alma' was not declared in this scope
   11 |     szamok5alma.push_back(seged);
      |     ^~~~~~~~~~~
a.cc:15:8: error: 'szamok5alma' was not declared in this scope
   15 |     if(szamok5alma[seged]<szamok5alma[i]){
      |        ^~~~~~~~~~~
a.cc:15:39: error: 'i' was not declared in this scope
   15 |     if(szamok5alma[seged]<szamok5alma[i]){
      |                                       ^
a.cc:20:3: error: 'szamok5alma' was not declared in this scope
   20 |   szamok5alma[seged]/=2;
      |   ^~~~~~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: 'o' was not declared in this scope
   20 |   return o;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int n;
  cin>>n;
  vector<int> vec(n);
  for(int i=0;i<n;i++)
    cin >>vec[n];
   sort(vec.begin(), vec.end()); 
    reverse(vec.begin(), vec.end());
  int wa=0;
  vec[0]=vec[0]/2;
  for(int i=0;i<n;i++){
    wa=vec[i]++;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rall(v) v.rbegin(),v.rend()
int main(){
  int n;
  cin>>n;
  vector<int>a(n);
  int ans=0;
  rep(i,n) {
    cin>>a[i];
    ans+=a[i];
  }
  sort(rall(a));
  ans-=a[0]/2;
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   rep(i,n) {
      |       ^
a.cc:9:3: error: 'rep' was not declared in this scope
    9 |   rep(i,n) {
      |   ^~~
Language: C++


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

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define DISP1(as)		for(auto it : as) cout<<it.f<<" "<<it.s<<") ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll , ll> 			pll;
typedef pair<ld, ld> 			pld;
typedef unordered_map<ll, ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	2e+5 + 99;
const ll 	MAX7 	= 	1e+7 + 7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9 + 7;

// <------------- Declare Variables Here ------------> //

ll T = 1;
ll n, k, l, q, x;
string s;

// <---------------------- > //


// <------------- Start of main() -------------------> //

void MAIN() {
	cin>>n;
	vll a(n);
	for(ll i=0;i<n;i++) cin>>a[i];
		sort(all(a));
	reverse(all(a));
	a[0]/=2;

	cout<<accumulate(all(a));
}


int main() {
	fastio; randomINT;
	//cin >> T;
	while (T--) {

		MAIN();
	}
	return 0;
}


Compiler output:
a.cc: In function 'void MAIN()':
a.cc:56:25: error: no matching function for call to 'accumulate(std::vector<long long int>::iterator, std::vector<long long int>::iterator)'
   56 |         cout<<accumulate(all(a));
      |               ~~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/numeric:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 2 provided
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    9 |     cin >> data[i];
      |                ^
a.cc:10:21: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   10 |     mmm=max(mmm,data[i]);
      |                     ^
a.cc:11:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   11 |     sum+=data[i];
      |              ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vint;
#define rep(i,n) for (ll i = 0; i < (ll)(n); ++i)
#define rrep(i,j,n) for(ll i = (ll)(j); i < (ll)(n); i++)
#define mrep(i,n) for (ll i = (ll)(n-1); i >= 0; i--)
#define be(v) (v).begin(), (v).end()
#define dcout cout << fixed << setprecision(20) 
ll INF = 1LL << 60;
ll mod = 1e9 + 7;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: 'a' was not declared in this scope
   21 |         ans+=(a[n-1]/2);
      |               ^
Language: C

#include <stdio.h>

int main(void)
{
    int n,max=0,p[10000],a=0,x=0;
    scanf("%d",&n);
  
    for(i=0;i<n;i++){
        scanf("%d",p[i]);
        if(max<p[i]){
           max=p[i];
           a=i;
        }  
    }
    
    for(i=0;i<n;i++){
        if(i!=a)  x=x+p[i];
    }
    
    printf("%d\n",(max/2)+x);
    

Compiler output:
main.c: In function 'main':
main.c:8:9: error: 'i' undeclared (first use in this function)
    8 |     for(i=0;i<n;i++){
      |         ^
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:5: error: expected declaration or statement at end of input
   20 |     printf("%d\n",(max/2)+x);
      |     ^~~~~~
Language: C++

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

int main(){
  int N;
  cin>>N;
  int j=0,k=0;
  for(int i=0;i<N;i++){
    int p;
    cin>>p;
    j=max(j,p);
    k+=p;
  }
  cout<<k-j/2<<endl
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ';' before '}' token
   14 |   cout<<k-j/2<<endl
      |                    ^
      |                    ;
   15 | }
      | ~
Language: C++

#include<iostream>
using namespase std;

int main(){
	int N;
  	cin >> N;
  
  	int maxPrice = 0;
  	int totalPrice = 0;
  
    for(int i=0; i<N; i++){
      int price;
      cin >> price;
      if(price > maxPrice){
        maxPrice = price;
      }
      totalPrice += price;
    }
  
    int result = totalPrice - maxPrice / 2;
  
    cout << result << endl;
    return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: 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:22:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |     cout << result << 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:22:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 |     cout << result << 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;

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

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:28: error: expected primary-expression before ')' token
   14 |   sort(p, p+N, greater<int>);
      |                            ^
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.at(i);
  }
  sort(P.begin(),P.end());
  int sum=0;
  for(int i=0;i<N-1;i++){
    sum+=P.at(i);
  }
  sum+=P.at(i)/2;
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'i' was not declared in this scope
   15 |   sum+=P.at(i)/2;
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long int N,A[N];
  cin>>N;
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  for(int i=0;i<N;i++){
    c=max(c,A[i]);
    sum+=A[i];
  }
  cout<<(sum-(c/2));
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'c' was not declared in this scope
   10 |     c=max(c,A[i]);
      |     ^
a.cc:11:5: error: 'sum' was not declared in this scope
   11 |     sum+=A[i];
      |     ^~~
a.cc:13:10: error: 'sum' was not declared in this scope
   13 |   cout<<(sum-(c/2));
      |          ^~~
a.cc:13:15: error: 'c' was not declared in this scope
   13 |   cout<<(sum-(c/2));
      |               ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected ';' before 'vector'
    5 |   cin>>n
      |         ^
      |         ;
    6 |         vector<int>a(n);
      |         ~~~~~~
a.cc:8:14: error: 'a' was not declared in this scope
    8 |         cin>>a[i];
      |              ^
a.cc:11:8: error: 'a' was not declared in this scope
   11 |   sort(a.begin(),a.end());
      |        ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected ';' before 'vector'
    5 |   cin>>n
      |         ^
      |         ;
    6 | vector<int>a(n);
      | ~~~~~~   
a.cc:8:6: error: 'a' was not declared in this scope
    8 | cin>>a[i];
      |      ^
a.cc:11:8: error: 'a' was not declared in this scope
   11 |   sort(a.begin(),a.end());
      |        ^
Language: C++

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

}

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

#include<iostream>
#include<string>
#include<vector>

using namespace std;

int main()
{
  int n=0;
  cin>>n;
  
  vector<int> goods=new vector<int>();
  
  int buf=0;
  int index=0;
  
  int hoge[14];
  
  for(int i=0;i<n;i++)
  {
    cin>>hoge[i];
    goods.push_back(hoge[i]);
  }
  
  buf=goods[0];
  
  for(int i=0;i<n;i++)
  {
    if(goods[i]>buf)
    {
      index=i;
    }
  }
  
  goods[index]=goods[index]/2;
  
  int ans=0;
  
  for(int i=0;i<n;i++)
  {
    ans+=goods[i];
  }
  
  cout<<ans<<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: conversion from 'std::vector<int>*' to non-scalar type 'std::vector<int>' requested
   12 |   vector<int> goods=new vector<int>();
      |                     ^~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>

using namespace std;

int main()
{
  int n=0;
  cin>>n;
  
  vector<int> goods=new vector<int>();
  
  int buf=0;
  int index=0;
  
  for(int i=0;i<n;i++)
  {
    cin>>goods[i];
  }
  
  buf=goods[0];
  
  for(int i=0;i<n;i++)
  {
    if(goods[i]>buf)
    {
      index=i;
    }
  }
  
  goods[index]=goods[index]/2;
  
  int ans=0;
  
  for(int i=0;i<n;i++)
  {
    ans+=goods[i];
  }
  
  cout<<ans<<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: conversion from 'std::vector<int>*' to non-scalar type 'std::vector<int>' requested
   12 |   vector<int> goods=new vector<int>();
      |                     ^~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main()
{
  int n;
  cin>>n;
  
  int goods[n];
  
  int buf;
  int high;
  int index;
  
  for(int i=0;i<n;i++)
  {
    cin>>goods[i];
    
    if(i==0)
    {
      buf=goods[0];
      high=buf;
    }
    else
    {
      if(goods[i]>=buf)
      {
        high=goods[i];
        index=i;
      }
    }
  }
  
  int ans;
  
  for(int i=0;i<n;i++)
  {
    if(i==index)
    {
      ans+=(goods/2);
    }
    else
    {
      ans+=goods[i];
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:18: error: invalid operands of types 'int [n]' and 'int' to binary 'operator/'
   42 |       ans+=(goods/2);
      |             ~~~~~^~
      |             |     |
      |             |     int
      |             int [n]
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:21: error: expected ';' before '}' token
   17 |     answer+= p.at(j)
      |                     ^
      |                     ;
   18 |   }
      |   ~
Language: C++

#include<stdio.h>
int main(void){
  int n;
  scanf("%d",&n);
  int s=0,m=0;
  for(int loop=0;loop<n;++loop){
    int p;
    scanf("%d",&p);
    s+=p;
    int max;
    if(m>=p){
      max=m;
    }else if(m<=p){
      max=p;
    }
  }
  int ans=s-max/2;
  printf("%d",ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'max' was not declared in this scope
   17 |   int ans=s-max/2;
      |             ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std; 
int main(){
  int n;
  cin >> n;
  vector<int> vec(n);
  int i,sum=0;
  for(i=0;i<n;i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  reverse(vec.begin(),vec.end());
  for(i=1;i<n;i++){
    sum+=vec.at(i);
  }
  sum+=vec.(0)/2;
  cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: expected unqualified-id before '(' token
   16 |   sum+=vec.(0)/2;
      |            ^
Language: Java

import java.util.*;

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

    integer a[] = new integer[N];
    for(int i = 0; i < N ; i++){
      a[i] = sc.nextInt();
    }
    Arrays.sort(a, Comparator.reverseOrder());

    a[0] = a[0]/2;

    int sum = 0;

    for(int i = 0; i < N; i++){
      sum += a[i];
    }

}
}

Compiler output:
Main.java:8: error: cannot find symbol
    integer a[] = new integer[N];
    ^
  symbol:   class integer
  location: class Main
Main.java:8: error: cannot find symbol
    integer a[] = new integer[N];
                      ^
  symbol:   class integer
  location: class Main
2 errors
Language: C++

#includ<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.at(i);
  int sum=0;
  for(int i=0;i<N;i++)
    sum+=p.at(i);
  int max=p.at(0);
  for(int i=1;i<N;i++)
    if(max<=p.at(i))
       max=p.at(i);
  cout<<sum-max/2<<endl;
       
  
  
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #includ; did you mean #include?
    1 | #includ<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>N;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #includ<bits/stdc++.h>
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int>p(N);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #includ<bits/stdc++.h>
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int>p(N);
      |          ^~~
a.cc:8:10: error: 'p' was not declared in this scope
    8 |     cin>>p.at(i);
      |          ^
a.cc:11:10: error: 'p' was not declared in this scope
   11 |     sum+=p.at(i);
      |          ^
a.cc:12:11: error: 'p' was not declared in this scope
   12 |   int max=p.at(0);
      |           ^
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout<<sum-max/2<<endl;
      |   ^~~~
a.cc:16:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:20: error: 'endl' was not declared in this scope
   16 |   cout<<sum-max/2<<endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #includ<bits/stdc++.h>
Language: C++

#include <iostream>
using namespace std;
 
int a[100];
 
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n: ++i)
	{
		cin >> a[i];
	}
  	int najveci = a[0];
	for (int i = 1; i < n; ++i)
	{
		if (najveci < a[i])
		najveci = a[i];
	}
	najveci = najveci/2;
	int c=0;
	for (int i = 0; i < n; i++)
	{
		c = c + a[i];	
	}
	cout << c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   10 |         for (int i = 0; i < n: ++i)
      |                         ^
a.cc:10:30: error: expected ';' before ':' token
   10 |         for (int i = 0; i < n: ++i)
      |                              ^
      |                              ;
a.cc:15:9: error: expected primary-expression before 'for'
   15 |         for (int i = 1; i < n; ++i)
      |         ^~~
a.cc:14:28: error: expected ')' before 'for'
   14 |         int najveci = a[0];
      |                            ^
      |                            )
   15 |         for (int i = 1; i < n; ++i)
      |         ~~~                 
a.cc:10:13: note: to match this '('
   10 |         for (int i = 0; i < n: ++i)
      |             ^
a.cc:20:9: error: 'najveci' was not declared in this scope
   20 |         najveci = najveci/2;
      |         ^~~~~~~
Language: C++

#include <iostream>
using namespace std;
 
int a[10000];
 
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n: ++i)
	{
		cin >> a[i];
	}
	for (int i = 1; i < n; ++i)
    int najveci = a[0];
	{
		if (najveci < a[i])
		najveci = a[i];
	}
	najveci = najveci/2;
	int c=0;
	for (int i = 0; i < n; i++)
	{
		c = c + a[i];	
	}
	cout << c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   10 |         for (int i = 0; i < n: ++i)
      |                         ^
a.cc:10:30: error: expected ';' before ':' token
   10 |         for (int i = 0; i < n: ++i)
      |                              ^
      |                              ;
a.cc:14:9: error: expected primary-expression before 'for'
   14 |         for (int i = 1; i < n; ++i)
      |         ^~~
a.cc:13:10: error: expected ';' before 'for'
   13 |         }
      |          ^
      |          ;
   14 |         for (int i = 1; i < n; ++i)
      |         ~~~
a.cc:14:9: error: expected primary-expression before 'for'
   14 |         for (int i = 1; i < n; ++i)
      |         ^~~
a.cc:13:10: error: expected ')' before 'for'
   13 |         }
      |          ^
      |          )
   14 |         for (int i = 1; i < n; ++i)
      |         ~~~
a.cc:10:13: note: to match this '('
   10 |         for (int i = 0; i < n: ++i)
      |             ^
a.cc:17:21: error: 'najveci' was not declared in this scope
   17 |                 if (najveci < a[i])
      |                     ^~~~~~~
a.cc:17:33: error: 'i' was not declared in this scope
   17 |                 if (najveci < a[i])
      |                                 ^
a.cc:20:9: error: 'najveci' was not declared in this scope
   20 |         najveci = najveci/2;
      |         ^~~~~~~
Language: C++

#include <iostream>
using namespace std;
 
int a[100];
 
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n: ++i)
	{
		cin >> a[i];
	}
	for (int i = 1; i < n; ++i)
	{
		if (najveci < a[i])
		najveci = a[i];
	}
	najveci = najveci/2;
	int c=0;
	for (int i = 0; i < n; i++)
	{
		c = c + a[i];	
	}
	cout << c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   10 |         for (int i = 0; i < n: ++i)
      |                         ^
a.cc:10:30: error: expected ';' before ':' token
   10 |         for (int i = 0; i < n: ++i)
      |                              ^
      |                              ;
a.cc:14:9: error: expected primary-expression before 'for'
   14 |         for (int i = 1; i < n; ++i)
      |         ^~~
a.cc:13:10: error: expected ';' before 'for'
   13 |         }
      |          ^
      |          ;
   14 |         for (int i = 1; i < n; ++i)
      |         ~~~
a.cc:14:9: error: expected primary-expression before 'for'
   14 |         for (int i = 1; i < n; ++i)
      |         ^~~
a.cc:13:10: error: expected ')' before 'for'
   13 |         }
      |          ^
      |          )
   14 |         for (int i = 1; i < n; ++i)
      |         ~~~
a.cc:10:13: note: to match this '('
   10 |         for (int i = 0; i < n: ++i)
      |             ^
a.cc:16:21: error: 'najveci' was not declared in this scope
   16 |                 if (najveci < a[i])
      |                     ^~~~~~~
a.cc:19:9: error: 'najveci' was not declared in this scope
   19 |         najveci = najveci/2;
      |         ^~~~~~~
Language: C++

#include <iostream>
using namespace std;
 
int a[100];
 
int main()
{
	int n;
	cin >> n;
	int najveci = a[0];
	for (int i = 0; i < n: ++i)
	{
		cin >> a[i];
	}
	for (int i = 1; i < n: ++i)
	{
		if (najveci < a[i])
		najveci = a[i];
	}
	najveci = najveci/2;
	int c=0;
	for (int i = 0; i < 100; ++i)
	{
		c = c + a[i] + najveci;	
	}
	cout << c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   11 |         for (int i = 0; i < n: ++i)
      |                         ^
a.cc:11:30: error: expected ';' before ':' token
   11 |         for (int i = 0; i < n: ++i)
      |                              ^
      |                              ;
a.cc:15:9: error: expected primary-expression before 'for'
   15 |         for (int i = 1; i < n: ++i)
      |         ^~~
a.cc:14:10: error: expected ';' before 'for'
   14 |         }
      |          ^
      |          ;
   15 |         for (int i = 1; i < n: ++i)
      |         ~~~
a.cc:15:9: error: expected primary-expression before 'for'
   15 |         for (int i = 1; i < n: ++i)
      |         ^~~
a.cc:14:10: error: expected ')' before 'for'
   14 |         }
      |          ^
      |          )
   15 |         for (int i = 1; i < n: ++i)
      |         ~~~
a.cc:11:13: note: to match this '('
   11 |         for (int i = 0; i < n: ++i)
      |             ^
a.cc:15:25: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   15 |         for (int i = 1; i < n: ++i)
      |                         ^
a.cc:15:30: error: expected ';' before ':' token
   15 |         for (int i = 1; i < n: ++i)
      |                              ^
      |                              ;
a.cc:21:9: error: expected primary-expression before 'int'
   21 |         int c=0;
      |         ^~~
a.cc:20:29: error: expected ')' before 'int'
   20 |         najveci = najveci/2;
      |                             ^
      |                             )
   21 |         int c=0;
      |         ~~~                  
a.cc:15:13: note: to match this '('
   15 |         for (int i = 1; i < n: ++i)
      |             ^
a.cc:24:17: error: 'c' was not declared in this scope
   24 |                 c = c + a[i] + najveci;
      |                 ^
a.cc:26:17: error: 'c' was not declared in this scope
   26 |         cout << c;
      |                 ^
Language: C++

#include <iostream>
using namespace std;
 
int P[10000];
 
int main()
{
	int n;
	cin >> n;
	int najveci = a[0];
	for (int i = 1, i < 100, ++i)
		if (najveci < a[i])
		najveci = a[i];
		najveci = najveci/2;
	int c=0;
	for (int i = 0, i < 100, i++)
		c = c + a[i] + najveci;	
	cout << c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: 'a' was not declared in this scope
   10 |         int najveci = a[0];
      |                       ^
a.cc:11:26: error: expected ';' before '<' token
   11 |         for (int i = 1, i < 100, ++i)
      |                          ^~
      |                          ;
a.cc:11:27: error: expected primary-expression before '<' token
   11 |         for (int i = 1, i < 100, ++i)
      |                           ^
a.cc:11:37: error: expected ';' before ')' token
   11 |         for (int i = 1, i < 100, ++i)
      |                                     ^
      |                                     ;
a.cc:16:26: error: expected ';' before '<' token
   16 |         for (int i = 0, i < 100, i++)
      |                          ^~
      |                          ;
a.cc:16:27: error: expected primary-expression before '<' token
   16 |         for (int i = 0, i < 100, i++)
      |                           ^
a.cc:16:37: error: expected ';' before ')' token
   16 |         for (int i = 0, i < 100, i++)
      |                                     ^
      |                                     ;
Language: C++

#include <iostream>
using namespace std;
 
int P[10000];
 
int main()
{
	int najveci = a[0];
	for (int i = 1, i < 100, ++i)
    {
      if (najveci < a[i])
		najveci = a[i];
    }
	najveci = najveci/2;
	int c=0;
	for (int i = 0, i < 100, i++)
    {
      c = c + a[i] + najveci;	
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: 'a' was not declared in this scope
    8 |         int najveci = a[0];
      |                       ^
a.cc:9:26: error: expected ';' before '<' token
    9 |         for (int i = 1, i < 100, ++i)
      |                          ^~
      |                          ;
a.cc:9:27: error: expected primary-expression before '<' token
    9 |         for (int i = 1, i < 100, ++i)
      |                           ^
a.cc:9:37: error: expected ';' before ')' token
    9 |         for (int i = 1, i < 100, ++i)
      |                                     ^
      |                                     ;
a.cc:16:26: error: expected ';' before '<' token
   16 |         for (int i = 0, i < 100, i++)
      |                          ^~
      |                          ;
a.cc:16:27: error: expected primary-expression before '<' token
   16 |         for (int i = 0, i < 100, i++)
      |                           ^
a.cc:16:37: error: expected ';' before ')' token
   16 |         for (int i = 0, i < 100, i++)
      |                                     ^
      |                                     ;
Language: C++

#include <iostream>
using namespace std;
 
int P[10000];
 
int main()
{
	int najveci = a[0];
	for (int i = 1, i < 100, ++i)
		if (najveci < a[i])
		najveci = a[i];
	najveci = najveci/2;
	int c=0;
	for (int i = 0, i < 100, i++)
		c = c + a[i] + najveci;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: 'a' was not declared in this scope
    8 |         int najveci = a[0];
      |                       ^
a.cc:9:26: error: expected ';' before '<' token
    9 |         for (int i = 1, i < 100, ++i)
      |                          ^~
      |                          ;
a.cc:9:27: error: expected primary-expression before '<' token
    9 |         for (int i = 1, i < 100, ++i)
      |                           ^
a.cc:9:37: error: expected ';' before ')' token
    9 |         for (int i = 1, i < 100, ++i)
      |                                     ^
      |                                     ;
a.cc:14:26: error: expected ';' before '<' token
   14 |         for (int i = 0, i < 100, i++)
      |                          ^~
      |                          ;
a.cc:14:27: error: expected primary-expression before '<' token
   14 |         for (int i = 0, i < 100, i++)
      |                           ^
a.cc:14:37: error: expected ';' before ')' token
   14 |         for (int i = 0, i < 100, i++)
      |                                     ^
      |                                     ;
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> p(N);
  rep(i,N){
    cin >> p.at(i);
  }
  sort(p.begin(),p.end());
  int m = 0;
  rep(i,N){
    if(i==N-1){
      cnt += p.at(i)/2;
    }else{
      cnt += p.at(i);
    }
  }
  cout << m <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   16 |       cnt += p.at(i)/2;
      |       ^~~
      |       int
a.cc:18:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   18 |       cnt += p.at(i);
      |       ^~~
      |       int
Language: C++

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

int main(){
    int n;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    int m = 100;
    int sum = 0;
    rep(i,n){
        sum += p[i];
        m = max(m,s[i]);
    }
    cout << sum - m/2 << endl;
}

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

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

int main(){
    int n;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    int m = 100;
    int sum = 0;
    rep(i,n){
        sum += s[i];
        m = max(m,s[i]);
    }
    cout << sum - m/2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 's' was not declared in this scope
   13 |         sum += s[i];
      |                ^
Language: C++

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

using ll=long long;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int price[n];
  rep(i,n) cin >> price[i];
  sort(price.rbegin(),price.rend());
  int ans = 0;
  rep(i,n) {
    if(i = 0) ans += price[i]/2;
    else ans += price[i];
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: request for member 'rbegin' in 'price', which is of non-class type 'int [n]'
   15 |   sort(price.rbegin(),price.rend());
      |              ^~~~~~
a.cc:15:29: error: request for member 'rend' in 'price', which is of non-class type 'int [n]'
   15 |   sort(price.rbegin(),price.rend());
      |                             ^~~~
Language: C++

#include <iostream>
using namespace std;
int p[10];
int main()
{
 int n,zbroj=0;
 cin >> n;
 for(int i=0;i<n;i++)
 {
     cin >> p[i];
    max=p[1];
 
    for(i=1;i<10;i++)
    {
         if(p[i]>max)
        {
            max=p[i];
        }
     }
     zbroj = zbroj+(max/2)+p[i];
 }
 cout << zbroj;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: overloaded function with no contextual type information
   11 |     max=p[1];
      |            ^
a.cc:15:17: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>'
   15 |          if(p[i]>max)
      |             ~~~~^~~~
a.cc:17:20: error: overloaded function with no contextual type information
   17 |             max=p[i];
      |                    ^
a.cc:20:24: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator/'
   20 |      zbroj = zbroj+(max/2)+p[i];
      |                     ~~~^~
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.at(i);
  }
  
   sort(p.begin(), p.end());
  int S =0;
  for (int i = 0; i < N-1; i++) {
 S +=p[i]
}
S += p[N]/2
cout << S <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: expected ';' before '}' token
   15 |  S +=p[i]
      |          ^
      |          ;
   16 | }
      | ~         
a.cc:17:12: error: expected ';' before 'cout'
   17 | S += p[N]/2
      |            ^
      |            ;
   18 | cout << S <<endl;
      | ~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int p[n];
int sum;
int max = 0;
for(int i = 0;i < n;i++){
  cin >> p[i];
  sum += p[i];
  if(p[i] > max){
    max = p[i];
  }


  cout << sum - max/2 <<endl;
}


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

import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(SYstem.in);
    int N = sc.nextInt();
    int[] price = new int[N];
    int sum = 0;
    int max = 0;
    for(int i=0; i<N; i++){
      int tmp = sc.nextInt();
      sum += tmp;
      price[i] = tmp;
      max = Math.max(tmp, max);
    }
    sum = sum - max + (max/2);
    System.out.print(sum);
  }
}

Compiler output:
Main.java:4: error: cannot find symbol
    Scanner sc = new Scanner(SYstem.in);
                             ^
  symbol:   variable SYstem
  location: class Main
1 error
Language: C++


#include <iostream>

using namespace std;

int main(){
    int N;
    cin >> N;
    int S = 0;
    int max = 0;
    for(int i = 0;i < N;i++){
        int a;
        cin >> a;
        S += a;
        max = std::max(max, a);
    }
    S -= max/2
    cout << S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: expected ';' before 'cout'
   17 |     S -= max/2
      |               ^
      |               ;
   18 |     cout << S << endl;
      |     ~~~~
Language: C++


#include <iostream>

using namespace std;

int main(){
    int N;
    cin >> N;
    int S;
    int max = 0;
    for(int i = 0;i < N;i++){
        int a;
        cin >> a;
        S += a;
        max = std::max(max, a);
    }
    S -= max/2
    cout << S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: expected ';' before 'cout'
   17 |     S -= max/2
      |               ^
      |               ;
   18 |     cout << S << endl;
      |     ~~~~
Language: C++

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

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

typedef unsigned long long ull;
typedef long long ll;

const int INF = 1001001001;

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

    vector<int> p(n); int maxi = 0;
    rep(i, n) { 
        cin >> p[i];
        maxi = max(maxi, p[i]);
    }

    int sum = 0;
    rep (i, n) {
        sum += (maxi == p[i]) ? p[i]/2 : p[i];
        count--;
    }
    cout << ((sum == p[0]/2 * n) ? sum * 2 - p[0]/2 : sum) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: no post-decrement operator for type
   25 |         count--;
      |              ^~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'll' was not declared in this scope
   10 |   ll res = 0;
      |   ^~
a.cc:12:5: error: 'res' was not declared in this scope
   12 |     res += p[i];
      |     ^~~
a.cc:14:3: error: 'res' was not declared in this scope
   14 |   res += (p[N-1]/2);
      |   ^~~
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
 
int main()
{
  int n,sum=0;
  scanf("%d",&n);
  int p[n],i;
  for(i=0;i<n;++i)
       scanf("%d",&p[i]);
  
  sort(p,p+n);
  
  for(i=0;i<n-1;++i)
      sum+=p[i];
  
  sum+=p[n-1]/2;
  
  printf("%d",sum);
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   12 |   sort(p,p+n);
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include <bits/stdc++.h>

int main()
{
  int n,sum=0;
  scanf("%d",&n);
  int p[n],i;
  for(i=0;i<n;++i)
       scanf("%d",&p[i]);
  
  sort(p,p+n);
  
  for(i=0;i<n-1;++i)
      sum+=p[i];
  
  sum+=p[n-1]/2;
  
  printf("%d",sum);
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   11 |   sort(p,p+n);
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
typedef long long ll;

int main(){
  int n,p;
  cin >> n;
  int sum = 0;
  int mx = 0;
  rep(i,n){
    cin >> p;
    mx = max(mx,p);
    sum += p;
  }
  cout << sum-ma/2 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: 'ma' was not declared in this scope; did you mean 'mx'?
   18 |   cout << sum-ma/2 << endl;
      |               ^~
      |               mx
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
typedef long long ll;

int main(){
  int n,p;
  cin >> n;
  int sum = 0;
  int mx = 0;
  rep(i,n){
    cin >> p:
    mx = max(mx,p);
    sum += p;
  }
  cout << sum-ma/2 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: found ':' in nested-name-specifier, expected '::'
   14 |     cin >> p:
      |             ^
      |             ::
a.cc:14:12: error: 'p' is not a class, namespace, or enumeration
   14 |     cin >> p:
      |            ^
a.cc:18:15: error: 'ma' was not declared in this scope; did you mean 'mx'?
   18 |   cout << sum-ma/2 << endl;
      |               ^~
      |               mx
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
typedef long long ll;

int main(){
  int n;
  cin >> n;
  int sum = 0;
  int mx = 0;
  rep(i,n){
    cin >> p:
    mx = max(mx,p);
    sum += p;
  }
  cout << sum-ma/2 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: found ':' in nested-name-specifier, expected '::'
   14 |     cin >> p:
      |             ^
      |             ::
a.cc:14:12: error: 'p' has not been declared
   14 |     cin >> p:
      |            ^
a.cc:15:17: error: 'p' was not declared in this scope
   15 |     mx = max(mx,p);
      |                 ^
a.cc:18:15: error: 'ma' was not declared in this scope; did you mean 'mx'?
   18 |   cout << sum-ma/2 << endl;
      |               ^~
      |               mx
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'M' was not declared in this scope
    8 |     max = max<p?p:M;
      |                   ^
Language: C++

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

Compiler output:
a.cc:8:13: error: extended character 　 is not valid in an identifier
    8 |     M = M>p?　M:p;
      |             ^
a.cc: In function 'int main()':
a.cc:8:13: error: '\U00003000M' was not declared in this scope
    8 |     M = M>p?　M:p;
      |             ^~~
Language: C

#include <stdio.h>
int main(void){
int n;
int p[20];
int max=99999;
int num;
int sum=0;
scanf("%d",&n);
for(count=0;count<n;count++){
    scanf("%d",&p[count]);
}
for(count=0;count<n;count++){
    if(max>p[count]){max=p[count];}
    num=count;
}
p[num]=p[num]/2;
for(count=0;count<n;count++){
   sum=sum+p[count];
}
printf("%d\n",sum);
}

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

#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m;i<n;i++)
#define c(n) cin>>n
#define co(n) cout<<n<<endl
using namespace std;

int main(){
  int a,b,c=0,d=0,e,n,m,x,y;
  c(n);
  xx[n];
  rep(i,0,n){
    c(xx[i]);
    c+=xx[i];
    d=max(d,xx[i]);
  }
  co(c-d/2);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'xx' was not declared in this scope; did you mean 'x'?
   10 |   xx[n];
      |   ^~
      |   x
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: expected ',' or ';' before 'M'
    6 |   int sum = 0. M = 10000;
      |                ^
a.cc:10:5: error: 'M' was not declared in this scope
   10 |     M = max(M,p);
      |     ^
a.cc:12:17: error: 'M' was not declared in this scope
   12 |   cout << sum - M / 2;
      |                 ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'M' was not declared in this scope
    6 |   int sum = 0; M = 10000;
      |                ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
int n,p[12345];
signed main(){
	cin>>n;
	for(int i=0;i<n;i++)cin>>p[i];
	sort(p,p+n);
	
	for(int i=0;i<n-1;i++){
		a+=p[i];
	}
	a+=p[i]/2;
	cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'a' was not declared in this scope
   11 |                 a+=p[i];
      |                 ^
a.cc:13:9: error: 'a' was not declared in this scope
   13 |         a+=p[i]/2;
      |         ^
a.cc:13:14: error: 'i' was not declared in this scope
   13 |         a+=p[i]/2;
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,all;x;
  cin >> n;
  vector<int>p;
  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:12:19: error: expected ';' before '}' token
   12 |     all += p.at(0)
      |                   ^
      |                   ;
   13 |   }
      |   ~