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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int n, m,k,ans, tot, cnt;
int a[MAXN][MAXN], b[MAXN][MAXN];
string s;

void re() 
{
	for (int i = 1; i <= n; i++) 
		for (int j = 1; j <= m; j++) 
			a[i][j] = b[i][j];
}

int count() 
{
	int res = 0;
	for (int i = 1; i <= n; i++) 
		for (int j = 1; j <= m; j++) 
			if (a[i][j] == 1) 
				res++;
	return res;
}

int main()
{	int T;
	scanf("%d%d%d", &n, &m, &k);
	for (int i = 1; i <= n; i++) 
	{
		cin >> s;
		for (int j = 0; j < s.size(); j++) 
			if (s[j] == '#') 
			a[i][j + 1] = 1;
	}
	for (int i = 1; i <= n; i++) 
		for (int j = 1; j <= m; j++) 
			b[i][j] = a[i][j];
	for (int i = 0; i < (1 << n); i++) 
	{
		for (int j = 0; j < (1 << m); j++) 
		{
			int x = i, y = j, num = 1;
			while (num <= n) 
			{
				if (x & 1) 
					for (int k = 1; k <= m; k++) 
						a[num][k] = 2;
				x >>= 1;
				++num;
			}
			num = 1;
			while (num <= m) 
			{
				if (y & 1) 
					for (int k = 1; k <= n; k++) 
						a[k][num] = 2;
				y >>= 1;
				++num;
			}
			num = count();
			if (num == k) 
				ans++;
			re();
		}
	}
	printf("%d\n", ans);
	return 0;
}


Compiler output:
a.cc:5:7: error: 'MAXN' was not declared in this scope
    5 | int a[MAXN][MAXN], b[MAXN][MAXN];
      |       ^~~~
a.cc:5:13: error: 'MAXN' was not declared in this scope
    5 | int a[MAXN][MAXN], b[MAXN][MAXN];
      |             ^~~~
a.cc:5:22: error: 'MAXN' was not declared in this scope
    5 | int a[MAXN][MAXN], b[MAXN][MAXN];
      |                      ^~~~
a.cc:5:28: error: 'MAXN' was not declared in this scope
    5 | int a[MAXN][MAXN], b[MAXN][MAXN];
      |                            ^~~~
a.cc: In function 'void re()':
a.cc:12:25: error: 'a' was not declared in this scope
   12 |                         a[i][j] = b[i][j];
      |                         ^
a.cc:12:35: error: 'b' was not declared in this scope
   12 |                         a[i][j] = b[i][j];
      |                                   ^
a.cc: In function 'int count()':
a.cc:20:29: error: 'a' was not declared in this scope
   20 |                         if (a[i][j] == 1)
      |                             ^
a.cc: In function 'int main()':
a.cc:33:25: error: 'a' was not declared in this scope
   33 |                         a[i][j + 1] = 1;
      |                         ^
a.cc:37:25: error: 'b' was not declared in this scope
   37 |                         b[i][j] = a[i][j];
      |                         ^
a.cc:37:35: error: 'a' was not declared in this scope
   37 |                         b[i][j] = a[i][j];
      |                                   ^
a.cc:47:49: error: 'a' was not declared in this scope
   47 |                                                 a[num][k] = 2;
      |                                                 ^
a.cc:56:49: error: 'a' was not declared in this scope
   56 |                                                 a[k][num] = 2;
      |                                                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(),v.end()

