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

#include <bits/stdc++.h>
#define int long long
#define pii pair<int, int>

using namespace std;
const int inf = 1e9 + 7;
const int max_n = 2e5 + 7;
vector<int> gr[max_n];
map<int, int> dp[max_n], sz[max_n];
int fact[max_n];

inline int mul(int a, int b) {
	return a * b % inf;
}

inline int power(int a, int b) {
	int res = 1;
	while(b) {
		if (b & 1) res = mul(res, a);

		a = mul(a, a);

		b >>= 1;
	}

	return res;
}

inline int inv(int a) {
	return power(a, inf - 2);
}

inline int C(int n, int k) {
	return mul(fact[n], inv(mul(fact[k], fact[n - k])));
}


int iter = 0;

void dfs(int v, int pr) {
	iter++;
	if (iter > max_n) n /= 0;


	sz[v][pr] = 0;
	dp[v][pr] = 1;

	for(int i : gr[v]) {
		if (i == pr) continue;
		if (dp[i].find(v) == dp[i].end()) dfs(i, v);
		sz[v][pr] += sz[i][v];
		dp[v][pr] = mul(dp[v][pr], mul(dp[i][v], C(sz[v][pr], sz[i][v])));
	}
	sz[v][pr]++;
}

inline void solve() {
	fact[0] = 1;
	for(int i = 1;i < max_n;i++) fact[i] = mul(fact[i - 1], i);

	int n;
	cin >> n;
	for(int i = 0;i < n - 1;i++) {
		int v1, v2;
		cin >> v1 >> v2;
		v1--; v2--;
		gr[v1].emplace_back(v2);
		gr[v2].emplace_back(v1);
	}


	//cout << "scan" << endl;


	for(int i = 0;i < n;i++) {
		for(int pr : gr[i]) {
			if (dp[i].find(pr) == dp[i].end()) dfs(i, pr);
		}
	}

	//cout << "dfs" << endl;

	for(int i = 0;i < n;i++) {
		int c_sz = 0;
		int res = 1;
		for(int j : gr[i]) {
			c_sz += sz[j][i]; 
			res = mul(res, mul(dp[j][i], C(c_sz, sz[j][i])));
		}

		cout << res << '\n';
	}

}







signed main() {
	/*freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);*/

 	cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);


    solve();
}

Compiler output:
a.cc: In function 'void dfs(long long int, long long int)':
a.cc:42:27: error: 'n' was not declared in this scope
   42 |         if (iter > max_n) n /= 0;
      |                           ^
Language: C++

#include<stdio.h>
#include

int main(){
  int M, N;
    scanf("%d %d", &M, &N);
  int a=1;
  int b=1;
  //int b=1;
  int genap, ganjil;
  int arraygenap[M], arrayganjil[N];
  int z=0;
  
  for(int i=1; i<=M; i++){
    genap= 2*a;
    arraygenap[i]=genap;
    a++;  
  }
  getchar();
  for(int i=1; i<=N; i++){
    ganjil= 3*b;
    arrayganjil[i]=ganjil;
    b++;
  }
  for(int i=0; i<M; i++){
    for(int x=0; x<N; x++){
         if((arrayganjil[i]+arraygenap[x])%2==0){
           z=i+x;
         }else{}
       
    }
  }
    printf("%d", z);
    return 0;
  }

Compiler output:
a.cc:2:9: error: #include expects "FILENAME" or <FILENAME>
    2 | #include
      |         ^
Language: C

