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

//Keep working hard :)
#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long

void fileIO()
{
        #ifndef ONLINE_JUDGE
        freopen("int.txt","r",stdin);
        freopen("out.txt","w",stdout);
        #endif
}
int main()
{
	IOS;
       // fileIO();
        multiset<int> s;
        int n,m;
        cin >> n >> m;
        for(int i = 0; i < n; i++)
        {
                int x;
                cin >> x;
                s.insert(x);
        }
        for(int i = 0; i < m; i++)
        {
                int b,c;
                cin >> b >> c;
                for(int j = 0; j < b; j++)
                {
                        auto it = s.begin();
                        if(*it < c)
                        {
                                s.erase(it);
                                s.insert(c);
                        }
                        else
                        {
                                break;
                        }
                }
        }
        ll temp = 0;
        for(auto i : s)
        {
                temp += i;
        }
        cout << temp;
	return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:46:9: error: 'll' was not declared in this scope
   46 |         ll temp = 0;
      |         ^~
a.cc:49:17: error: 'temp' was not declared in this scope; did you mean 'tm'?
   49 |                 temp += i;
      |                 ^~~~
      |                 tm
a.cc:51:17: error: 'temp' was not declared in this scope; did you mean 'tm'?
   51 |         cout << temp;
      |                 ^~~~
      |                 tm
Language: C++

#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

int main(void)
{
    unsigned int n, m;
    vector<unsigned int> a;
    unsigned int b, c;
    unsigned int tmp;
    unsigned long long int s;
    cin >> n >> m;
    a.reserve(n);
    for (int i = 0; i < n; i++) {
        cin >> tmp;
        a.push_back(tmp);
    }
    for (int j = 0; j < m; j++) {
        sort(a.begin(), a.end());
        cin >> b >> c;
        for (int k = 0; k < b; k++) {
            if (a[k] < c) a[k] = c;
            else break;
        }
    }
    s = accumulate(a.begin(), a.end(), 0LL);
    cout << s << endl;

    return 0;
}



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

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

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))


int main (void)
{
	long int N, M;
	// cin >> N >> M;
	scanf("%ld %ld", &N, &M);
	vector<int> A(N);
	int exec[M][2];
	for (int i = 0; i < N; i++) cin >> A[i];

	for (int i = 0; i < M; i++)
	{
		scanf("%d %d", &exec[i][0], &exec[i][1]);
		// cin >> exec[i][0] >> exec[i][1];
	}

	for (int j = 0; j < M; j++)
	{
		sort(A.begin(), A.end());
		int change = 0;
		for (int k = 0; k < N; k++)
		{
			if (exec[j][1] > A[k])
			{
				A[k] = exec[j][1];
				change++;
			}
			if (change == exec[j][0]) break;
		}
	}

	M = 0;
	for (int i = 0; i < N; i++)
	{
		M += A[i];
	}

	printf("%ld", M);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   25 |                 sort(A.begin(), A.end());
      |                 ^~~~
      |                 short
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;


/** Class for buffered reading int and double values */
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
	
    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
} 
public class third {

	public static void main(String[] args)throws IOException {
		// TODO Auto-generated method stub
		Reader.init(System.in);
		int n = Reader.nextInt();
		int m = Reader.nextInt();
		PriorityQueue<Long> pq = new PriorityQueue<Long>();
		// long arr[] = new int[n];
		long b[] = new long[m];
		long c[] = new long[m];
		long val = 0;
		long sum = 0;
		for(int i=0;i<n;i++)
		{
			val = Reader.nextInt();
			sum+=val;
			pq.add(val);
		}
		for(int i=0;i<m;i++)
		{
			b[i] = Reader.nextInt();
			c[i] = Reader.nextInt();
		}
		// Arrays.s/ort(arr);
		for(int i=0;i<m;i++)
		{
			while(b[i]>0)
			{
				if(pq.peek()<c[i])
				{
					val = pq.poll();
					pq.add(c[i]);
					sum+=(c[i]-val);
					b[i]--;
					continue;
				}
				break;
			}
		}

		System.out.println(sum);
	}

}

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

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