int main() {
  int h,w,k;
  cin >> h >> w >> k;
  int c[h][k];
  for(int i=0;i<h;i++){
  	for(int j=0;j<w;j++){
    	cin >> c[i][j];
    }
    cout << endl;
  }
  
  int result=0;
  for(int bit1=0;bit1<(1<<h);bit1++){
  	for(int bit2=0;bit2<(1<<w);bit2++;){
      int count=0;
      for(int i=0;i<h;i++){
         if(bit1&(1<<i)){
         	for(int j=0;j<w;j++){
            	c[i][j]="a";
            }
         }
      }
      for(int i=0;i<w;i++){
         if(bit2&(1<<i)){
         	for(int j=0;j<h;j++){
            	c[j][i]="a";
            }
         }
      }
      for(int i=0;i<h;i++){
  	for(int j=0;j<w;j++){
    	if(c[i][j]=="#")count++;
   		 }
 	  }
      if(count==k)result++;
    }
  }
  
  cout << result;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:42: error: expected ')' before ';' token
   19 |         for(int bit2=0;bit2<(1<<w);bit2++;){
      |            ~                             ^
      |                                          )
a.cc:19:43: error: expected primary-expression before ')' token
   19 |         for(int bit2=0;bit2<(1<<w);bit2++;){
      |                                           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(),v.end()

int main() {
  int h,w,k;
  cin >> h >> w >> k;
  int c[h][k];
  for(int i=0;i<h;i++){
  	for(int j=0;j<w;j++){
    	cin >> c[i][j];
    }
    cout << endl;
  }
  
  int result=0;
  for(int bit1=0;bit<(1<<h);bit++){
  	for(int bit2=0;bit<(1<<w);bit++;){
      int count=0;
      for(int i=0;i<h;i++){
         if(bit1&(1<<i)){
         	for(int j=0;j<w;j++){
            	c[i][j]="a";
            }
         }
      }
      for(int i=0;i<w;i++){
         if(bit2&(1<<i)){
         	for(int j=0;j<h;j++){
            	c[j][i]="a";
            }
         }
      }
      for(int i=0;i<h;i++){
  	for(int j=0;j<w;j++){
    	if(c[i][j]=="#")count++;
   		 }
 	  }
      if(count==k)result++;
    }
  }
  
  cout << result;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: 'bit' was not declared in this scope; did you mean 'bit1'?
   18 |   for(int bit1=0;bit<(1<<h);bit++){
      |                  ^~~
      |                  bit1
a.cc:19:40: error: expected ')' before ';' token
   19 |         for(int bit2=0;bit<(1<<w);bit++;){
      |            ~                           ^
      |                                        )
a.cc:19:41: error: expected primary-expression before ')' token
   19 |         for(int bit2=0;bit<(1<<w);bit++;){
      |                                         ^
Language: C++

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

int main() {
  
  int h,w,k,p;
  cin >> h >> w >> k;
  p=0;
  vector<vector<string>> a(h,vector<string>(w));
  
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin >> a.at(i).at(j);
      if(a.at(i).at(j)=="#")p++;
    }
  }
  
  if(p>k;){
  int q,r;
  q=1;
  r=1;
  for(int l=p;l>=k-1;l--)q*=l;
  
  for(int m=1;m<=k;m++)r*=m;
  
  cout << q/r <<endl;

  }else{
    cout << 1 <<endl;
  }
  
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: expected primary-expression before ')' token
   18 |   if(p>k;){
      |          ^
Language: C++

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

int main() {
  
  int h,w,k,p;
  cin >> h >> w >> k;
  p=0;
  vector<vector<string>> a(h,vector<string>(w))
  
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin >> a.at(i).at(j);
      if(a.at(i).at(j)=="#")p++;
    }
  }
  
  int q,r;
  q=1;
  r=1;
  for(int i=p;i>=k-1;i--)q*=i;
  
  for(int j=1;j<=k;j++)r*=j;
  
  cout << q/r <<endl;

  
  
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'for'
   11 |   for(int i=0;i<h;i++){
      |   ^~~
a.cc:11:15: error: 'i' was not declared in this scope
   11 |   for(int i=0;i<h;i++){
      |               ^
Language: C++

#include <iostream>
#include <vector>

int main()
{
    int H,W,K;
    std::cin >> H >> W >> K;
    char c[H][W];
    for(int i=0; i<H; i++)
    {
        for(int j=0; j<W; j++)
        {
            std::cin >> c[i][j];
        }
    }

    // bit全探索する(2^6 * 2^6 = 4096)
    int ans = 0;
    for(int flagH = 0; flagH < (1 << H); flagH++)
    {
        for(int flagW = 0; flagW < (1 << W); flagW++)
        {
            //std::vector<std::vector<char>> c_cpy = c;
            char c_cpy[H][W];
            memcpy(c_cpy, c, sizeof(c_cpy));
            int black_num = 0;

            // 赤く塗る 
            // 選んだ行 
            for(int i=0; i<H; i++)
            {
                if(flagH & (1<<i)){
                    for(int j=0; j<W; j++)
                    {
                        c_cpy[i][j] = 'R';
                    }
                }
            }
            // 選んだ列 
            for(int j=0; j<W; j++)
            {
                if(flagW & (1<<j)){
                    for(int i=0; i<H; i++)
                    {
                        c_cpy[i][j] = 'R';
                    }
                }
            }

            // 黒の数をかぞえる 
            for(int i=0; i<H; i++)
            {
                for(int j=0; j<W; j++)
                {
                    if(c_cpy[i][j] == '#')
                    {
                        black_num++;
                    }
                }
            }
            if(black_num == K)
            {
                ans++;
            }
        }
    }

    std::cout << ans << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'memcpy' was not declared in this scope
   25 |             memcpy(c_cpy, c, sizeof(c_cpy));
      |             ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 |
Language: C++

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

int main() {
  int h,w,k,t=0,cnt=0;
  cin >> h >> w >> k;
  char c[h][w];
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++){
      cin >> c[i][j];
      if(c[i][j]=="#")	t++;
    }
  
  //retudake
  for(int a;a<w;a++){
    int cc=0;
    for(int i=0;i<h;i++)
      for(int j=0;j<w;j++){
        if(j!=a)
          if(c[i][j]=="#")	cc++;
      }
    if(cc==k)	cnt++;
  }
  
  //gyoudake
  for(int a;a<h;a++){
    int cc=0;
    for(int i=0;i<h;i++)
      for(int j=0;j<w;j++){
        if(i!=a)
          if(c[i][j]=="#")	cc++;
      }
    if(cc==k)	cnt++;
  }
  
  //ryouhou
  for(int a=0;a<h;a++)
    for(int b=0;b<w;b++){
      int cc=0;
      for(int i=0;i<h;i++)
        for(int j=0;j<w;j++)
          if(i!=a&&j!=b)
          if(c[i][j]=="#")	cc++;
      if(cc==k)	cnt++;
    }
  
  cout << cnt;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |       if(c[i][j]=="#")  t++;
      |          ~~~~~~~^~~~~
a.cc:20:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |           if(c[i][j]=="#")      cc++;
      |              ~~~~~~~^~~~~
a.cc:31:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   31 |           if(c[i][j]=="#")      cc++;
      |              ~~~~~~~^~~~~
a.cc:43:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   43 |           if(c[i][j]=="#")      cc++;
      |              ~~~~~~~^~~~~
Language: C++

#include <bitset>
#include <iostream>
#include <iterator>
#include <vector>

int h, w, k;

int solve(std::vector<std::string> c, int bh, int bw) {
  for (int i = 0; i < h; ++i)
    if (bh & (1 << i))
      for (int j = 0; j < w; ++j) {
        c.at(i).at(j) = '-';
      }

  for (int i = 0; i < w; ++i)
    if (bw & (1 << i))
      for (int j = 0; j < h; ++j) {
        c.at(j).at(i) = '-';
      }

  int cnt = 0;
  for (int i = 0; i < h; ++i)
    for (int j = 0; j < w; ++j)
      if (c.at(i).at(j) == '#')
        cnt++;
  return cnt;
}

int main(int argc, char *argv[]) {
  std::cin >> h >> w >> k;
  std::vector<std::string> c(h);
  for (int i = 0; i < h; ++i) {
    std::cin >> c.at(i);
  }

  int ans = 0;
  for (int i = 0; i <= ((1 << h) - 1); ++i)
    for (int j = 0; j <= ((1 << w) - 1); ++j) {
      ans += (solve(c, i, j) == k);
    }

  std::cout << ans << std::endl;


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:42:33: error: expected '}' at end of input
   42 |   std::cout << ans << std::endl;
      |                                 ^
a.cc:29:34: note: to match this '{'
   29 | int main(int argc, char *argv[]) {
      |                                  ^
Language: C++

6 6 8
..##..
.#..#.
#....#
######
#....#
#....#


Compiler output:
a.cc:2:3: error: stray '##' in program
    2 | ..##..
      |   ^~
a.cc:3:2: error: stray '#' in program
    3 | .#..#.
      |  ^
a.cc:3:5: error: stray '#' in program
    3 | .#..#.
      |     ^
a.cc:4:2: error: invalid preprocessing directive #...
    4 | #....#
      |  ^~~
a.cc:5:1: error: stray '##' in program
    5 | ######
      | ^~
a.cc:5:3: error: stray '##' in program
    5 | ######
      |   ^~
a.cc:5:5: error: stray '##' in program
    5 | ######
      |     ^~
a.cc:6:2: error: invalid preprocessing directive #...
    6 | #....#
      |  ^~~
a.cc:7:2: error: invalid preprocessing directive #...
    7 | #....#
      |  ^~~
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 6 6 8
      | ^
Language: C++

#pragma GCC optimize("Ofast")
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define uni(e) e.erase(unique(e.begin(),e.end()),e.end())
#define double long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int INF=1e10;
int MOD=1e9+7;
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
}
int kurai(int a,int b){
  int m=pow(10,b),n=pow(10,b-1);
  return (a%m)/n;
}
int ketawa(int a){
  int k=0;
  rep(i,keta(a)){
  k+=kurai(a,i+1);
  }
  return k;
}
int gcd(int a,int b){
  if(a%b==0)
    return b;
  return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
int mid(int a,int b,int c){
  vector<int> k(3);
  k[0]=a;k[1]=b;k[2]=c;
  sort(all(k));
  return k[1];
}
bool sosuu(int a){
  bool b=1;
  if(a<=1)
    return 0;
  else{
  rep1(i,sqrt(a)-1){
  if(a%(i+1)==0)
  b=0;
  }
  return b;
  }
}
int modpow(int a,int b,int m=MOD){
 if(!b)return 1; if(b&1)return modpow(a,b-1,m)*a%m;
 int memo = modpow(a,b>>1,m);
 return memo*memo%m;
}
int fact_mod(int n) {
    int f=1; 
for(int i=2;i<n+1;i++) f=f*(i%MOD)% MOD;
    return f;
}
int mod_pow(int x,int n) {
    int res=1;
    while(n>0){
        if(n&1) res=(res*x)%MOD; 
        x=(x*x)%MOD;        
n>>=1; 
    }
    return res;
}
int c_mod(int n, int r) {
    if(r>n-r) r=n-r;
    if(r==0) return 1;
    int a=1;
    rep(i,r) 
a=a*((n-i)%MOD)%MOD;
    int b=mod_pow(fact_mod(r), MOD-2);
    return (a%MOD)*(b%MOD)%MOD;
}
signed main(){
  int a,b,c;
  cin>>a>>b>>c;
  char d[a][b];
  rep(i,a)rep(j,b)
    cin>>d[i][j];
  int h=0;
  int p[a][b];
  rep(i,a)rep(s,b){
  p[i][j]=d[i][s];
  }
  rep(i,(1<<6)){
  bitset<6> e(i);
  rep(j,(1<<6)){
  bitset<6> f(j);
    rep(k,a){
      if(e.test(k)){
      rep(l,b){
      d[k][l]='.';
      }
      }
    }
    rep(m,b){
      if(f.test(m)){
      rep(n,a){
      d[n][m]='.';
      }
      }
    }
    int t=0;
    rep(k,a)rep(m,b){
    if(d[k][m]=='#')
      t++;
    }
    if(t==c)
      h++;
     rep(k,a)rep(l,b)
    d[k][l]=p[k][l];
  }
  }
  out(h);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:105:8: error: 'j' was not declared in this scope
  105 |   p[i][j]=d[i][s];
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w,k,ans=0;
  cin>>h>>w>>k;
  vector<vector<char>> c(h,vector<char>(w));
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin>>c.at(i).at(j);
    }
  }
  for(int a=0;a<h;a++){
    for(int b=0;b<w;b++){
      int n=0;
      for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
          if(i!=a||j!=b||c.at(i).at(j)=='#')n++
        }
      }
      if(n==k)ans++;
    }
  }
  cout<<ans<<endl;        
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:48: error: expected ';' before '}' token
   17 |           if(i!=a||j!=b||c.at(i).at(j)=='#')n++
      |                                                ^
      |                                                ;
   18 |         }
      |         ~
Language: C++

import itertools
H, W, K = map(int, input().split())
S = ["" for i in range(H)]
for i in range(H):
    S[i] = input()

ans = 0
# print(S)
for h in itertools.product([0, 1], repeat=H):
    for w in itertools.product([0, 1], repeat=W):
        # print(h, w)
        count = 0
        for i in range(H):
            for j in range(W):
                if h[i] == 0 and w[j] == 0:
                    if S[i][j] == "#":
                        count += 1
        # print(count)
        if count == K:
            ans += 1

print(ans)


Compiler output:
a.cc:8:3: error: invalid preprocessing directive #print
    8 | # print(S)
      |   ^~~~~
a.cc:11:11: error: invalid preprocessing directive #print
   11 |         # print(h, w)
      |           ^~~~~
a.cc:18:11: error: invalid preprocessing directive #print
   18 |         # print(count)
      |           ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import itertools
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

#define fi first
#define se second
#define pb push_back
#define sz(a) (int)(a).size()
#define mp(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const ll IINF = INT_MAX;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m, k;
    cin >> n >> m >> k;
    string s[n];
    for (int i = 0; i < n; i++) {
        cin >> s[i];
    }
    int ans = 0;
    for (int i = 0; i < (1 << n); i++) {
        string tmp[n];
        for (int r = 0; r < n; r++) {
            tmp[r] = s[r];
            if ((i >> r) & 1) {
                for (int c = 0; c < m; c++) {
                    tmp[r][c] = 'X';
                }
            }
        }

        for (int j = 0; j < (1 << m); j++) {
            string ttmp[n] = tmp;
            for (int c = 0; c < m; c++) {
                if ((j >> c) & 1) {
                    for (int r = 0; r < n; r++) {
                        ttmp[r][c] = 'X';
                    }
                }
            }
            int tot = 0;
            for (int r = 0; r < n; r++) {
                for (int c = 0; c < m; c++) {
                    if (ttmp[r][c] == '#') tot++;
                }
            }
            ans += tot == k;
        }
    }
    cout << ans << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:30: error: array must be initialized with a brace-enclosed initializer
   44 |             string ttmp[n] = tmp;
      |                              ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main () {
  int H, W, K;
  cin >> H >> W >> K;
  char mp[10][10];
  int bl_h[10];
  int bl_w[10];
  for (int i = 0; i < H; i ++) {
    for (int j = 0; j < W; j ++) {
      cin >> mp[i][j];
      if (mp[i][j] == '#') {
        bl_h[i] ++;
        bl_w[j] ++;
        K --;
      }
    }
  }
  int cal_h[10];
  int cal_w[10];
  int ans = 0;
  for (int i = 0; i < 1 << H; i ++) {
    for (int j = 0; j < 1 << W; j ++) {
      int i_ = i;
      int j_ = j;
      int si_h = 0;
      int si_w = 0;
      int kj = 0;
      for (int k = 0; k < H; k ++) {
        if (i_ % 2) {
          cal_h[si_h] = k;
          si_h ++;
          kj += bl_h[k];
        }
        i_ /= 2;
      }
      for (int k = 0; k < H; k ++) {
        if (j_ % 2) {
          cal_w[si_w] = k;
          si_w ++;
          kj += bl_w[k];
        }
        j_ /= 2;
      }
      int s = (si_h * H) + (si_w * W) - (si_h * si_w);
      for (int k = 0; k < si_h; k ++) {
        for (int l = 0; l < si_h; l ++) {
          if (mp[cal_h[k]][cal_w[l]] == '#') {
            kj --;
          }
        }
      }
      if ((s - (2 * k)) == K) ans ++;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:21: error: 'k' was not declared in this scope
   53 |       if ((s - (2 * k)) == K) ans ++;
      |                     ^
Language: C

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

// Macros
#define F  first
#define S  second
#define PB push_back

// Rename Datatypes
using ll  = long long;
using ld  = long double;
using pii = pair<int,int>;

// Common Functions
ll fastpow(ll a, ll ex){ ll res = 1; while(ex){ if(ex & 1) res *= a; a *= a; ex >>= 1; } return res; }
ll fastpow(ll a, ll ex, ll m){ a %= m; ll res = 1; while(ex){ if(ex & 1) res = (a*res) % m; a = (a*a) % m; ex >>= 1; } return res; }
ll modinverse(ll a, ll m){ ll m0 = m, y = 0, x = 1; while (a > 1){ ll q = a / m; a %= m; swap(a,m); x -= q*y; swap(x,y); } if(x < 0) x += m0; return x; }

// HELPERS
//  Tedious Grid Movements
vector<pii> moves_grid = { {0,1} , {0,-1} , {1,0} , {-1,0} };
inline bool move_okay(int x, int y, int n, int m) { return 0 <= x and x < n and 0 <= y and y < m; }
//  Remember:
//   * vec.assign() GOOD; vec.resize() BAD
//   * comparator uses <

// Output, Common Containers
template <typename T> ostream& operator << (ostream& os, const vector<T>& v) { for (T i : v) os << i << ' '; return os; }
template <typename T> ostream& operator << (ostream& os, const set<T>& v)    { for (T i : v) os << i << ' '; return os; }
template <typename T, typename S> ostream& operator << (ostream& os, const pair<T,S>& v) { os << "(" << v.F << "=>" << v.S << ") "; return os; }
template <typename T, typename S> ostream& operator << (ostream& os, const map<T,S>& v)  { for (auto i : v) os << i << ' '; return os; }

// Debugging
#ifdef SANYAM1101
	#define trace(args...) do{ cerr << "Trace On! (Line: " << __LINE__ << ")\n"; d_f(string(#args), args); } while(0)
	void d_f(__attribute__((unused)) string str) {}
	template<typename Head, typename... Tails> void d_f(string str, Head H, Tails... T) { cerr << "\t" << str.substr(0, str.find(", ")) << " <=> [" << H << "]\n"; d_f(str.substr(str.find(", ") + 2), T...); }
#else
	#define trace(args...)
#endif


// CODE STARTS HERE

void solve(){
	int h, w, k;
	cin >> h >> w >> k;

	int grid[h][w];
	for(int i = 0; i < h; ++i){
		for(int j = 0; j < w; ++j){
			char ch; cin >> ch;
			grid[i][j] = ch == '#';
		}
	}

	int choices = 0;

	int copied[h][w];

	for(int m1 = 0; m1 < (1 << h); ++m1){
		for(int m2 = 0; m2 < (1 << w); ++m2){
			for(int i = 0; i < h; ++i){
				for(int j = 0; j < w; ++j){
					if(((m1 >> i) & 1) or ((m2 >> j) & 1))
						copied[i][j] = 0;
					else
						copied[i][j] = grid[i][j];
				}
			}

			int su = 0;
			for(int i = 0; i < h; ++i)
				su += accumulate(copied[i], copied[i] + w, 0);

			if(su == k) ++choices;
		}
	}

	cout << choices << "\n";
}

signed main (void){
	// Fast_IO
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	// Set Fixed Notation (default sucks), High Precision for Floating-Point Output
	cout << fixed << setprecision(20);

	// Multiple TCs
	int tt = 1;
	// cin >> tt;
	while(tt--) solve();
}


Compiler output:
main.c:2:10: fatal error: bits/stdc++.h: No such file or directory
    2 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++


                t/=2;
            }
            l=0;
            t=j;
            while(t)
            {
                col[l]=t%2;
                l++;
                t/=2;
            }
            for(int a=0;a<n;a++) for(int b=0;b<m;b++) if(row[a] && col[b] && v[a][b]=='#') ct++;
            if(ct==k) ans++;
        }
    }
    cout<<ans;
}


Compiler output:
a.cc:2:17: error: 't' does not name a type
    2 |                 t/=2;
      |                 ^
a.cc:3:13: error: expected declaration before '}' token
    3 |             }
      |             ^
a.cc:4:13: error: 'l' does not name a type
    4 |             l=0;
      |             ^
a.cc:5:13: error: 't' does not name a type
    5 |             t=j;
      |             ^
a.cc:6:13: error: expected unqualified-id before 'while'
    6 |             while(t)
      |             ^~~~~
a.cc:12:13: error: expected unqualified-id before 'for'
   12 |             for(int a=0;a<n;a++) for(int b=0;b<m;b++) if(row[a] && col[b] && v[a][b]=='#') ct++;
      |             ^~~
a.cc:12:25: error: 'a' does not name a type
   12 |             for(int a=0;a<n;a++) for(int b=0;b<m;b++) if(row[a] && col[b] && v[a][b]=='#') ct++;
      |                         ^
a.cc:12:29: error: 'a' does not name a type
   12 |             for(int a=0;a<n;a++) for(int b=0;b<m;b++) if(row[a] && col[b] && v[a][b]=='#') ct++;
      |                             ^
a.cc:12:46: error: 'b' does not name a type
   12 |             for(int a=0;a<n;a++) for(int b=0;b<m;b++) if(row[a] && col[b] && v[a][b]=='#') ct++;
      |                                              ^
a.cc:12:50: error: 'b' does not name a type
   12 |             for(int a=0;a<n;a++) for(int b=0;b<m;b++) if(row[a] && col[b] && v[a][b]=='#') ct++;
      |                                                  ^
a.cc:13:13: error: expected unqualified-id before 'if'
   13 |             if(ct==k) ans++;
      |             ^~
a.cc:14:9: error: expected declaration before '}' token
   14 |         }
      |         ^
a.cc:15:5: error: expected declaration before '}' token
   15 |     }
      |     ^
a.cc:16:5: error: 'cout' does not name a type
   16 |     cout<<ans;
      |     ^~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

/* 	* In the name of GOD 
 	* Thanks God */
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
#define F first
#define S second

int32_t main(){
	int n, m, k, ans = 0;
	cin >> n >> m >> k;
	string s[n];
	for (int i = 0; i < n; i++){
		cin >> s[i];
	}
	int po = pow(2, n);
	int po2 = pow (2, m);
	int a[n], b[m];
	for (int i = 0; i < po; i++){
		for (int j = 0; j < po2; j++){
			string t[n] = s;
			int x = i, y = j;
			for (int k = 0; k < n; k++){
				a[k] = x % 2;
				x /= 2;
			}
			for (int k = 0; k < m; k++){
				b[k] = y % 2;
				y /= 2;
			}
			for (int k = 0; k < n; k++){
				if (a[k] == 0)
					continue;
				for (int l = 0; l < m; l++)
					t[k][l] = 'R';
			}
			for (int k = 0; k < m; k++){
				if (b[k] == 0)
					continue;
				for (int l = 0; l < n; l++)
					t[l][k] = 'R';
			}
			int an = 0;
			for (int k = 0; k < n; k++){
				for (int l = 0; l < m; l++){
					if (t[k][l] == '#')
						an ++;
				}
			}
			if (an == k)
				ans ++;
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:24:39: error: array must be initialized with a brace-enclosed initializer
   24 |                         string t[n] = s;
      |                                       ^
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];
  long long ans=0;
  sort(a.rbegin(),a.rend());
  for(int i=0;i<n-1;i++){
    int lim=2;
    if(i==0) lim=1;
    for(int j=0;j<lim;j++){
      if(n-1>0){
        ans+=a[i];
        t--;
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 't' was not declared in this scope
   16 |         t--;
      |         ^
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];
  long long ans=0;
  sort(a.rbegin(),a.rend());
  for(int i=0;i<n-1;i++){
    int lim=2;
    if(i==0) lim=1;
    for(int j=0;j<lim;j++){
      if(t>0){
        ans+=a[i];
        t--;
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 't' was not declared in this scope
   14 |       if(t>0){
      |          ^
Language: C++

#include<bits/stdc++.h>
#define lg long long int
#define loop(i,s,e) for(lg i=s;i<=e;i++)
#define iloop(i,s,e) for(lg i=e;i>=s;i--)
#define pb push_back
#define mp make_pair
using namespace std;

lg min(lg a,lg b)
{return a<b?a:b;}
lg max(lg a,lg b)
{return a>b?a:b;}
lg lcm(lg a ,lg b)
{
    return (a*b)/__gcd(a,b);
}
int main()
{
    cin>>n;
    vector<lg>a(n,0);
    lg ans=0;
    for(lg i=0;i<n;i++)
    {
        cin>>a[i];
        ans+=a[i];
    }

    sort(a.begin(),a.end());
    ans-=a[0];
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   19 |     cin>>n;
      |          ^
      |          yn
Language: C++

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

int main(){
  double N;
  cin >> N;
  vector<double> comfort(N), comfort_after;
  double score = 0;
  for(int i = 0; i < N; i++){
    cin >> comfort.at(i);
  }
  sort(comfort.begin(), comfort.end());
  reverse(comfort.begin(), comfort.end());
  for(int = 1; i < N; i++){
    score += comfort.at(0 + i/2);
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected unqualified-id before '=' token
   14 |   for(int = 1; i < N; i++){
      |           ^
a.cc:14:10: error: expected ';' before '=' token
   14 |   for(int = 1; i < N; i++){
      |          ^~
      |          ;
a.cc:14:11: error: expected primary-expression before '=' token
   14 |   for(int = 1; i < N; i++){
      |           ^
a.cc:14:16: error: 'i' was not declared in this scope
   14 |   for(int = 1; i < N; i++){
      |                ^
a.cc:14:21: error: expected ')' before ';' token
   14 |   for(int = 1; i < N; i++){
      |      ~              ^
      |                     )
a.cc:14:23: error: 'i' was not declared in this scope
   14 |   for(int = 1; i < N; i++){
      |                       ^
Language: C++

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

int main(){
    ll N;
    cin >> N;
    ll A[N];
    rep(i, N) cin>>A[i];

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

    int ans=0;
    ll conf_pre=0;
    queue<ll> q;
    rep(i, N){
        if(i==0){
            q.push(A[N-i-1]);
            continue;
        }else{
            if(i%2==0 || i==1){
                conf_pre=q.front();
                q.pop();
            }
            //cout<<conf_pre<<endl;
            ans+=conf_pre;
            q.push(A[N-i-1]);
        }
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: request for member 'bgin' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   13 |     sort(A.bgin(), A.end());
      |            ^~~~
a.cc:13:22: error: request for member 'end' in 'A', which is of non-class type 'll [N]' {aka 'long long int [N]'}
   13 |     sort(A.bgin(), A.end());
      |                      ^~~
Language: C

#include<iostream>
#include<algorithm>

using namespace  std;

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

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<algorithm>

using namespace  std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:36: error: 'a' was not declared in this scope
    9 |         for(int i=1;i<=n;i++) cin>>a[i];
      |                                    ^
a.cc:11:14: error: 'a' was not declared in this scope
   11 |         sort(a+1,a+1+n);
      |              ^
a.cc:12:13: error: redeclaration of 'int ans'
   12 |         int ans = a[n];
      |             ^~~
a.cc:10:13: note: 'int ans' previously declared here
   10 |         int ans = 0;
      |             ^~~
a.cc:16:12: error: 't' was not declared in this scope
   16 |         if(t % 2==1) ans += a[res];
      |            ^
Language: C++

int main(){
  int n;
  cin >> n;
  vector<int> all(n);
  vector<int> made;
  
  made.reserve(1000000);
  for(int i=0; i<n; i++){
    cin >> all[i];
  }
  sort(all.begin(),all.end());
  reverse(all.begin(),all.end());
  int Ans = 0;
  made.push_back(all[0]);
  
    for(int i=1; i<n; i++){
      made.push_back(all[i]);
        int max = made[0];
      for(int j=1; j<i; j++){
        if(made[j] > max){
          max = made[j];
        }
        if(max = made[j]){
          made[j] = all[i];
        }
      }
      Ans += max;
    }
  cout << Ans;
  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;
      |   ^~~
a.cc:4:3: error: 'vector' was not declared in this scope
    4 |   vector<int> all(n);
      |   ^~~~~~
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   vector<int> all(n);
      |          ^~~
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> made;
      |          ^~~
a.cc:7:3: error: 'made' was not declared in this scope
    7 |   made.reserve(1000000);
      |   ^~~~
a.cc:9:12: error: 'all' was not declared in this scope
    9 |     cin >> all[i];
      |            ^~~
a.cc:11:8: error: 'all' was not declared in this scope
   11 |   sort(all.begin(),all.end());
      |        ^~~
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(all.begin(),all.end());
      |   ^~~~
      |   short
a.cc:12:3: error: 'reverse' was not declared in this scope
   12 |   reverse(all.begin(),all.end());
      |   ^~~~~~~
a.cc:29:3: error: 'cout' was not declared in this scope
   29 |   cout << Ans;
      |   ^~~~
Language: Java

public class Main {

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

        List<Integer> inputList = new ArrayList<Integer>();
        for(int i = 0; i < n ;i++) {
            inputList.add(sc.nextInt());
        }

        /*
        List<Integer> sortedList = inputList.stream().sorted(reverseOrder()).collect(Collectors.toList());
        for(int a: sortedList) {
            System.out.println(a);
        }
        */
        List<Integer> sortedList = inputList.stream().sorted(reverseOrder()).collect(Collectors.toList());
        int result = sortedList.get(0);
        int index = 1;
        int count = 0;
        for (int i = 0; i < n - 2 ; i++) {
            result += sortedList.get(index);
            count = count + 1;
            if (count == 2) {
                count = 0;
                index = index + 1;
            }
        }
        System.out.println(result);
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
        List<Integer> inputList = new ArrayList<Integer>();
        ^
  symbol:   class List
  location: class Main
Main.java:7: error: cannot find symbol
        List<Integer> inputList = new ArrayList<Integer>();
                                      ^
  symbol:   class ArrayList
  location: class Main
Main.java:18: error: cannot find symbol
        List<Integer> sortedList = inputList.stream().sorted(reverseOrder()).collect(Collectors.toList());
        ^
  symbol:   class List
  location: class Main
Main.java:18: error: cannot find symbol
        List<Integer> sortedList = inputList.stream().sorted(reverseOrder()).collect(Collectors.toList());
                                                             ^
  symbol:   method reverseOrder()
  location: class Main
Main.java:18: error: cannot find symbol
        List<Integer> sortedList = inputList.stream().sorted(reverseOrder()).collect(Collectors.toList());
                                                                                     ^
  symbol:   variable Collectors
  location: class Main
7 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
  ll N;
  cin>>N;
  vector<ll> vec(N);
  for(ll i=0;i<N;i++) {
cin>>vec[i];
  }
  
  sort(all(vec));
  reverse(all(vec));
  ll ans=0;
  
  
  ans+=vec[0];
 ll count=N-2;
  ll i=1;
  ll count=1;
  while(count<N-1) {
ans+=vec[i]*2;
    count+=2;
    i++;
  }
  
  if(count>N-1) {
ans-=vec[i-1];
  }
  
  cout<<ans<<endl;
}
  
  
  
  
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:22:6: error: redeclaration of 'll count'
   22 |   ll count=1;
      |      ^~~~~
a.cc:20:5: note: 'll count' previously declared here
   20 |  ll count=N-2;
      |     ^~~~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  ll ar[n];
  sort(ar,ar+n);
  ll ans = 0;
  for(int i = 1;i < n;i++){
    ans += ans[i-1];
  }
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: invalid types 'long long int[int]' for array subscript
   12 |     ans += ans[i-1];
      |               ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
	int n;
	cin >> n;
	int a[n];
	int min = 100000000;
	int sum = 0;
	for(int i=0;i<n;i++){
		cin >> a[i];
		if(min>=a[i]) min = a[i];
		sum += a[i];
	}
	cout << sum - min << endl;
	return 0;
}
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	long long a[n];
	long long min = 100000000;
	long long sum = 0;
	for(int i=0;i<n;i++){
		cin >> a[i];
		if(min>=a[i]) min = a[i];
		sum += a[i];
	}
	cout << sum - min << endl;
	return 0;
}

Compiler output:
a.cc:21:5: error: redefinition of 'int main()'
   21 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std; 
typedef long long ll;
int n;
int main(){
    cin >> n;
    vector<ll> a(n);
    for(int i=0; i<n; i++) cin >> a[i];
    sort(a.begin(), a.end(), greater<ll>());
    ll ans=0;
    for(int i=0; i<n-1; i++){
        if(i==0){ans+=a[0]; continue;}
        int a_index=i/2+i%2;
        ans += a[a_index];  
    }
    cout << ans << "\n";
}

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

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



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

#include <iostream>
#include "algorithm"
using namespace std;
ll A[200050];
int main() {
    int N;
    cin >> N;
    int A[N];
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
    }
    sort(A,A+N);

    int res = A[N-1];
    int number = 2;
    for (int i = N-2; number<N ; i-- ) {
        if(number+2<=N) {
            res = res + 2 * A[i];
            number+=2;
        }else{
            res = res + A[i];
            number++;
        }
    }
    cout << res;
    return 0;
    
}


Compiler output:
a.cc:4:1: error: 'll' does not name a type
    4 | ll A[200050];
      | ^~
Language: C++

#include<iostream>
#include<algorithm>
#include<numeric>
using namespace std;
const int BUF = 200005;


int N:
int val[BUF];

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


void work() {
    sort(val, val + N);
    cout << accumulate(val + 1, val + N, 0LL) << endl;
}


int main() {
    read();
    work();
    return 0;
}


Compiler output:
a.cc:8:6: error: expected initializer before ':' token
    8 | int N:
      |      ^
a.cc: In function 'void read()':
a.cc:12:12: error: 'N' was not declared in this scope
   12 |     cin >> N;
      |            ^
a.cc:14:16: error: 'val' was not declared in this scope
   14 |         cin >> val[i];
      |                ^~~
a.cc: In function 'void work()':
a.cc:20:10: error: 'val' was not declared in this scope
   20 |     sort(val, val + N);
      |          ^~~
a.cc:20:21: error: 'N' was not declared in this scope
   20 |     sort(val, val + N);
      |                     ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
 
using namespace std;
using pi = pair<int, int>;
 
int main() {
  int n; cin >> n;
  vector <int> as(n, 0);
  for (auto& a : as) cin >> a;
  sort(as.begin(), as.end());
  reverse(as.begin(), as.end());
  ll sum = as[0];
  if (n <= 1) { cout << 0 << endl; return 0; }
  if (n <= 2) { cout << sum << endl; return 0; }
  for (int i = 2; i < n; i++) {
    sum += as[i / 2];
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'll' was not declared in this scope
   14 |   ll sum = as[0];
      |   ^~
a.cc:16:25: error: 'sum' was not declared in this scope
   16 |   if (n <= 2) { cout << sum << endl; return 0; }
      |                         ^~~
a.cc:18:5: error: 'sum' was not declared in this scope
   18 |     sum += as[i / 2];
      |     ^~~
a.cc:20:11: error: 'sum' was not declared in this scope
   20 |   cout << sum << endl;
      |           ^~~
Language: C++

#include<iostream>
#include<vector>


using namespace std;
int main(void){
  int num;
  cin >> num;
  vector<long long> friendly(num);
  for(int i = 0;i < num;i++){
    cin >> friendly[i];
  }
  friendly.sort(friendly.begin(),friendly.end());
  long long ans = 0;
  for(int i =0;i < num-1;i++){
    int p = (3+i)/2;
    ans = ans+ friendly[num-p];
  }
  cout << ans << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'class std::vector<long long int>' has no member named 'sort'
   13 |   friendly.sort(friendly.begin(),friendly.end());
      |            ^~~~
Language: Java

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class C {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = scanner.nextInt();
        }
        nums = Arrays.stream(nums).boxed()
                .sorted(Comparator.reverseOrder()).mapToInt(i -> i).toArray();
        long ans = 0;
        int ptr = 0, cnt = 1;
        for (int i = 1; i < n; i++) {
            ans += nums[ptr];
            cnt++;
            if (cnt == 2) {
                ptr++;
                cnt = 0;
            }
        }
        System.out.println(ans);
    }
}

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

#include<vector>
#include<math.h>
#include<iostream>
using namespace std;
int main()
{
  vector<int> v;
  int n, i, x;
  cin >> n;
  for(i=0; i<n; i++)
  {
    cin >> x;
    v.push_back(x);
  }
  x = 0;
  sort(v.begin(), v.end());
  for(i=0; i<n; i++)
  {
    x += v[(n-1)-floor(i/2)];
  }
  cout << x;
  return(0);
}

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

#include<vector>
#include<math.h>
#include<iostream>
using namespace std;
int main()
{
  vector<int> v;
  int n, i, x;
  cin >> n;
  for(i=0; i<n; i++)
  {
    cin >> x;
    v.push_back(x);
  }
  x = 0
  sort(v.begin(), v.end());
  for(i=0; i<n; i++)
  {
    x += v[(n-1)-floor(i/2)];
  }
  cout << x;
  return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: expected ';' before 'sort'
   15 |   x = 0
      |        ^
      |        ;
   16 |   sort(v.begin(), v.end());
      |   ~~~~
Language: C++

#include<vector>
#include<iostream>
using namespace std;
int main()
{
  vector<int> v;
  int n, i, x;
  cin >> n;
  for(i=0; i<n; i++)
  {
    cin >> x;
    v.push_back(x);
  }
  x = 0
  sort(v.begin(), v.end());
  for(i=0; i<n; i++)
  {
    x += v[(n-1)-floor(i/2)];
  }
  cout << x;
  return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: expected ';' before 'sort'
   14 |   x = 0
      |        ^
      |        ;
   15 |   sort(v.begin(), v.end());
      |   ~~~~  
a.cc:18:18: error: 'floor' was not declared in this scope
   18 |     x += v[(n-1)-floor(i/2)];
      |                  ^~~~~
Language: C

#include <stdio.h>

int main (void) {
  int A;
  scanf("%d", &A);
  int min = A;
  int score = 0
  int i;
  for (i = 1; i < N; i++) {
    scanf("%d", &A);
    score += A
    if (A < min) {
      min = A
    }
  }
  printf("%d", score - min);
}

Compiler output:
main.c: In function 'main':
main.c:8:3: error: expected ',' or ';' before 'int'
    8 |   int i;
      |   ^~~
main.c:9:8: error: 'i' undeclared (first use in this function)
    9 |   for (i = 1; i < N; i++) {
      |        ^
main.c:9:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:19: error: 'N' undeclared (first use in this function)
    9 |   for (i = 1; i < N; i++) {
      |                   ^
main.c:11:15: error: expected ';' before 'if'
   11 |     score += A
      |               ^
      |               ;
   12 |     if (A < min) {
      |     ~~
Language: C

#include <stdio.h>

int main (void) {
  int A;
  scanf("%d", &A) > 0);
  int min = A;
  int score = 0
  int i;
  for (i = 1; i < N; i++) {
    scanf("%d", &A) > 0);
    score += A
    if (A < min) {
      min = A
    }
  }
  printf("%d", score - min);
}

Compiler output:
main.c: In function 'main':
main.c:5:22: error: expected ';' before ')' token
    5 |   scanf("%d", &A) > 0);
      |                      ^
      |                      ;
main.c:5:22: error: expected statement before ')' token
main.c:8:3: error: expected ',' or ';' before 'int'
    8 |   int i;
      |   ^~~
main.c:9:8: error: 'i' undeclared (first use in this function)
    9 |   for (i = 1; i < N; i++) {
      |        ^
main.c:9:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:19: error: 'N' undeclared (first use in this function)
    9 |   for (i = 1; i < N; i++) {
      |                   ^
main.c:10:24: error: expected ';' before ')' token
   10 |     scanf("%d", &A) > 0);
      |                        ^
      |                        ;
main.c:10:24: error: expected statement before ')' token
main.c:11:15: error: expected ';' before 'if'
   11 |     score += A
      |               ^
      |               ;
   12 |     if (A < min) {
      |     ~~
Language: Java

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


public class test
{
	public static void main(String[] args)
	{
		Scanner console = new Scanner(System.in);
		
		int number = console.nextInt();
		ArrayList<Integer> a = new ArrayList<Integer>();

		for(int i = 0; i < number; i ++)
		{
			a.add(console.nextInt());
		}

		// sort
		Collections.sort(a);
		//list is in order.
		
		int answer = 0;
		answer += a.get(number - 1);

		for(int i = 0; i < number - 1; i ++)
		{
			answer = answer + (a.get(number - 2 - (i / 2)));
		}
		System.out.print(answer);
	}
}


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

#include <iostream>
using namespace std;

int main(){
    int n;
    int *a;
    int sum = 0;

    cin >> n;
    a = new int[n];

    for (int i = 0; i < n; i++) cin >> a[i];

    sort(a, a + n, greater<int>());

    // for (int i = 0; i < n; i++) cout << a[i];

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

    
    cout << sum << endl;

    delete a;
    return 0;
}

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