#include<stdio.h>
int main(){
	int n, m;
	scanf("%d %d", &n, &m);
	
	int a=0, b=0;
	for(int i=2; i<=n; i++){
		a = a+i-1;
	}
	for(int j=2; j<=m; j++){
		b = b+i-1;
	}
	printf("%d\n", a+b);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:23: error: 'i' undeclared (first use in this function)
   11 |                 b = b+i-1;
      |                       ^
main.c:11:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <stdio.h>

int main(){
int N,M,Bilangan_Genap,Bilangan_Ganjil;
scanf("%d %d", &N,&M);
if (N==1 && M==1) {
printf("0\n");
}
else {
N=N-1;
M=M-1;
Bilangan_Genap=(N*(N+1))/2;
Bilangan_Ganjil=(M*(M+1)/2);
printf("%d\n",Bilangan_Genap+Bilangan_Ganjil);
}
return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: expected '}' at end of input
   16 | return 0;
      |          ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C

#include <stdio.h>

int main()
{
    int n, m;
    int total;
    scanf("%d %d", &n, &m);

    total = ((n(n-1))/2) + ((m(m-1))/2);
    printf("%d", total);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:15: error: called object 'n' is not a function or function pointer
    9 |     total = ((n(n-1))/2) + ((m(m-1))/2);
      |               ^
main.c:5:9: note: declared here
    5 |     int n, m;
      |         ^
main.c:9:30: error: called object 'm' is not a function or function pointer
    9 |     total = ((n(n-1))/2) + ((m(m-1))/2);
      |                              ^
main.c:5:12: note: declared here
    5 |     int n, m;
      |            ^
Language: C++

include <stdio.h>
 
int main(){
	int N,M;
	scanf("%d %d",&N,&M);
	printf("%d\n",N*(N-1)/2+M*(M-1)/2);
	return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
Language: C

#include  <stdio.h>

int main(void)
{
   int a,b;
    scanf("%d %d",&a,&b);
    
    int d = a ;
    a = 0;
    
    for(int i=1;i<d;i++)
    {
       a = a + i;
    }
    
    
    int c = b ;
    b = 0;
    
    for(int i=1;i<c;i++)
    {
       b = b + i;
    }
    
    printf("%d",a+b);
    
    
    return 0;

Compiler output:
main.c: In function 'main':
main.c:28:5: error: expected declaration or statement at end of input
   28 |     return 0;
      |     ^~~~~~
Language: C++

using namespace std;
int main() {
  int n, m;
  scanf("%d %d",&n,&m);
  printf("%d",n*(n-1)/2+m*(m-1)/2);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'scanf' was not declared in this scope
    4 |   scanf("%d %d",&n,&m);
      |   ^~~~~
a.cc:5:3: error: 'printf' was not declared in this scope
    5 |   printf("%d",n*(n-1)/2+m*(m-1)/2);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using namespace std;
Language: C++

%include<bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  cout << n*(n-1)/2+m*(m-1)/2 << endl;
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before '%' token
    1 | %include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n >> m;
      |   ^~~
a.cc:6:3: error: 'cout' was not declared in this scope
    6 |   cout << n*(n-1)/2+m*(m-1)/2 << endl;
      |   ^~~~
a.cc:6:34: error: 'endl' was not declared in this scope
    6 |   cout << n*(n-1)/2+m*(m-1)/2 << endl;
      |                                  ^~~~
Language: Java

import java.util.Scanner;
public class Main {
  public static void main(String[] args) {
  Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] n = new int[N];
        for(int i=0; i<N; i++) {
          n[i] = sc.nextInt();
        }
    int M = sc.nextInt();
    int[] m = new int[N];
        for(int i=0; i<N; i++) {
          m[i] = sc.nextInt();
        }
    int cnt = 0;
    for(int i=0; i<=N; i++){
        if((m[i]+n[i])%2 == 0) {
            cnt++;
        } else {
          continue;
        }
      }
    }
    System.out.println(cnt);
  }
}

Compiler output:
Main.java:24: error: <identifier> expected
    System.out.println(cnt);
                      ^
Main.java:24: error: <identifier> expected
    System.out.println(cnt);
                          ^
Main.java:26: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF (2147483647)
#define MOD (int)(1e9 + 7) 

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    double ans = 0;
    double s;
    cin >> s;
    double min = (s/3) * (s/3) * (s/3);
    if((int)s%3 == 0) {
        ans = min;
    }
    int res = (s/3);
    else {
        for(int i = 0; i <= 1000; ++i) {
            for(int j = 0; j <= 1000; ++j) {
                double ii = (double)i/(double)1000;
                double jj = (double)j/(double)1000;
                double kk = s - (res+ii) - (res+jj);
                ans = max(ans, ii*jj*kk);
            }
        }
    }
    cout << fixed << setprecision(12) << ans << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'else' without a previous 'if'
   19 |     else {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,m; 
  cin >> n>> m;
  cout<<N*(N-1)/2+M*(M-1)/2<<endl;
  return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'N' was not declared in this scope
    7 |   cout<<N*(N-1)/2+M*(M-1)/2<<endl;
      |         ^
a.cc:7:19: error: 'M' was not declared in this scope
    7 |   cout<<N*(N-1)/2+M*(M-1)/2<<endl;
      |                   ^
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] ) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int ans = N * (N - 1) + M / 2;
    System.out.println(ans);
  }
}
    

Compiler output:
Main.java:3: error: <identifier> expected
  public static void main(String[] ) {
                                  ^
1 error
Language: C

N,M = map(int,input().split())

print(int(N*(N-1)/2+M*(M-1)/2))

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N,M = map(int,input().split())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
    1 | N,M = map(int,input().split())
      |   ^
main.c:1:7: error: implicit declaration of function 'map' [-Wimplicit-function-declaration]
    1 | N,M = map(int,input().split())
      |       ^~~
main.c:1:11: error: expected expression before 'int'
    1 | N,M = map(int,input().split())
      |           ^~~
main.c:3:1: error: expected ',' or ';' before 'print'
    3 | print(int(N*(N-1)/2+M*(M-1)/2))
      | ^~~~~
Language: C

#include<stdio.h>
int per(int a)
{
  int b=a-1;
  fact=b*a;
  return fact;
}
void main()
{
  int n,m,a,b,c,d,g;
  scanf("%d %d",&n,&m);
  a=n-2;
  b=m-2;
  {
    if(a>=0)
  {
    c=per(n)/2;
  }
  else
    c=0;
  }
  {
    if(b>=0)
  {
    d=per(m)/2;
  }
 else
   d=0;
  }
  g=d+c;
  printf("%d",g);
}
 


Compiler output:
main.c: In function 'per':
main.c:5:3: error: 'fact' undeclared (first use in this function)
    5 |   fact=b*a;
      |   ^~~~
main.c:5:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
int N,M;
scanf("%d %d",&N,&M);
printf("%d",n*(n-1)/2+m*(m-1)/2);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:13: error: 'n' undeclared (first use in this function)
    5 | printf("%d",n*(n-1)/2+m*(m-1)/2);
      |             ^
main.c:5:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:23: error: 'm' undeclared (first use in this function)
    5 | printf("%d",n*(n-1)/2+m*(m-1)/2);
      |                       ^
Language: C++

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

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

  int ans = n*(n-1)/2 + m*(m-1)/2

  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'cout'
   10 |   cout << ans << endl;
      |   ^~~~
Language: Java

#include<stdio.h>
 
int main(){
	int N,M;
  	scanf("%d%d",&N,&M);
  
  	printf("%d\n",(N*(N-1))/2+(M*(M-1)/2));
  	return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:5: error: class, interface, enum, or record expected
  	scanf("%d%d",&N,&M);
  	^
Main.java:7: error: class, interface, enum, or record expected
  	printf("%d\n",(N*(N-1))/2+(M*(M-1)/2));
  	^
Main.java:8: error: class, interface, enum, or record expected
  	return 0;
  	^
Main.java:9: error: class, interface, enum, or record expected
}
^
6 errors
Language: Java

#include <stdio.h>

int main(void) {
  int N;
  int M;
  scanf("%d", &N);
  scanf("%d", &M);
  int cnt_a = 0;
  int cnt_b = 0;

  cnt_a = (N * (N - 1)) / 2;
  cnt_b = (M * (M - 1)) / 2;
  int sum = cnt_a + cnt_b;
  printf("%d\n", sum);
  return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
  int M;
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: class, interface, enum, or record expected
  scanf("%d", &N);
  ^
Main.java:7: error: class, interface, enum, or record expected
  scanf("%d", &M);
  ^
Main.java:11: error: class, interface, enum, or record expected
  cnt_a = (N * (N - 1)) / 2;
  ^
Main.java:12: error: class, interface, enum, or record expected
  cnt_b = (M * (M - 1)) / 2;
  ^
Main.java:14: error: class, interface, enum, or record expected
  printf("%d\n", sum);
  ^
Main.java:15: error: class, interface, enum, or record expected
  return 0;
  ^
Main.java:16: error: class, interface, enum, or record expected
}
^
10 errors
Language: Java

#include <stdio.h>

int main(void){
        int n,m;
        int nsum,msum;
        int s;
        scanf("%d"" %d ", &n,&m);
        if ( n < 2)
                nsum = 0;
        else if ( n > 1)
                nsum = n * (n - 1) / 2;

        if ( m < 2)
                msum = 0;
        else if ( m > 1)
                msum = m * (m - 1) / 2;

        s = nsum + msum ;
     printf("%d\n",s);

        return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:5: error: class, interface, enum, or record expected
        int nsum,msum;
        ^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
        int s;
        ^
  (use --enable-preview to enable unnamed classes)
Main.java:7: error: class, interface, enum, or record expected
        scanf("%d"" %d ", &n,&m);
        ^
Main.java:8: error: class, interface, enum, or record expected
        if ( n < 2)
        ^
Main.java:10: error: class, interface, enum, or record expected
        else if ( n > 1)
        ^
Main.java:13: error: class, interface, enum, or record expected
        if ( m < 2)
        ^
Main.java:15: error: class, interface, enum, or record expected
        else if ( m > 1)
        ^
Main.java:18: error: class, interface, enum, or record expected
        s = nsum + msum ;
        ^
Main.java:19: error: class, interface, enum, or record expected
     printf("%d\n",s);
     ^
Main.java:21: error: class, interface, enum, or record expected
        return 0;
        ^
Main.java:22: error: class, interface, enum, or record expected
}
^
13 errors
Language: C

#include<stdio.h>
int main(void){
  int a,b;
  scanf("%d %d"&a,&b);
  if(a==0){a=0;}
  else {a=(a*(a-1))/2;}
  if(b==0){b=0;}
  else {b=(b*(b-1))/2;}  
  printf("%d",a+b);
 return 0; 
}

Compiler output:
main.c: In function 'main':
main.c:4:16: error: invalid operands to binary & (have 'char *' and 'int')
    4 |   scanf("%d %d"&a,&b);
      |         ~~~~~~~^
      |         |
      |         char *
Language: Java

import java.util.Scanner;
public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int M = sc.nextInt();
    int result = 0;
    int sum = 0;
    if(N / 2 == 0 && M / 2 != 0)
       sum = N + M;
    if(sum / 2 == 0)
      result++
      System.out.println(result);
  }
}


