Language: C++

#include <bits/stdc++.h>

/*                    ॐ Shree ॐ                     */
/* ॐ ॐ ॐ
ॐ भूर् भुवः स्वः
तत् सवितुर्वरेण्यं
भर्गो देवस्य धीमहि
धियो यो नः प्रचोदयात्
*/
using namespace std;
typedef pair<ll, ll> pp;
typedef long long ll ll;
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
// online submission
#endif
	ll n;
	cin>>n;
	vector<ll> v(n);
	for(ll i=0;i<n;i++){
		cin>>v[i];
	}
	sort(v.begin(),v.end());
	ll sum=0;
	ll j=n-1;
	ll k=n-1;
	for(ll i=0;i<k/2;i++){
		sum+=2*v[j];
		j--;
	}
	if(k%2){
		sum+=v[j];
	}
	cout<<sum;
}

Compiler output:
a.cc:11:14: error: 'll' was not declared in this scope
   11 | typedef pair<ll, ll> pp;
      |              ^~
a.cc:11:18: error: 'll' was not declared in this scope
   11 | typedef pair<ll, ll> pp;
      |                  ^~
a.cc:11:20: error: template argument 1 is invalid
   11 | typedef pair<ll, ll> pp;
      |                    ^
a.cc:11:20: error: template argument 2 is invalid
a.cc:12:22: error: expected initializer before 'll'
   12 | typedef long long ll ll;
      |                      ^~
a.cc: In function 'int main()':
a.cc:23:9: error: 'll' was not declared in this scope
   23 |         ll n;
      |         ^~
a.cc:24:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   24 |         cin>>n;
      |              ^
      |              yn
a.cc:25:18: error: template argument 2 is invalid
   25 |         vector<ll> v(n);
      |                  ^
a.cc:26:15: error: expected ';' before 'i'
   26 |         for(ll i=0;i<n;i++){
      |               ^~
      |               ;
a.cc:26:20: error: 'i' was not declared in this scope
   26 |         for(ll i=0;i<n;i++){
      |                    ^
a.cc:29:16: error: request for member 'begin' in 'v', which is of non-class type 'int'
   29 |         sort(v.begin(),v.end());
      |                ^~~~~
a.cc:29:26: error: request for member 'end' in 'v', which is of non-class type 'int'
   29 |         sort(v.begin(),v.end());
      |                          ^~~
a.cc:30:11: error: expected ';' before 'sum'
   30 |         ll sum=0;
      |           ^~~~
      |           ;
a.cc:31:11: error: expected ';' before 'j'
   31 |         ll j=n-1;
      |           ^~
      |           ;
a.cc:32:11: error: expected ';' before 'k'
   32 |         ll k=n-1;
      |           ^~
      |           ;
a.cc:33:15: error: expected ';' before 'i'
   33 |         for(ll i=0;i<k/2;i++){
      |               ^~
      |               ;
a.cc:33:20: error: 'i' was not declared in this scope
   33 |         for(ll i=0;i<k/2;i++){
      |                    ^
a.cc:33:22: error: 'k' was not declared in this scope
   33 |         for(ll i=0;i<k/2;i++){
      |                      ^
a.cc:34:17: error: 'sum' was not declared in this scope
   34 |                 sum+=2*v[j];
      |                 ^~~
a.cc:34:26: error: 'j' was not declared in this scope
   34 |                 sum+=2*v[j];
      |                          ^
a.cc:37:12: error: 'k' was not declared in this scope
   37 |         if(k%2){
      |            ^
a.cc:38:17: error: 'sum' was not declared in this scope
   38 |                 sum+=v[j];
      |                 ^~~
a.cc:38:24: error: 'j' was not declared in this scope
   38 |                 sum+=v[j];
      |                        ^
a.cc:40:15: error: 'sum' was not declared in this scope
   40 |         cout<<sum;
      |               ^~~