int main() {
  int n,m;
  cin >> n >> m;
  vector<long> a(n);
  vector<vector<long>> b(m, vector<long>(2));
  for(int i=0;i<n;i++){
    cin >> a.at(i);
  }
  vector<vector<long>> b(m, vector<long>(2));
  for(int i=0;i<m;i++){
    cin >> b.at(i).at(0) >> b.at(i).at(1);
    sort(a.begin(), a.end());
    for(int j=0;j<b.at(i).at(0);j++){
      if (a.at(j) > b.at(i).at(1)){
        break;
      }
      else {
        a.at(j) = b.at(i).at(1);
      }
    }
  }
  
  long ans = 0;
  for(int i=0;i<n;i++){
    ans += a.at(i);
  }
  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: redeclaration of 'std::vector<std::vector<long int> > b'
   12 |   vector<vector<long>> b(m, vector<long>(2));
      |                        ^
a.cc:8:24: note: 'std::vector<std::vector<long int> > b' previously declared here
    8 |   vector<vector<long>> b(m, vector<long>(2));
      |                        ^
Language: C++

#include <bits/stdc++.h>

using namespace std;


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

  vector<int> A(N);
  vector<int> B(M);
  vector<int> C(M);
  for(int i=0;i<N;i++){
    cin >> A[i];
  }

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

  for(int i=0;i<M;i++){
    cin >> B[i] >> C[i];
  }

  int cnt = 0;
  for(int i=0;i<M;i++){
    cnt = 0;
    for(int j =0;j<N;j++){
      if(cnt == B[i]){
        break;
      }
      if(A[j] < C[i]){
        A[j] = C[i];
        cnt++;
      }
    }
  }

  cout << accumulate(A.begin(), A.end(), 0) << endl;


  return 0;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: expected ')' before ';' token
   17 |   sort(A.begin(), A.end();
      |       ~                  ^
      |                          )
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int _N, N, M;
int b, c;
int A[10001000000];
long sum;

int main(void){
	cin >> N >> M;
	_N = N;
	for(int i=0; i<N; i++) cin >> A[i];
	for(int i=0; i<M; i++){
		cin >> b >> c;
		for(int j=0; j<b; j++){
			A[N+j] = c;
		}
		N+=b;
	}
	sort(A, A+N);
	sum = 0;
	for(int i=0; i<_N; i++){
		sum += A[N-i];
	}
	cout << sum << endl;
	return 0;
}

Compiler output:
/tmp/cc71FGqP.o: in function `main':
a.cc:(.text+0x151): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/cc71FGqP.o
a.cc:(.text+0x185): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/cc71FGqP.o
a.cc:(.text+0x18f): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/cc71FGqP.o
a.cc:(.text+0x1a5): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/cc71FGqP.o
collect2: error: ld returned 1 exit status
Language: C++

#include "bits/stdc++.h"

#define REP(i, a, b) for (int i = (a); i <= (b); ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define FORV(a, A) for (auto &a : A)

using namespace std;

using ll = long long;

void Main()
{
   int N, M;
   cin >> N >> M;
   vector<ll> A(N);
   for (auto &a : A)
   {
      cin >> a;
   }
   std::sort(A.begin(), A.end());
   ll Amax = A[N - 1];
   ll Amin = A[0];
   map<ll, ll> CH;
   ll b, c;
   for (int i = 0; i < M; i++)
   {
      cin >> b >> c;
      if (Amin < c)
      {
         if (CH[c] == -1)
         {
            CH[c] = b;
         }
         else
         {
            CH[c] += b;
         }
      }
   }
   ll count = 0, j;
   int64_t ans = 0;
   if (CH.size != 0)
   {
      for (auto i = CH.rbegin(); i != CH.rend(); ++i)
      {
         for (j = count; j < count + i->second && j < N; j++)
         {
            if (A[j] >= i->first)
            {
               break;
            }
         }
         if (j - count == 0 || j == N - 1)
         {
            break;
         }
         ans += i->first * (j - count);
         count += j - count;
      }
   }
   for (int i = count; i < N; i++)
      ans += A[i];
   std::cout << ans << endl;
}

int main()
{
   std::cin.tie(nullptr);
   std::ios_base::sync_with_stdio(false);
   std::cout << std::fixed << std::setprecision(15);
   Main();
   return 0;
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:42:11: error: invalid use of member function 'std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::size() const [with _Key = long long int; _Tp = long long int; _Compare = std::less<long long int>; _Alloc = std::allocator<std::pair<const long long int, long long int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   42 |    if (CH.size != 0)
      |        ~~~^~~~
      |               ()
Language: C++

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

int main(){
	int N, M;
	cin >> N >> M;
	vector<int> v;
	for (int i = 0; i < N; ++i){
		int a;
		cin >> a;
		v.push_back(a);
	}
	sort(v.begin(), v.end(), greater<int>());

	for (int i = 0; i < M; ++i){
		int b, c;
		cin >> b >> c;
		if (c > v[v.end()-1]){
			for (int j = 0; j < b; ++j){
				v.push_back(c);
			}			
		}
	}
	sort(v.begin(), v.end(), greater<int>());

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:26: error: no match for 'operator[]' (operand types are 'std::vector<int>' and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >')
   20 |                 if (c > v[v.end()-1]){
      |                          ^
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/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 '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' 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 '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'std::vector<int>::size_type' {aka 'long unsigned int'}
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
Language: C++

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

int main() {
  long long N, M; cin >> N >> M;
  vector<int> A(N);
  for(int i=0; i<N; i++) cin >> A.at(i);
  sort(A.begin(), A.end());
  
  long long s = 0;
  for(int i=0; i<N; i++) {
    s += A.at(i);
  }
  
  long long B, C;
  for(int i=0; i<M; i++) {
    cin >> B >> C;
    for(int j=0; j<B; j++) {
      if (A.at(j) >= C) break;
      else {
        s += C - A.at(j);
        A.at(j) = C;
      }
    }
    sort(A.begin(), A.end());
  }
  cout << s << endl;
}

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

nm = list(map(int,input().split()))
a = list(map(int,input().split()))
for i in range(nm[1]):
    bc = list(map(int,input().split()))
    plus = [bc[1] for akds in range(bc[0])]
    a += plus
a.sort(reverse=True)

sum = 0
for x in a[:nm[0]]:
    sum += x
print(sum)

Compiler output:
a.cc:1:1: error: 'nm' does not name a type
    1 | nm = list(map(int,input().split()))
      | ^~
Language: C

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

int
compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int
main(void)
{
        int N;
        int M;

        scanf("%d %d\n", &N, &M);

        int *A;
        A = malloc(sizeof(int) * N);
        for (int i = 0; i < N; i++)
                scanf("%d%*c", &A[i]);
        qsort(A, i + 1, sizeof(int), compare_int);

        for (int i = 0; i < M; i++) {
                int B;
                int C;
                scanf("%d %d\n", &B, &C);
                for (int j = 0; j < B; j++) {
                        if (A[j] < C)
                                A[j] = C;
                        else
                                break;
                }
                qsort(A, N, sizeof(int), compare_int);
        }

        int64_t sum = 0;
        for (int i = 0; i < N; i++)
                sum += A[i];

        printf("%ld", sum);

        return 0;
}



Compiler output:
main.c: In function 'main':
main.c:24:18: error: 'i' undeclared (first use in this function)
   24 |         qsort(A, i + 1, sizeof(int), compare_int);
      |                  ^
main.c:24:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

nm = list(map(int,input().split()))
a = list(map(int,input().split()))
for i in range(nm[1]):
    bc = list(map(int,input().split()))
    plus = [bc[1] for akds in range(bc[0])]
    a += plus
a.sort(reverse=True)
# print(a)
sum = 0
for x in a[:nm[0]]:
    sum += x
print(sum)

Compiler output:
a.cc:8:3: error: invalid preprocessing directive #print
    8 | # print(a)
      |   ^~~~~
a.cc:1:1: error: 'nm' does not name a type
    1 | nm = list(map(int,input().split()))
      | ^~
Language: C++

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

int main(){
  int n,m,; cin>>n >>m;
  vector<int> a(n);
  vector<int> b(m);
  vector<int> c(m);
  for(int i=0;i<n;i++){
    cin>>a.at(i);
  }  
  for(int i=0;i<m;i++){
    cin>>b.at(i) >>c.at(i);
  }
  
  sort(a.begin(),a.end());
  
  for(int j=0;j<m;j++){
    for(int i=0;i<n;i++){
      if(c.at(j) > a.at(i)){
        a.at(i) = c.at(j);
      }
    }
  }
  
  int ans = 0;
  for(int i=0;i<n;i++){
    ans += a.at(i);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: expected unqualified-id before ';' token
    5 |   int n,m,; cin>>n >>m;
      |           ^
Language: C++

#include <iostream>

void swap(int *a,int *b){
	int temp=*a;
	*a=*b;
	*b=temp;
}
void quicksort(int a[],int lower,int upper){
	int bound=a[lower],l=lower,u=upper;
	do{
		while(a[l]<bound)l++;
		while(a[u]>bound)u--;
		if(l<=u){
			swap(&a[l],&a[u]);
			l++;
			u--;
		}
	}while(l<u);
	if(lower<u)quicksort(a,lower,u);
	if(l<upper)quicksort(a,l,upper);
}
int main(){
	int N,M,A[100000],B,C,ans=0;
	std::cin>>N;
	std::cin>>M;
	for(int i=0;i<N;i++){
		std::cin>>A[i];
	}
	for(int i=0;i<M;i++){
		quicksort(A,0,N-1);
		std::cin>>B;
		std::cin>>C;
		for(int j=0;C>A[j] && j<B;j++){
			A[j]=C;
		}
	}
		printArray(A,N);
	for(int i=0;i<N;i++){
		ans+=A[i];
	}
	std::cout<<ans<<std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:17: error: 'printArray' was not declared in this scope
   37 |                 printArray(A,N);
      |                 ^~~~~~~~~~
Language: C++

/* Akshat Sharma @akshat98 */
#include <iostream>
#include <bits/stdc++.h>
#define IOS  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define mp   make_pair
#define pb   push_back
#define F    first
#define S    second
#define ll   long long
#define MOD  1000000007
#define MAX  1000000001
#define vi 	 vector<ll>
#define vl   vector<ll>
#define vpi  vector<pair<ll,ll> >
#define vpl  vector<pair<ll,ll> >
#define rep(i,a,b) for(i=a;i<b;i++)
#define reqp(i,a,b) for(i=a;i<=b;i++)
#define ren for(i=0;i<n;i++)
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
typedef pair<int,int>pii;
typedef pair<ll,ll>pll;
#define int long long

int32_t main()
{
	#ifndef ONLINE_JUDGE
	//freopen("input_file.txt", "r", stdin);
	//freopen("output_file.txt", "w", stdout);
	#endif
	int i,j,k,l,n,test_case,m,r;
	test_case=1;
	//cin>>test_case;
	while(test_case--){
		cin>>n>>m;
		vi vec(n);
		priority_queue<int>pq;
		for(auto &it:vec){
			cin>>it;
			pq.push(it);
		}
		// sort(ALL(vec));
		vi b(m),c(m);
		priority_queue<pii>pqp;
		rep(i,0,m){
			cin>>b[i]>>c[i];
			pqp.push({c[i],b[i]});
		}
		
		ll sum=0;
		rep(i,0,n){
			if(!pqp.empty()){
				if(pq.top()>pqp.top().F){
					sum+=pq.top();
					pq.pop();
				}else{
					pii tp=pqp.top();
					pqp.pop();
					tp.S--;
					sum+=tp.F;
					if(tp.S){
						pqp.push(tp);
					}
				}
			}else{
				sum+=pq.top();
				pq.push();
			}
		}
		cout<<sum;






	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:67:40: error: no matching function for call to 'std::priority_queue<long long int>::push()'
   67 |                                 pq.push();
      |                                 ~~~~~~~^~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = long long int; _Sequence = std::vector<long long int>; _Compare = std::less<long long int>; value_type = long long int]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = long long int; _Sequence = std::vector<long long int>; _Compare = std::less<long long int>; value_type = long long int]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note:   candidate expects 1 argument, 0 provided
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
//int a[100000000];
int main() {
	int n, m;
	cin >> n >> m;
	//int a[100000000];
	long* a = new long[n];
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}

	for (int i = 0; i < m; i++)
	{
		stable_sort(a, a+n);
		int b, c;
		cin >> b >> c;
		for (int j = 0; j < b; j++)
		{
			if (c >= a[j])a[j] = c;
		}
	}
	long long sum = 0;
	for (int i = 0; i < n; i++)
	{
		//cout << "a[i] = "<<a[i] << endl;
		sum += a[i];
	}
	cout << sum;


Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: expected '}' at end of input
   32 |         cout << sum;
      |                     ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

// template version 1.11
using namespace std;
#include <iostream>
#include <bits/stdc++.h>

// varibable settings {{{
#define infile "../test/sample-1.in"
#define int long long
const int INF=1e18;
const int MOD=1e9+7;
// }}}

// define basic macro {{{
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;
#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#endif
//}}}

int solve(){
  int n,m;cin>>n>>m;
  vector<int> a(n);
  rep(i, n) {
    cin>>a[i];
  }
  sort(all(a));
  dump(a);

  dump(n,m);
  vector<pair<int, int>> E;
  rep(i, m){
    int b,c;
    cin>>b>>c;
    E.pb(mp(c, b));
  }
  sort(all(E), [](auto &left, auto &right){return left.first > right.first;});
  dump(E);

  int idx=0;
  each(e, E){
    int v = e.first;
    int cou = e.second;
    while(cou>0){
      if (a[idx]<v){
        a[idx]=v;
      }
      else{
        cout << accumulate(all(a), 0LL) << endl;
        return 0;
      }
      idx++;
      cou--;
    }
  }
  cout << accumulate(all(a), 0LL) << endl;

  return 0;
}

signed main() { //{{{
#ifdef INPUT_FROM_FILE
  std::ifstream in(infile);
  std::cin.rdbuf(in.rdbuf());
#endif
  solve();
  return 0;
} //}}}


Compiler output:
a.cc: In function 'long long int solve()':
a.cc:53:3: error: 'dump' was not declared in this scope; did you mean 'dup'?
   53 |   dump(a);
      |   ^~~~
      |   dup
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n,m;
    cin >> n>>m;
    vector<long> vec;
    long a; 
    for(int i=0; i<n;i++) {
        cin >> a;
        vec.push_back(a);
    } 
    long b,c;
    for(int i=0; i<m;i++) {
        cin >> b >> c;
        for(int j = 0;j<b;j++) vec.push_back(c);
    } 

    sort(vec.begin(), vec.end(), greater<int>());
    long res =0;
    for (int i = 0;i<n;i++){
        res += vec[i];
    } 
    cout << res << endl;
}

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

#include <iostream>

using namespace std;

int main(){
  int N, M, i, j;
  cin >> N >> M;
  long long int A[N], B[M], C[M], sum=0;
  for(i=0; i<N; i++) cin >> A[i];
  for(i=0; i<M; i++) cin >> B[i] >> C[i];
  for(i=0; i<M; i++){
    sort(A, A+N);
    for(j=0; j<B[i]; j++){
      if(A[j] < C[i]) A[j] = C[i];
      else break;
    }
  }
  for(i=0; i<N; i++) sum += A[i];
  cout << sum << endl;
  return 0;
}


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(A, A+N);
      |     ^~~~
      |     short
Language: C++

#include <bits/stdc++.h>

int main() {
  std::vector<std::pair<int, int>> ops;
  std::vector<int> values;
  int nNum, nOps;
  std::cin >> nNum >> nOps;
  
  initValues.resize(nNum);
  for (int i = 0; i < nNum; ++i) {
    std::cin >> values[i];
  }
  
  ops.resize(nOps);
  for (int i = 0; i < nOps; ++i) {
    std::cin >> ops[i].second >> ops[i].first;
  }
  
  std::sort(ops.begin(), ops.end());
  std::sort(values.begin(), values.end());
  
  int iter = 0;
  for (int i = nOps - 1; i >= 0; --i) {
    for (int j = 0; j < ops[i].second && iter < nNum; ++j, ++iter) {
      values[iter] = ops[i].first;
    }
  }
  
  long long sum = 0;
  for (int val : values) {
    sum += val;
  }
  std::cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'initValues' was not declared in this scope
    9 |   initValues.resize(nNum);
      |   ^~~~~~~~~~
Language: Java

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.AbstractMap.SimpleEntry;

import com.sun.java.swing.plaf.windows.WindowsTreeUI.CollapsedIcon;

public class IntegerCards {

    static final int modnum = 1000000007;

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

        int[] a = new int[N];

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

        Arrays.sort(a);

        // HashMap<Integer,Integer> map = new HashMap<Integer,Integer>();
        ArrayList<SimpleEntry<Integer,Integer>> list = new ArrayList<SimpleEntry<Integer,Integer>>();

        for(int i=0;i<M;i++){
            int b = sc.nextInt();
            int c = sc.nextInt();
            // if(map.containsKey(c))
            //     map.put(c,map.get(c)+b);
            // else
            //     map.put(c,b);
            list.add(new SimpleEntry<Integer,Integer>(c,b));
        }

        Collections.sort(list,Comparator.comparing(SimpleEntry<Integer,Integer>::getKey).reversed());

        int j = 0;
        for(int i=0;i<list.size();i++){
            SimpleEntry<Integer,Integer> pair = list.get(i);
            // System.out.println(pair.toString());
            for(int k=0;k<pair.getValue();k++){
                if(j < N && a[j]<pair.getKey())
                    a[j++]=pair.getKey();
                else
                    break;
            }
        }

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

        // System.out.println(Arrays.toString(a));
        System.out.println(ans);
    }
}

Compiler output:
Main.java:12: error: class IntegerCards is public, should be declared in a file named IntegerCards.java
public class IntegerCards {
       ^
Main.java:10: error: package com.sun.java.swing.plaf.windows.WindowsTreeUI does not exist
import com.sun.java.swing.plaf.windows.WindowsTreeUI.CollapsedIcon;
                                                    ^
2 errors
Language: C++

int main() {
  int N, M;
  cin >> N >> M;
  int tmpL, tmpR;
  int under_lim=1, up_lim=N;
  
  for (int i=0; i<M; i++) {
    cin >> tmpL >> tmpR;
    if(tmpL>under_lim) under_lim = tmpL;
    if(tmpR<up_lim) up_lim = tmpR;
  }
  
  if (up_lim<under_lim) cout << 0 << endl;
  else cout << up_lim -under_lim + 1 << endl;
  
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> N >> M;
      |   ^~~
a.cc:13:25: error: 'cout' was not declared in this scope
   13 |   if (up_lim<under_lim) cout << 0 << endl;
      |                         ^~~~
a.cc:13:38: error: 'endl' was not declared in this scope
   13 |   if (up_lim<under_lim) cout << 0 << endl;
      |                                      ^~~~
a.cc:14:8: error: 'cout' was not declared in this scope
   14 |   else cout << up_lim -under_lim + 1 << endl;
      |        ^~~~
a.cc:14:41: error: 'endl' was not declared in this scope
   14 |   else cout << up_lim -under_lim + 1 << endl;
      |                                         ^~~~
Language: Java

import java.util.*;
import java.io.*;

public class E127 {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n = sc.nextInt(); int m = sc.nextInt(); int k = sc.nextInt();
        initFac(n * m);
        long choose = nck(n * m - 2, k - 2);
        long first = m * ((long) m * (m - 1)) / 2;
        first %= mod;
        first = (first - (((long)m - 1) * m * (2 * m - 1)) / 6);
        if (first < 0) first += mod;
        first = (first * ((long) n * n)) % mod;
        long second = n * ((long) n * (n - 1)) / 2;
        second %= mod;
        second = (second - (((long)n - 1) * n * (2 * n - 1)) / 6);
        if (second < 0) second += mod;
        second = (second * ((long) m * m)) % mod;
        long res = (choose * ((first + second) % mod)) % mod;
        res %= mod;
        if (res < 0) res += mod;
        out.println(res);
        out.close();
    }

    static long[] fac;
    static long mod = (long) 1e9 + 7;

    static void initFac(long n) {
        fac = new long[(int)n + 1];
        fac[0] = 1;
        for (int i = 1; i <= n; i++) {
            fac[i] = (fac[i - 1]  * i) % mod;
        }
    }
    
    static long nck(int n, int k) {
        if (n < k)
            return 0;
        long den = inv((int) (fac[k] * fac[n - k] % mod));
        return fac[n] * den % mod;
    }

    static long pow(long b, long e) {
        long ans = 1;
        while (e > 0) {
            if (e % 2 == 1)
                ans = ans * b % mod;
            e >>= 1;
            b = b * b % mod;
        }
        return ans;
    }

    static long inv(long x) {
        return pow(x, mod - 2);
    }


    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }


    }

}

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

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i,n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<"\n"
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define mp make_pair
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using vc = vector<char>;
using vvc = vector<vc>;
template<class T> inline bool chmax(T& a, T b) { 
 if (a < b) { a = b; return true; } return false; 
}
template<class T> inline bool chmin(T& a, T b) {
 if (a > b) { a = b; return true; } return false; 
}
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
//二項係数 nCr
const int MAX = 700000;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main(){
  ll n,m,k;
  cin>>n>>m>>k;
  COMinit();
  ll ans=0;
  rep(i,m-1){
    ans+=i*(m-i)*n*n;
    ans%=MOD;
  }
  rep(i,n-1){
    ans+=i(n-i)*m*m;
    ans%=MOD;
  }
  ans*=COM(n+m-2,k-2);
  ans%=MOD;
  COUT(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:11: error: 'i' cannot be used as a function
   76 |     ans+=i(n-i)*m*m;
      |          ~^~~~~
Language: C++

let threshold = 1000000007
var fac: [Int] = [1]
var ifac: [Int] = [1]

func comb(_ n: Int, _ k: Int) -> Int {
  return ((fac[n] * ifac[k]) % threshold) * ifac[n-k] % threshold
}

func powd(_ x: Int, _ n: Int) -> Int {
  var result = 1
  var n = n
  var x = x
  while n != 0 {
    if n & 1 == 1 {
      result = result * x % threshold
    }
    x = x * x % threshold
    n >>= 1
  }
  return result
}

let input = readLine()!.split(separator: " ").map { Int($0)! }
let N = input[0]
let M = input[1]
let K = input[2]
for i in 1...N*M {
  fac.append(fac[i-1] * i % threshold)
  ifac.append(ifac[i-1] * powd(i, threshold - 2) % threshold)
}



var coe = comb(N * M - 2, K - 2)
var ans = 0
var a = 0
for i in 1..<N {
  a = i * (N - i)
  a %= threshold
  a *= (M * M)
  a %= threshold
  ans += a
  ans %= threshold
}
for i in 1..<M {
  a = i * (M - i)
  a %= threshold
  a *= (N * N)
  a %= threshold
  ans += a
  ans %= threshold
}

ans = coe * ans % threshold
print(ans)


Compiler output:
a.cc:27:10: error: too many decimal points in number
   27 | for i in 1...N*M {
      |          ^~~~~
a.cc:37:10: error: too many decimal points in number
   37 | for i in 1..<N {
      |          ^~~
a.cc:45:10: error: too many decimal points in number
   45 | for i in 1..<M {
      |          ^~~
a.cc:1:1: error: 'let' does not name a type
    1 | let threshold = 1000000007
      | ^~~
a.cc:9:1: error: 'func' does not name a type
    9 | func powd(_ x: Int, _ n: Int) -> Int {
      | ^~~~
a.cc:23:1: error: 'let' does not name a type
   23 | let input = readLine()!.split(separator: " ").map { Int($0)! }
      | ^~~
a.cc:24:1: error: 'let' does not name a type
   24 | let N = input[0]
      | ^~~
a.cc:34:1: error: 'var' does not name a type
   34 | var coe = comb(N * M - 2, K - 2)
      | ^~~
a.cc:45:1: error: expected unqualified-id before 'for'
   45 | for i in 1..<M {
      | ^~~
a.cc:54:1: error: 'ans' does not name a type
   54 | ans = coe * ans % threshold
      | ^~~
Language: C++

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

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    int n,m,k;
    ll ans=0;
    ll kai=0;
	cin >> n >>m >>k;
    fr(i,n){
      kai+=i*(n-i)*m*m;
      kai%=a;
    }
    kai*=COM(n*m-2,k-2)%a;
    ans+=kai;
    kai=0;
    fr(i,m){
      kai+=i*(m-i)*n*n;
      kai%=a;
    }
    kai*=COM(n*m-2,k-2)%a;
    ans+=kai;
    ans%=a;
    cout << ans<<endl; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:12: error: 'a' was not declared in this scope
   38 |       kai%=a;
      |            ^
a.cc:40:25: error: 'a' was not declared in this scope
   40 |     kai*=COM(n*m-2,k-2)%a;
      |                         ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
using namespace std;
#define int long long
#define rep(s,i,n) for(int i=s;i<n;i++)
#define c(n) cout<<n<<endl;
#define ic(n) int n;cin>>n;
#define sc(s) string s;cin>>s;
#define mod 1000000007
#define inf 1000000000000000007
#define f first
#define s second
#define mini(c,a,b) *min_element(c+a,c+b)
#define maxi(c,a,b) *max_element(c+a,c+b)
//printf("%.12Lf\n",c);
int keta(int x){
	rep(0,i,30){
		if(x<10){
			return i+1;
		}
		x=x/10;
	}
}
int gcd(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return bb;
		}	
		bb=bb%aa;
		if(bb==0){
			return aa;
		}
	}
}	
int lcm(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return x/bb*y;
		}	
		bb=bb%aa;
		if(bb==0){
			return x/aa*y;
		}
	}
}
bool p(int x){
	if(x==1)return false;
	rep(2,i,sqrt(x)+1){
		if(x%i==0&&x!=i){
			return false;
		}
	}	
	return true;
}
int n2[41];		
int nis[41]; 
int nia[41];
int mody[41];
int nn;
int com(int n,int y){
	int ni=1;
	for(int i=0;i<41;i++){
		n2[i]=ni;
		ni*=2;
	}
	int bunsi=1,bunbo=1;
	rep(0,i,y)bunsi=(bunsi*(n-i))%mod;
	rep(0,i,y)bunbo=(bunbo*(i+1))%mod;
	mody[0]=bunbo;
	rep(1,i,41){
		bunbo=(bunbo*bunbo)%mod;
		mody[i]=bunbo;
	}
	rep(0,i,41)nis[i]=0;
	nn=mod-2;
	for(int i=40;i>=0;i-=1){
		if(nn>n2[i]){
			nis[i]++;
			nn-=n2[i];
		}
	}
	nis[0]++;
	rep(0,i,41){
		if(nis[i]==1){
			bunsi=(bunsi*mody[i])%mod;
		}
	}
	return bunsi;
}
int a[114514];
signed main(){
	ic(n) ic(m) ic(k)
	int ans=com(n*m,k);
	ans=(ans*((n+m)*(k*(k-1)/2)))%mod;
	c(gyakugen(ans,3))
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:103:11: error: 'gyakugen' was not declared in this scope
  103 |         c(gyakugen(ans,3))
      |           ^~~~~~~~
a.cc:10:20: note: in definition of macro 'c'
   10 | #define c(n) cout<<n<<endl;
      |                    ^
a.cc: In function 'long long int keta(long long int)':
a.cc:27:1: warning: control reaches end of non-void function [-Wreturn-type]
   27 | }
      | ^
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:40:1: warning: control reaches end of non-void function [-Wreturn-type]
   40 | }
      | ^
a.cc: In function 'long long int lcm(long long int, long long int)':
a.cc:53:1: warning: control reaches end of non-void function [-Wreturn-type]
   53 | }
      | ^
Language: Java

import java.util.Scanner;

public class code
{
  public static void main(String []args)
  {
	int n,b;
   	Scanner sc= new Scanner(System.in);
   	n= sc.nextInt();
   	b=sc.nextInt();
    
   	if(n>=13)
    {
		System.out.println(b);
    }
    
    else if(n>5 && n<13)
    {
		System.out.println(b/2);
    }
    
    else 
    {
		System.out.println("0");
    }

  }
  
  
  
}


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

#include <iostream>
#include <bits/stdc++.h>
#define ll long long

using namespace std;
const ll Mod = 1e9 + 7;


void add_self(ll &x , ll y){
    x = (x + y)%Mod;
}

vector < ll > v , v2;


int main()
{
    ll n,m,k;  cin >> n >> m >> k;
    ll sum = 0;
    for(int i = 1;i<=n;i++){
        for(int j = 1;j<=m;j++){
            v.push_back(i);
            v2.push_back(j);
        }
    }
    sort(v.begin() , v.end());
    sort(v2.begin() , v2.end());
    ll Ans = 0;
    for(int i = 0;i<v.size();i++){
        ll Ways  = C(n * m - 2 , k - 2);
        add_self(Ans , -v[i] * (v.size() - (i + 1)) * Ways + Mod);
        add_self(Ans , v[i] * i * Ways);
    }
    for(int i = 0;i<v2.size();i++){
        ll Ways  = C(n * m - 2 , k - 2);
        add_self(Ans , -v[i] * (v.size() - (i + 1)) * Ways + Mod);
        add_self(Ans , v[i] * i * Ways);
    }
    cout << Ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:20: error: 'C' was not declared in this scope
   30 |         ll Ways  = C(n * m - 2 , k - 2);
      |                    ^
a.cc:35:20: error: 'C' was not declared in this scope
   35 |         ll Ways  = C(n * m - 2 , k - 2);
      |                    ^
Language: C++

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<(ll)b;i++)
#define bFor(i,a,b) for(i=a;i>=(ll)b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define pb push_back
#define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0)
const ll mod=1000000007;
const ll inf=1LL<<60;
const double PI = acos(-1);
const double eps = 1e-9;
template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} 
template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} 

void startupcpp(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
}

double distance(ddatas& x,ddatas& y){
  double a=x.first-y.first,b=x.second-y.second;
  return sqrt(a*a+b*b);
}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

vec modncrlistp,modncrlistm;

ll modncr(ll n,ll r){
  ll i,size=modncrlistp.size();
  if(size<=n){
    modncrlistp.resize(n+1);
    modncrlistm.resize(n+1);
    if(!size){
      modncrlistp[0]=modncrlistm[0]=1;
      size++;
    }
    For(i,size,n+1){
      modncrlistp[i]=modncrlistp[i-1]*i%mod;
      modncrlistm[i]=modinv(modncrlistp[i]);
    }
  }
  return modncrlistp[n]*modncrlistm[r]%mod*modncrlistm[n-r]%mod;
}

ll modpow(ll a,ll n){
  ll res=1;
  while(n){
    if(n&1)res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll gcd(ll a,ll b){if(!b)return a;return (a%b==0)?b:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}
void judgement(int a){
  if(a){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  if(a){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}

int main(){
  ll i,H,W,K,ans,cnt=0;
  cin>>H>>W>>K;
  rep(i,H)cnt=(cnt+(H-i)*i%mod)%mod;
  ans=cnt*W%modW%mod;
  cnt=0;
  rep(i,W)cnt=(cnt+(W-i)*i%mod)%mod;
  ans+=cnt*H%mod*H%mod;
  ans%=mod;
  cout<<ans*modncr(H*W-2,K-2)%mod<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:114:13: error: 'modW' was not declared in this scope; did you mean 'modf'?
  114 |   ans=cnt*W%modW%mod;
      |             ^~~~
      |             modf
Language: C++

#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include<set>
#include<tuple>
using namespace std;
#define INF 11000000000
#define MAX 210000
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
typedef pair<pair<int,int>,int> p;
typedef pair< pair<int,int>, int> p; 
#define bit(n,k) ((n>>k)&1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)

http://kmjp.hatenablog.jp/entry/2019/05/26/0900

ll fac[MAX],finv[MAX],inv[MAX];
//http://drken1215.hatenablog.com/entry/2018/06/08/210000
//テーブルを作る前処理　O(n)
//pが素数でなくてはならない
void COMinit(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
//二項係数計算
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0 || k<0) return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}


int main(){
    COMinit();
    int N,M,K;
    cin>>N>>M>>K;
    ll ans=0;
    for(int i=0;i<N;i++){
        ll d=1LL*i*(i+1)/2%MOD;
        d=d*M%MOD*M%MOD;
        ans+=d;
    }
    for(int i=0;i<M;i++){
        ll d=1LL*i*(i+1)/2%MOD;
        d=d*N%MOD*N%MOD;
        ans+=d;
    }
    
    cout<<ans%MOD*COM(N*M-2,K-2)<<endl;
}



Compiler output:
a.cc:24:5: error: found ':' in nested-name-specifier, expected '::'
   24 | http://kmjp.hatenablog.jp/entry/2019/05/26/0900
      |     ^
      |     ::
a.cc:24:1: error: 'http' does not name a type
   24 | http://kmjp.hatenablog.jp/entry/2019/05/26/0900
      | ^~~~
a.cc: In function 'void COMinit()':
a.cc:31:5: error: 'fac' was not declared in this scope
   31 |     fac[0]=fac[1]=1;
      |     ^~~
a.cc:32:5: error: 'finv' was not declared in this scope
   32 |     finv[0]=finv[1]=1;
      |     ^~~~
a.cc:33:5: error: 'inv' was not declared in this scope; did you mean 'int'?
   33 |     inv[1]=1;
      |     ^~~
      |     int
a.cc: In function 'll COM(int, int)':
a.cc:44:12: error: 'fac' was not declared in this scope
   44 |     return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
      |            ^~~
a.cc:44:20: error: 'finv' was not declared in this scope
   44 |     return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
      |                    ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;
#define rep(i,s,e) for(ll i = (int)(s); i < (int)(e); ++i)
#define per(i,s,e) for(ll i = (int)(s)-1; i >= (int)(e); --i)

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;

template<class T>
bool ChangeMax(T&a,const T&b){
  if(a >= b) return false;
  a = b;    return true;
}

template<class T>
bool ChangeMin(T&a,const T&b){
  if(a <= b) return false;
  a = b;    return true;  
}

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

template<long long mod>
class modint{
private:
  long long num;
  long long extgcd(long long a, long long b, long long&x, long long&y)const {
    long long d = a;
    if(b != 0){d = extgcd(b, a%b, y, x);  y -= (a/b) * x;}
    else{x = 1; y = 0;}
    return d;
  }
  long long modinverse()const{
    long long x, y;
    extgcd(num, mod, x, y);
    return (mod + x%mod)%mod;
  }
public:
  modint():num(0){}
  modint(const long long x):num((x < 0?(x+mod):x)%mod ){}
  friend modint operator+(const modint&a, const modint&b)
  {    return modint(a.num + b.num);  }
  friend modint operator-(const modint&a, const modint&b)
  {    return modint(a.num - b.num);  }
  friend modint operator*(const modint&a, const modint&b)
  {    return modint(a.num * b.num);  }
  friend modint operator/(const modint&a, const modint&b)
  {    return modint(a*b.modinverse());  }
  friend ostream& operator<<(ostream&os, const modint&a){
    os << a.num;
    return os;
  }
};
const ll mod = 7 + (1e+9);
using MI = modint<mod>;

int main(){
  ll n,m,k; cin >> n >> m >> k;
  MI sumx = 0, sumy = 0;
  rep(i,1,n)sumx = sumx + i * (n - i) * m * m;
  rep(i,1,m)sumy = sumy + i * (m - i) * n * n;
  MI acb;
  {
    MI a=1; MI x = n*m-2;
    rep(i,0,k-2){
      a = a * (x--);
    }
    MI b=1;
    rep(i,1,k-1)b = b * i;
    acb = a/b;
  }
  debug(sumx);
  debug(sumy);
  debug(acb);
  cout << (sumx+sumy)*acb << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:81:17: error: no 'operator--(int)' declared for postfix '--' [-fpermissive]
   81 |       a = a * (x--);
      |                ~^~