Compiler output:
Main.java:14: error: ';' expected
      result++
              ^
1 error
Language: Java

    import java.util.Scanner;
     
    public class Solution{
      public static void main(String[] args){
        
        Scanner scan = new Scanner(System.in);
        
        String word = scan.nextLine();
        int length = word.length();
        
        if (isPalindrome(word) && isPalindrome(word.substring(0, (length-1)/2)) && isPalindrome(word.substring(((length+3)/2)-1, length))){
          System.out.println("Yes");
        }
        else {
          System.out.println("No");
        }
      }
      
      public static boolean isPalindrome(String string){
        for(int i = 0; i < string.length()/2; i++){
          if (Character.compare(string[i], string[string.length()-1-i] != 0)){
            return false;
          }
        }
        return true;
      }
    }

Compiler output:
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java
    public class Solution{
           ^
Main.java:21: error: array required, but String found
          if (Character.compare(string[i], string[string.length()-1-i] != 0)){
                                      ^
Main.java:21: error: array required, but String found
          if (Character.compare(string[i], string[string.length()-1-i] != 0)){
                                                 ^
3 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int mani()
{
    int a,b;
    cin>>a>>b;
    cout<<((a*(a-1))/2) + ((b*(b-1))/2)<<endl;
return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#inlcude<bits/stdc++.h>
using namespace std;
int mani()
{
    int a,b;
    cin>>a>>b;
    cout<<(n*(n-1))/2 + (m*(m-1))/2<<endl;
return 0;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int mani()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>a>>b;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlcude<bits/stdc++.h>
a.cc:7:5: error: 'cout' was not declared in this scope
    7 |     cout<<(n*(n-1))/2 + (m*(m-1))/2<<endl;
      |     ^~~~
a.cc:7:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:12: error: 'n' was not declared in this scope
    7 |     cout<<(n*(n-1))/2 + (m*(m-1))/2<<endl;
      |            ^
a.cc:7:26: error: 'm' was not declared in this scope
    7 |     cout<<(n*(n-1))/2 + (m*(m-1))/2<<endl;
      |                          ^
a.cc:7:38: error: 'endl' was not declared in this scope
    7 |     cout<<(n*(n-1))/2 + (m*(m-1))/2<<endl;
      |                                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlcude<bits/stdc++.h>
Language: C++

#include &lt;bits/stdc++.h&gt;
using namespace std;

int main() {
cout&lt;&lt;"めがっち"&lt;&lt;endl;
}

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include &lt;bits/stdc++.h&gt;
      |          ^
a.cc: In function 'int main()':
a.cc:5:1: error: 'cout' was not declared in this scope
    5 | cout&lt;&lt;"めがっち"&lt;&lt;endl;
      | ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include &lt;bits/stdc++.h&gt;
a.cc:5:6: error: 'lt' was not declared in this scope
    5 | cout&lt;&lt;"めがっち"&lt;&lt;endl;
      |      ^~
a.cc:5:31: error: 'endl' was not declared in this scope
    5 | cout&lt;&lt;"めがっち"&lt;&lt;endl;
      |                               ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include &lt;bits/stdc++.h&gt;
Language: C++

#include <bits/stdc++.h>
using namespace std;
void print() {
    cout << endl;
}
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(tail) != 0)
        cout << " ";
    print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
    for (auto &a : vec) {
        cout << a;
        if (&a != &vec.back())
            cout << " ";
    }
    cout << endl;
}
template <class T>
void print(vector<vector<T>> &df) {
    for (auto &vec : df) {
        print(vec);
    }
}
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define xrep(i, a, b) for (int i = int(a); i < int(b); ++i)
using ll = long long;
const int INF = 1001001001;

int main() {
    int N, M;
    cin >> N >> M;
    
    print(N*(N-1)/2+M*(M-1)/2)
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:31: error: expected ';' before 'return'
   37 |     print(N*(N-1)/2+M*(M-1)/2)
      |                               ^
      |                               ;
   38 | 
   39 |     return 0;
      |     ~~~~~~
Language: C++

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

int main(){
  int n,m; cin>>n>>m;
  cout << n(n-1)/2 + m(m-1)/2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'n' cannot be used as a function
    9 |   cout << n(n-1)/2 + m(m-1)/2 << endl;
      |           ~^~~~~
a.cc:9:23: error: 'm' cannot be used as a function
    9 |   cout << n(n-1)/2 + m(m-1)/2 << endl;
      |                      ~^~~~~
Language: Java

import java.util.Scanner;

public class TheNumberofEvenPairs{

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		int numN = N * (N - 1) / 2;
		int numM = M * (M - 1) / 2;

		int sum = numN + numM;

		System.out.println(sum);

		sc.close();

	}

}


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

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

int main() {
  int N,M;
  cin >> N >> M;
  int count;
  if (N>1){
    count += N*(N-1)/2;
  }
  if (M>1){
    count += M*(M-1)/2 
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected ';' before '}' token
   12 |     count += M*(M-1)/2
      |                       ^
      |                       ;
   13 |   }
      |   ~
Language: C++

#include<bits/c++.h>
int main()
  using namespace std;
{ int  m,n;
 cin>>n>>m;
 int sum=n*(n-1)/2+m*(m-1)/2;
 cout<<sum:
 return 0;
}

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


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

int main() {
int n,m;cin>>n>>m;
  cout <<n(n-1)/2+m(m-1)/2;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'n' cannot be used as a function
   10 |   cout <<n(n-1)/2+m(m-1)/2;
      |          ~^~~~~
a.cc:10:20: error: 'm' cannot be used as a function
   10 |   cout <<n(n-1)/2+m(m-1)/2;
      |                   ~^~~~~
Language: C++



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

int main() {
int n,m;
  cout <<n(n-1)/2+m(m-1)/2;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: 'n' cannot be used as a function
   11 |   cout <<n(n-1)/2+m(m-1)/2;
      |          ~^~~~~
a.cc:11:20: error: 'm' cannot be used as a function
   11 |   cout <<n(n-1)/2+m(m-1)/2;
      |                   ~^~~~~
Language: Java

package ex;
import java.util.Scanner;

public class Main2 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        System.out.println(N*(N-1)/2+M*(M-1)/2);
        sc.close();
    }
}

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

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <cstring>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-9;


int main(){
   int n, m;
   cin >> n >> m;
   int i = n*(n-1)/2, j = m*(m-1)/2, r = 0;
   if(i > 0) ans += i;
   if(j > 0) ans += j;
   printf("%d\n", ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:89:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   89 |    if(i > 0) ans += i;
      |              ^~~
      |              abs
a.cc:90:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   90 |    if(j > 0) ans += j;
      |              ^~~
      |              abs
a.cc:91:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   91 |    printf("%d\n", ans);
      |                   ^~~
      |                   abs
Language: C++

#include<iostream>

int main(){
  int N,M,res=0,i;
  cin >> N >> M;
  res = N*(N-1)/2+M*(M-1)/2;
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> N >> M;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << res << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout << res << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;

#組み合わせの計算(両方奇数または両方偶数)
int main(){
    int N,M;
    cin >> N >> M;
    cout<<N*(N-1)/2+M*(M-1)/2<<endl;
    return 0;
}

Compiler output:
a.cc:4:2: error: invalid preprocessing directive #\U00007d44\U0000307f\U00005408\U0000308f\U0000305b\U0000306e\U00008a08\U00007b97
    4 | #組み合わせの計算(両方奇数または両方偶数)
      |  ^~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m;
  cin>>n>>m;
  cout<<(n*(n-1))/2+((m*(m-1))/2;
   return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:33: error: expected ')' before ';' token
    7 |   cout<<(n*(n-1))/2+((m*(m-1))/2;
      |                     ~           ^
      |                                 )
Language: C

#include
<iostream>
using namespace std
;
int main
(){
int N
,
M
;
6
cin
>>
N
>>
M
;
7
8
cout
<<
N
*(
N
-1)/2+
M
*(
M
-1)/2<<
endl
;
9
return
0;

Compiler output:
main.c:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
main.c:2:1: error: expected identifier or '(' before '<' token
    2 | <iostream>
      | ^
main.c: In function 'main':
main.c:11:2: error: expected ';' before 'cin'
   11 | 6
      |  ^
      |  ;
   12 | cin
      | ~~~
main.c:18:2: error: expected ';' before numeric constant
   18 | 7
      |  ^
      |  ;
   19 | 8
      | ~ 
main.c:32:2: error: expected ';' before 'return'
   32 | 9
      |  ^
      |  ;
   33 | return
      | ~~~~~~
main.c:34:1: error: expected declaration or statement at end of input
   34 | 0;
      | ^
Language: C++

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

// 考える整数の最大値
const int MAX = 100;

// メモを保管する場所
ll fact[MAX], inv_fact[MAX], inv[MAX];

// メモを計算する
void init() {
    // 初期値設定と1はじまりインデックスに直す
    fact[0] = 1;
    fact[1] = 1;
    inv[0] = 1;
    inv[1] = 1;
    inv_fact[0] = 1;
    inv_fact[1] = 1;
    // メモの計算
    repi(i, 2, MAX){
        // 階乗
        fact[i] = fact[i - 1] * i % MOD;
        // 逆元
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        // 逆元の階乗
        inv_fact[i] = inv_fact[i - 1] * inv[i] % MOD;
    }
}

// 二項係数の実体
ll nCk(int n, int k) {
    ll x = fact[n]; // n!の計算
    ll y = inv_fact[n-k]; // (n-k)!の計算
    ll z = inv_fact[k]; // k!の計算
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return x * ((y * z) % MOD) % MOD;
}


int main(){
  init();
  int N, M;
  cin >> N >> M;
  cout << nCk(N, 2) + nCk(M, 2) << endl;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:26:37: error: 'MOD' was not declared in this scope
   26 |         fact[i] = fact[i - 1] * i % MOD;
      |                                     ^~~
a.cc: In function 'll nCk(int, int)':
a.cc:41:27: error: 'MOD' was not declared in this scope
   41 |     return x * ((y * z) % MOD) % MOD;
      |                           ^~~
Language: C++

# include <iomanip>
# include <math.h>
# include <cmath>
using namespace std;
int main()
{
	double l;
	double a,b;
	cin>>l;
	a=(l*l*l)/27;
	cout<<fixed<<setprecision(10)<<l*l*l/27;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin>>l;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | # include <cmath>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout<<fixed<<setprecision(10)<<l*l*l/27;
      |         ^~~~
a.cc:11:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

# include <iomanip>
# include <math.h>
# include <cmath>
using namespace std;
int main()
{
	int l;
	double a,b;
	cin>>l;
	a=(l*l*l)/27;
	cout<<fixed<<setprecision(10)<<a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin>>l;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | # include <cmath>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout<<fixed<<setprecision(10)<<a;
      |         ^~~~
a.cc:11:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main() {
  int n, m;
  cin >> n >> m;
  int a, b;
  int a = n * (n - 1) / 2;
  int b = m * (m - 1) / 2;
  cout << a + b << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: redeclaration of 'int a'
    8 |   int a = n * (n - 1) / 2;
      |       ^
a.cc:7:7: note: 'int a' previously declared here
    7 |   int a, b;
      |       ^
a.cc:9:7: error: redeclaration of 'int b'
    9 |   int b = m * (m - 1) / 2;
      |       ^
a.cc:7:10: note: 'int b' previously declared here
    7 |   int a, b;
      |          ^
Language: C

#include<stfio.h>
int main(void)
{
	int N,M,ans,i;
	ans=0;
	scanf("%d %d",&N,&M);
	for(i=1;i<N;i++){
		ans+=i;
	}
	for(i=1;i<M;i++){
		ans+=i;
	}
	printf("%d\n",ans);
	return 0;
}

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

#include<stdio.h>
int main(void)
{
	int N,M,i,ans;
	ans=0
	scanf("%d %d",&N,&M);
	for(i=1;i<N;i++){
		ans+=i;
	}
	for(i=1;i<M;i++){
		ans+=i;
	}
	printf("%d\n",ans);
	return 0;
}

		
		

Compiler output:
main.c: In function 'main':
main.c:5:14: error: expected ';' before 'scanf'
    5 |         ans=0
      |              ^
      |              ;
    6 |         scanf("%d %d",&N,&M);
      |         ~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
	int a,b;
  cin >> a >> b;
  
  auto choose = [](int x){
    return (x*(x-1))/2;
  }
  
  printf("%d\n", choose(a) + choose(b));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: expected ',' or ';' before 'printf'
   13 |   printf("%d\n", choose(a) + choose(b));
      |   ^~~~~~
Language: Java

import java.util.Scanner;

public class atcoder1 {
    public static int tinh(int n){
        return (n*(n-1))/2;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N, M;
        N = sc.nextInt();
        M = sc.nextInt();
        System.out.println(tinh(N) + tinh(M));
    }
}

Compiler output:
Main.java:3: error: class atcoder1 is public, should be declared in a file named atcoder1.java
public class atcoder1 {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Main {
    public static int N, M;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        M = sc.nextInt();
        System.out.println(to_hop(N) + to_hop(M));
    }
    public static int to_hop(int temp)
    {
        to_hop = (temp*(temp-1)) / 2;
        return  to_hop;
    }

}


Compiler output:
Main.java:13: error: cannot find symbol
        to_hop = (temp*(temp-1)) / 2;
        ^
  symbol:   variable to_hop
  location: class Main
Main.java:14: error: cannot find symbol
        return  to_hop;
                ^
  symbol:   variable to_hop
  location: class Main
2 errors
Language: C++

#include <bits/stdc++>
using namespace std; 
int main()
{
  int m,n; 
  cin>>n>>m; 
  cout<<n*(n-1)/2 + m*(m-1)/2; 
}


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

#include iostream; 
using namespace std; 
int main()
{
  int m,n; 
  cin>>n>>m; 
  cout<<n*(n-1)/2 + m*(m-1)/2; 
}

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include iostream;
      |          ^~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n>>m;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include iostream;
a.cc:7:3: error: 'cout' was not declared in this scope
    7 |   cout<<n*(n-1)/2 + m*(m-1)/2;
      |   ^~~~
a.cc:7:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main()
{
  int N,M;
 cin>>N>>M;
  cout<<N*(N-1)/2+M*(M-1)/2;
}  

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespavce'
    2 | using namespavce std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |  cin>>N>>M;
      |  ^~~
      |  std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout<<N*(N-1)/2+M*(M-1)/2;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

int main()
{
  int a,b,x;
  cin >> a >> b;
  x = a + b;
  cout << (x * (x - 1) / 2) - (a * b)
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:38: error: expected ';' before 'return'
   13 |   cout << (x * (x - 1) / 2) - (a * b)
      |                                      ^
      |                                      ;
   14 |   return 0;
      |   ~~~~~~
Language: C++

#include <iostream>
int main()
{int N,M;
std::cin >> N >> M;
std::cout << (N*(N-1))/2+(M*(M-1))/2 << std::endl:
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:50: error: expected ';' before ':' token
    5 | std::cout << (N*(N-1))/2+(M*(M-1))/2 << std::endl:
      |                                                  ^
      |                                                  ;
Language: C


#include<iostream>
using namespace std;

int N,M;
int ans;
long nCr(int n, int r);


int main(){
    std::cin >> N >> M;
    ans = nCr(N+M,2) - N*M;
    std::cout << ans;
}

long nCr(int n, int r) {
    long ans = 1;
    for (int i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (int i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}

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

#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
#define itn int
#define all(c) c.begin(),c.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define ll long long
#define ull unsigned long long
#define pll pair<ll, ll>
#define pii pair<int, int>
#define mp(x, y) make_pair(x, y)
using namespace std; 

const double PI = 3.1415926536;
int days[13] = {0, 31, 28, 31, 30, 31,30, 31, 31, 30, 31, 30, 31};

template<typename T>
ostream& operator <<(ostream& out, const vector<T>& mas) {
    for (const auto& x : mas) {
        out << x << ' ';
    }
    return out;
}

void ok() {
    cout << "YES" << '\n';
}

void no() {
    cout << "NO" << '\n';
}

inline ll nxt() {
    ll x;
    cin >> x;
    return x;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    int n = nxt(), m = nxt()
    cout << n * (n - 1) / 2 + m * (m - 1) / 2;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:5: error: expected ',' or ';' before 'cout'
   46 |     cout << n * (n - 1) / 2 + m * (m - 1) / 2;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll n,m;
	cin>>n>>m;
	cout << n(n-1)/2+m(m-1)/2;
	// your code goes here
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'n' cannot be used as a function
   10 |         cout << n(n-1)/2+m(m-1)/2;
      |                 ~^~~~~
a.cc:10:27: error: 'm' cannot be used as a function
   10 |         cout << n(n-1)/2+m(m-1)/2;
      |                          ~^~~~~
Language: C

#include<iostream>
 using namespace std;

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

 cout<<N*(N-1)/2+M*(M-1)/2<<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 <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int) (n); i++)
#define ll long long
ll INF=9e17;



int main() {
	int n,m;
	cin >> n >> m;
	cout<<N*(N-1)/2+M*(M-1)/2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: 'N' was not declared in this scope
   13 |         cout<<N*(N-1)/2+M*(M-1)/2<<endl;
      |               ^
a.cc:13:25: error: 'M' was not declared in this scope
   13 |         cout<<N*(N-1)/2+M*(M-1)/2<<endl;
      |                         ^
Language: Java

import java.util.*;
	public class Main{
      public static viod main(String[]args){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int m = s.nextInt();
        System.out.println(n*(n-1)/2 + m*(m-1)/2);
      }
    }
        

Compiler output:
Main.java:3: error: cannot find symbol
      public static viod main(String[]args){
                    ^
  symbol:   class viod
  location: class Main
1 error
Language: Java

public class Main {
 
	public static void main(String[] args) {
 
		Scanner scan = new Scanner(System.in);
 
		int N = scan.nextInt();
		int M = scan.nextInt();
 
		System.out.println(N * (N -1)/2 + M * (M -1)/2);
 
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

int main() {
  int n,m;
  cin >> n >> m;
  
  if(n<=1){
    n=0;
  }
  else{
    n=n(n-1)/2;
  }
  if(m<=1){
    m=0;
  }
  else{
    m=m(m-1)/2;
  }
  
  cout << n+m << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 'n' cannot be used as a function
   12 |     n=n(n-1)/2;
      |       ~^~~~~
a.cc:18:8: error: 'm' cannot be used as a function
   18 |     m=m(m-1)/2;
      |       ~^~~~~
Language: C++

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

int main(){
  int N,M;
  cin >> N >> M;
  cout << N*(N-1)+M*(M-1) << endl;
}

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

#include <bits/stdc++.h>
#include <math.h>
#define rep(i,n) for (int i=0;i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
 
 
int main() {
    int k,n;
    cin >> k >> n;
    vector<int> A(n);
    cout << k(k-1)/2 + n(n-1)/2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'k' cannot be used as a function
   13 |     cout << k(k-1)/2 + n(n-1)/2 << endl;
      |             ~^~~~~
a.cc:13:25: error: 'n' cannot be used as a function
   13 |     cout << k(k-1)/2 + n(n-1)/2 << endl;
      |                        ~^~~~~
Language: C++

int main(){
	int n,m;
	int ans;
	cin >> n >> m;
	ans = (n*(n-1)+m*(m-1))/2;
	cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> n >> m;
      |         ^~~
a.cc:6:9: error: 'cout' was not declared in this scope
    6 |         cout << ans << endl;
      |         ^~~~
a.cc:6:24: error: 'endl' was not declared in this scope
    6 |         cout << ans << endl;
      |                        ^~~~
a.cc:6:29: error: expected '}' at end of input
    6 |         cout << ans << endl;
      |                             ^
a.cc:1:11: note: to match this '{'
    1 | int main(){
      |           ^
Language: C++

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

int main(){
int N,M;
  cin >> N >> M;
  
  int A;
  
  int B;
  
  if(N==0||N==1){
     A=0;
  }
   else {
     A=N*(N+1)/2;
   }

  if(M==0||M==1){
    B=0;
  }
    else{
    B==M*(M+1)/2
    }
     cout << A+B << endl;
  }

    

  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: expected ';' before '}' token
   23 |     B==M*(M+1)/2
      |                 ^
      |                 ;
   24 |     }
      |     ~
Language: C++

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

int main(){
int N,M;
  cin >> N >> M;
  
  int sum;
  
  if(N==0&&M==0){
    sum=0;
  }

   else if(N==1&&M==0){
    sum=0:
  }
  
    else if(N==0&&M==1){
      sum=0;
    }
  
  else if(N==1&&M==1){
      sum=0;
  }

  else{
     sum==N*(N+1)/2+M*(M+1)/2;
  }
  

  
  cout << sum << endl;
}

  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: expected ';' before ':' token
   15 |     sum=0:
      |          ^
      |          ;
Language: C++

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

int main() {
int n, m, g, k;
  cin >> n>> m;
  g = n*(n-1)/2;
  k = m*(m-1)/2
    cout << g+k << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected ';' before 'cout'
    8 |   k = m*(m-1)/2
      |                ^
      |                ;
    9 |     cout << g+k << endl;
      |     ~~~~
Language: C++

#include <bitd/stdc++.h>
int main
{
    int n, m;
    cin >> n >> m;
 
    cout << n*(n-1)/2 + m*(m-1)/2;
    return 0;
}

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

#include <bits/stdc++.h>
#include <string>
using namespace std;
int main(){
  string n;
  n=a[n];
  string m;
  m=a[m];
  n%==0;
  m%==1;
  if(a[n]+a[m]==/2){
    count++;
  }
  else{
    cout<<"no""<<endl;
  }
}

Compiler output:
a.cc:15:15: warning: missing terminating " character
   15 |     cout<<"no""<<endl;
      |               ^
a.cc:15:15: error: missing terminating " character
   15 |     cout<<"no""<<endl;
      |               ^~~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'a' was not declared in this scope
    6 |   n=a[n];
      |     ^
a.cc:9:6: error: expected primary-expression before '=' token
    9 |   n%==0;
      |      ^
a.cc:10:6: error: expected primary-expression before '=' token
   10 |   m%==1;
      |      ^
a.cc:11:17: error: expected primary-expression before '/' token
   11 |   if(a[n]+a[m]==/2){
      |                 ^
a.cc:12:10: error: no post-increment operator for type
   12 |     count++;
      |          ^~
a.cc:15:15: error: expected ';' before '}' token
   15 |     cout<<"no""<<endl;
      |               ^
      |               ;
   16 |   }
      |   ~
Language: C++

#include <iostream>
usign namespace std;
 
int main()
{
 
  	int a, b; cin >> a >> b;
 
  	a = ((a-1)*a)/2;
  	b = ((b-1)*b)/2;
  
	int c = a + b;
  	cout << c;
	return 0;
}

Compiler output:
a.cc:2:1: error: 'usign' does not name a type
    2 | usign namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:7:19: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         int a, b; cin >> a >> b;
      |                   ^~~
      |                   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |         cout << c;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~