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

#include<stdio.h>
main(){
 int n=0,m=0,ans=0;
  scanf("%d%d"&n,&m);
  if(n>1){
    ans+=n;
  }
  if(m>1){
    ans+=m;
  }
  return ans;
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:15: error: invalid operands to binary & (have 'char *' and 'int')
    4 |   scanf("%d%d"&n,&m);
      |         ~~~~~~^
      |         |
      |         char *
Language: C++

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 ans=0;

		if (n>=2) {
			ans += (n*(n-1))/2;
		}

		if(m>=2) {
			ans +=(m*(m-1))/2;
		}

		System.out.println(ans);


		//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
	}
	//----------------------------------------
	//メソッド置き場


	//----------------------------------------
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

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

int main() {
  int N,M;
  cin >> N >> M;
  
  int sum_n =0,sum_m =0;
  
  for(int i =0,i < N,i++){
    sum_n += i;
  }
  for(int i=0,i < M,i++){
    sum_m += i;
  }
      
  cout << sum_n + sum_m << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expected ';' before '<' token
   10 |   for(int i =0,i < N,i++){
      |                 ^~
      |                 ;
a.cc:10:18: error: expected primary-expression before '<' token
   10 |   for(int i =0,i < N,i++){
      |                  ^
a.cc:10:25: error: expected ';' before ')' token
   10 |   for(int i =0,i < N,i++){
      |                         ^
      |                         ;
a.cc:13:16: error: expected ';' before '<' token
   13 |   for(int i=0,i < M,i++){
      |                ^~
      |                ;
a.cc:13:17: error: expected primary-expression before '<' token
   13 |   for(int i=0,i < M,i++){
      |                 ^
a.cc:13:24: error: expected ';' before ')' token
   13 |   for(int i=0,i < M,i++){
      |                        ^
      |                        ;
Language: C++

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

long long combi(long long n, long long k) {
  if (n == k || k == 0)
    return 1;
  else {
    return combi(n - 1, k - 1) + combi(n - 1, k);
  }
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:45: error: expected '}' at end of input
   21 |     cout << combi(N,2) + combi(M,2) << endl;
      |                                             ^
a.cc:16:12: note: to match this '{'
   16 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespacestd;

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespacestd'
    2 | using namespacestd;
      |       ^~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   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:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout<<a<<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:8:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |   cout<<a<<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: Java

import java.util.Scanner;

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

        int comboN = (N*(N-1))/2;
        int comboM = (M*(M-1))/2;

        System.out.println(comboN+comboM);
    }
}


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

import java.util.Scanner;

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


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

import java.util.Scanner;

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


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Even_pairs {
      | ^~~~~~
Language: Java

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

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:6: error: not a statement
  cin>>n>>m;
        ^
Main.java:7: error: not a statement
  cout<<((n*(n-1)/2)+(m*(m-1)/2))<<endl;
                                 ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
5 errors
Language: Java

import java.util.Scanner;

public class EvenPairs {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int m = in.nextInt();

        int even = 0;
        int odd = 0;
        for (int i = 0; i < n ; i++) {
            even += i;
        }
        for (int i = 0; i < m ; i++) {
            odd += i;
        }
        System.out.println(even+odd);
    }
}

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

my ($n,$m)=get.words; say ($n**2+$m**2-$n-$m) div 2;

Compiler output:
a.cc:1:4: error: expected constructor, destructor, or type conversion before '(' token
    1 | my ($n,$m)=get.words; say ($n**2+$m**2-$n-$m) div 2;
      |    ^
a.cc:1:27: error: expected constructor, destructor, or type conversion before '(' token
    1 | my ($n,$m)=get.words; say ($n**2+$m**2-$n-$m) div 2;
      |                           ^
Language: C++

//
// Created by kinok on 2020/04/17.
//

#include<iostream>
#include<vector>
#include <algorithm>
#include <cmath>

using namespace std;

#ifndef UNTITLED2_ATCODER160_H
#define UNTITLED2_ATCODER160_H

#define ll long long
#define rep(t) for(int i=0;i<t;i++)
#define deb(a) cout<<#a<<" : "<<a<<endl




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




#endif //UNTITLED2_ATCODER160_H


Compiler output:
a.cc:22:1: error: expected unqualified-id before 'public'
   22 | public:
      | ^~~~~~
Language: C++

//
// Created by kinok on 2020/04/17.
//

#include<iostream>
#include<vector>
#include <algorithm>
#include <cmath>

using namespace std;

#ifndef UNTITLED2_ATCODER160_H
#define UNTITLED2_ATCODER160_H

#define ll long long
#define rep(t) for(int i=0;i<t;i++)
#define deb(a) cout<<#a<<" : "<<a<<endl


class atcoder160 {


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


};


#endif //UNTITLED2_ATCODER160_H


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++

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

Compiler output:
a.cc:1:1: error: '::main' must return 'int'
    1 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin>>m>>n;
      |         ^~~
a.cc:4:9: error: 'cout' was not declared in this scope
    4 |         cout<<(m*(m-1)+n*(n-1))/2<<endl;
      |         ^~~~
a.cc:4:36: error: 'endl' was not declared in this scope
    4 |         cout<<(m*(m-1)+n*(n-1))/2<<endl;
      |                                    ^~~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll; 
const ll mod = 1e9+7;
#define fo(i, n) for (int i = 0; i < n; i++)
#define sc(n) scanf("%d", &n) 
using namespace std;

ll n;

void solve() {
    sc(n);
    ll count[n+1] = {0};
    ll a[n];
    ll regular[n+1];
    ll oneGone[n+1];
    fo(i, n) {
        scanf("%I64d", &a[i]);
        count[a[i]]++;
    } 
    fo(i, n) {
        regular[i+1] = (count[i+1] * (count[i+1] - 1))/2;
        oneGone[i+1] = max(((count[i+1]-1) * (count[i+1]-2))/2 ,0);
    }
    ll sumRegular = 0;
    fo(i, n) sumRegular += regular[i+1];
    fo (i, n) {
        printf("%I64d\n", sumRegular-regular[a[i]]+oneGone[a[i]]);
    }
}

int main() {
    int t = 1;
    //scanf("%d", &t);
    while (t--) {
        solve();
    }
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:22:27: error: no matching function for call to 'max(ll, int)'
   22 |         oneGone[i+1] = max(((count[i+1]-1) * (count[i+1]-2))/2 ,0);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:22:27: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   22 |         oneGone[i+1] = max(((count[i+1]-1) * (count[i+1]-2))/2 ,0);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:22:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   22 |         oneGone[i+1] = max(((count[i+1]-1) * (count[i+1]-2))/2 ,0);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: Java

import java.util.*;
import java.io.*;
public class Solution {
    public static void main(String[] args) throws IOException{
    	// Solution sol = new Solution();
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st= new StringTokenizer(br.readLine());
    	int N = Integer.parseInt(st.nextToken());
    	int M = Integer.parseInt(st.nextToken());
    	System.out.println((N*(N-1)+M*(M-1))/2);
    }
}

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

#include<stdio.h>
#include<string.h>
 int main(void)
 {
   char S[100];
   int N,j=0,c=0,i=0,k=0,l=0;
   scanf("%s",S);
   N=strlen(S)-1;
   k=(N-1)/2;
   l=(N+3)/2;
   for(j=0;j<=N;j++)
     if(S[j]==S[n-j]) c=1;
     else c=4;
   if(c==1){
     for(j=0;j<=k;j++)
       if(S[j]==S[k-j]) c=2;
       else c=4;
   }
   if(c==2){
     for(j=l;j<=N;j++)
       if(S[j]==S[N-i]) {i++; c=3;}
       else c=4;
   }
   
   if(c==3) printf("Yes\n");
   if(c==4) printf("No\n");
   return 0;
 }

Compiler output:
main.c: In function 'main':
main.c:12:17: error: 'n' undeclared (first use in this function)
   12 |      if(S[j]==S[n-j]) c=1;
      |                 ^
main.c:12:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int i,j;
  int a,b;
  cin >> i >> j;
  a = i;
  b = j;
  for (;i>1;i--){
    a = a * i;
  }
  if (a = 1) a = 0;
  else a /= 2;
  for (;j>1;j--){
    b = b * i;
  }
  if (b = 1) b = 0;
  else b /= 2;
  cout << a + b endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: expected ';' before 'endl'
   20 |   cout << a + b endl;
      |                ^~~~~
      |                ;
Language: C++

n, m = map(int, input().split())

count = 0
if n > 1:
  count += n * (n - 1) // 2
if m > 1:
  count += m * (m - 1) // 2
print(count)

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

import java.util.Scanner;

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);
        scan.close();
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:11: error: expected ':' before 'static'
    4 |     public static void main(String[] args){
      |           ^~~~~~~
      |           :
a.cc:4:29: error: 'String' has not been declared
    4 |     public static void main(String[] args){
      |                             ^~~~~~
a.cc:4:38: error: expected ',' or '...' before 'args'
    4 |     public static void main(String[] args){
      |                                      ^~~~
a.cc:11:2: error: expected ';' after class definition
   11 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:9: error: 'Scanner' was not declared in this scope
    5 |         Scanner scan=new Scanner(System.in);
      |         ^~~~~~~
a.cc:6:15: error: 'scan' was not declared in this scope
    6 |         int n=scan.nextInt();
      |               ^~~~
a.cc:8:9: error: 'System' was not declared in this scope
    8 |         System.out.println(n*(n-1)/2+m*(m-1)/2);
      |         ^~~~~~
Language: Java

java.util.Scanner;
class Main{
  
  int sum(int n){
    return n*(n+1)/2;
  }

  public static void main(String[] args){
    int n,m;
    Scanner scan = new Scanner(System.in);
    n = scan.nextInt();
    m = scan.nextInt();
    System.out.print(sum(n-1)+sum(m-1));
  }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
java.util.Scanner;
^
1 error
Language: C++

n, m = map(int, input().split())
import math
pn = math.factorial(n) / (math.factorial(n-2) * math.factorial(2))
pm = math.factorial(m) / (math.factorial(m-2) * math.factorial(2))
print(pn + pm)

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

#include <iostream>
using namespace std;

int main() {
    int ans = 0;
    int N, M;
    cin >> N >> M;
    for (int i=0; i<N; ++i) {
        for (int j=0; j<N; ++j) {
            if (i != j) {
                ++ans;
            }
        }
    }
    for (int i=0 i<M; ++i) {
        for (int j=0; j<M; ++j) {
            if (i != j) {
                ++ans;
            }
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected ';' before 'i'
   15 |     for (int i=0 i<M; ++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>;

ll choose2(ll n) {
    return n*(n-1)/2;
}

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    vector<int> cnt(n, 0);
    rep(i,n) cnt[a[i]-1] += 1;
    // 全体を求める
    ll all = 0;
    rep(i,n) {
        if (cnt[i] < 2) continue;
        all += choose2(cnt[i], 2);
    }
    // 全体からk番目と同じボールの選び方を引いて、k番目以外から同じ2個のボールを選ぶ選び方
    vector<ll> ans(n,all);
    rep(k,n) {
        ans[k] -= cnt[a[k]-1] - 1;
        cout << ans[k] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: too many arguments to function 'll choose2(ll)'
   22 |         all += choose2(cnt[i], 2);
      |                ~~~~~~~^~~~~~~~~~~
a.cc:7:4: note: declared here
    7 | ll choose2(ll n) {
      |    ^~~~~~~
Language: C++

    #include<stdio.h>
    int main(void)
    {
      int ng;
      int mk;
      int gc=1;
      int kc=1;
      int c;
      
      scanf("%d",&ng);
      scanf("%d",&mk);
      
      gc=(ng*(ng-1))/2;
      kc=(mk*(mk-1))/2;
      
      c=gc+kc;
      if(n==1||m==1)
      printf("0");
      else printf("%d",c);
      return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 'n' was not declared in this scope
   17 |       if(n==1||m==1)
      |          ^
a.cc:17:16: error: 'm' was not declared in this scope
   17 |       if(n==1||m==1)
      |                ^
a.cc:20:16: error: expected '}' at end of input
   20 |       return 0;
      |                ^
a.cc:3:5: note: to match this '{'
    3 |     {
      |     ^
Language: C++

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

int main(void){
	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:5:16: error: 'N' was not declared in this scope
    5 |         cin >> N >> M;
      |                ^
a.cc:5:21: error: 'M' was not declared in this scope
    5 |         cin >> N >> M;
      |                     ^
Language: Java

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

public class A
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(), m = in.nextInt();
		System.out.println(ncr(m, 2) + ncr(n, 2));
	}
	static int ncr(int n, int r)
	{
		if(n < r)
			return 0;
		r = Math.min(n - r, r);
		int ans = 1;
		for(int i = 1; i <= r; ++i)
		{
			ans *= (n - r + i);
			ans /= i;
		}
		return ans;
	}
}


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


import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author wnqmw
 */
public class evenpairs {
    public static void main(String args[]) {
        Scanner kb = new Scanner(System.in);
        int n = kb.nextInt(), m = kb.nextInt();
        System.out.println((n*(n-1))/2+(m*(m-1))/2);
    }
}


Compiler output:
Main.java:14: error: class evenpairs is public, should be declared in a file named evenpairs.java
public class evenpairs {
       ^
1 error
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:9:22: error: 'm' was not declared in this scope
    9 |   cout<<N*(N-1)/2+M*(m-1)/2<<endl;
      |                      ^
Language: C++

#include <iostream>
#include <cmath>

int main() {
  int L;
  std::cin >> L;
  double quotient = L / 3;
  int ans = std::pow(quotinet, 3);
  std::cout << ans << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: 'quotinet' was not declared in this scope; did you mean 'quotient'?
    8 |   int ans = std::pow(quotinet, 3);
      |                      ^~~~~~~~
      |                      quotient
Language: C++

#include <iostream>
#include <cmath>

int main() {
  int L;
  std::cin >> L;
  double quotient = L / 3;
  int ans = std::pow(quatinet, 3);
  std::cout << ans << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: 'quatinet' was not declared in this scope; did you mean 'quotient'?
    8 |   int ans = std::pow(quatinet, 3);
      |                      ^~~~~~~~
      |                      quotient
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;
  return0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'return0' was not declared in this scope
    8 |   return0;
      |   ^~~~~~~
Language: C++

#include<iostream>2using namespace std;34int main(){5int N,M;6cin>>N>>M;78cout<<N*(N-1)/2+M*(M-1)/2<<endl;9return0;10}7


Compiler output:
a.cc:1:19: warning: extra tokens at end of #include directive
    1 | #include<iostream>2using namespace std;34int main(){5int N,M;6cin>>N>>M;78cout<<N*(N-1)/2+M*(M-1)/2<<endl;9return0;10}7
      |                   ^~~~~~
/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++

int main(){
	int N;
	int M;
	std::cin>>N;
	std::cin>>M;

	int k=static_cast<int>(M*(M-1)/2);
	int l=static_cast<int>(N*(N-1)/2);

	std::cout<<k+l;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: 'cin' is not a member of 'std'
    4 |         std::cin>>N;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(){
a.cc:5:14: error: 'cin' is not a member of 'std'
    5 |         std::cin>>M;
      |              ^~~
a.cc:5:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:14: error: 'cout' is not a member of 'std'
   10 |         std::cout<<k+l;
      |              ^~~~
a.cc:10:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

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

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

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

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 ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
  if (n & 1) res = res * x % mod;
  return res;
}

int main() {
  ll 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:58:41: error: expected '}' at end of input
   58 |   cout << n*(n-1)/2 + m*(m-1)/2 << endl;
      |                                         ^
a.cc:55:12: note: to match this '{'
   55 | int main() {
      |            ^
Language: C++

#include <bits.stdc++.h>
using namespace std;
//O(k)愚直,nは大きいがkがそうでもないときに思い出す
long long modpow(long long x,long long n,long long mod){
    long long res = 1;
    while(n>0){
        if(n&1)(res*=x)%=mod;
        (x*=x)%=mod;
        n>>=1;
    }
    return res;
}
long long modinv(long long x,long long mod){
    return modpow(x,mod-2,mod);
}
long long modcomb(long long n,long long r,long long mod){
    long long numerator=1;
    for(long long i=0;i<r;i++){
        (numerator*=(n-i))%= mod;
    }
    long long denominator=1;
    for (long long i=1;i<=r;i++){
        (denominator*=i) %= mod;
    }
    denominator=modinv(denominator,mod);
    return numerator*denominator%mod;
}
int main(){
long long n,m;
cin >> n >> m;
cout << modcomb(n,2,100000007)+modcomb(m,2,100000007);}


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

#include <bits/stdc++.h>
using namespace = std;
//O(k)愚直,nは大きいがkがそうでもないときに思い出す
long long modpow(long long x,long long n,long long mod){
    long long res = 1;
    while(n>0){
        if(n&1)(res*=x)%=mod;
        (x*=x)%=mod;
        n>>=1;
    }
    return res;
}
long long modinv(long long x,long long mod){
    return modpow(x,mod-2,mod);
}
long long modcomb(long long n,long long r,long long mod){
    long long numerator=1;
    for(long long i=0;i<r;i++){
        (numerator*=(n-i))%= mod;
    }
    long long denominator=1;
    for (long long i=1;i<=r;i++){
        (denominator*=i) %= mod;
    }
    denominator=modinv(denominator,mod);
    return numerator*denominator%mod;
}
int main(){
long long n,m;
cin >> n >> m;
cout << modcomb(n,2,100000007)+modcomb(m,2,100000007);}


Compiler output:
a.cc:2:17: error: expected identifier before '=' token
    2 | using namespace = std;
      |                 ^
a.cc:2:16: error: expected ';' before '=' token
    2 | using namespace = std;
      |                ^~
      |                ;
a.cc:2:17: error: expected unqualified-id before '=' token
    2 | using namespace = std;
      |                 ^
a.cc: In function 'int main()':
a.cc:30:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   30 | 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:31:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 | cout << modcomb(n,2,100000007)+modcomb(m,2,100000007);}
      | ^~~~
      | 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>
using namespace = std;
//O(k)愚直,nは大きいがkがそうでもないときに思い出す
long long modpow(long long x,long long n,long long mod){
    long long res = 1;
    while(n>0){
        if(n&1)(res*=x)%=mod;
        (x*=x)%=mod;
        n>>=1;
    }
    return res;
}
long long modinv(long long x,long long mod){
    return modpow(x,mod-2,mod);
}
long long modcomb(long long n,long long r,long long mod){
    long long numerator=1;
    for(long long i=0;i<r;i++){
        (numerator*=(n-i))%= mod;
    }
    long long denominator=1;
    for (long long i=1;i<=r;i++){
        (denominator*=i) %= mod;
    }
    denominator=modinv(denominator,mod);
    return numerator*denominator%mod;
}
int main(){
long long n,m;
cin >> n >> m;
cout << modcomb(n,2,100000007)+modcomb(m,2,100000007);}


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

#define ll long long
#define INF 99999999
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#include<bits/stdc++.h>
using namespace std;
int main (){
    int n,m;
    cin >>n >> m;
    if(n > 1){
        n = n * (n-1)/2;
    }else n=0;
    if(m >1){
        m = m (m-1)/2;
    }else m = 0;
    cout << m+n <<endl;
    return 0;
}

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

#include<bits/stdc++.h>

using namespace std;

int main()
{
    long long int n,m2 12 1;
    cin>>n>>m;
    if(n==1&&m==1)
        cout<<0;
    else if(n==1&&m>1)
    cout<<m*(m-1)/2;
    else if(m==1&&n>1)
        cout<<n*(n-1)/2;
    else
        cout<<((n*(n-1))/2)+m*(m-1)/2;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: expected initializer before numeric constant
    7 |     long long int n,m2 12 1;
      |                        ^~
a.cc:8:13: error: 'm' was not declared in this scope
    8 |     cin>>n>>m;
      |             ^
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:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin>>N>>M;
      | ^~~
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout << N*(N-1)/2+M*(M-1)/2<< endl;
      |   ^~~~
a.cc:8:33: error: 'endl' was not declared in this scope
    8 |   cout << N*(N-1)/2+M*(M-1)/2<< endl;
      |                                 ^~~~
Language: C++

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

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    6 |         ans = 0;
      |         ^~~
      |         abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  vector<int> number(N);
  for (int i == 0; i< N; i ++){
    cin >> A[i];
  }
  int total = 0;
  for (int j = 0; j < N; j ++){
    int tmp = A[j];
    numver[tmp-1] += 1;
  }
  for (int i = 0; i < N; i ++){
    total += number[i] * (number[i] - 1) /2;
  }
  for (int k = 0; k < N; k ++){
    cout << (total - number[A[j] - 1] + 1) << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: expected ';' before '==' token
    8 |   for (int i == 0; i< N; i ++){
      |             ^~~
      |             ;
a.cc:8:14: error: expected primary-expression before '==' token
    8 |   for (int i == 0; i< N; i ++){
      |              ^~
a.cc:8:24: error: expected ')' before ';' token
    8 |   for (int i == 0; i< N; i ++){
      |       ~                ^
      |                        )
a.cc:8:26: error: 'i' was not declared in this scope
    8 |   for (int i == 0; i< N; i ++){
      |                          ^
a.cc:14:5: error: 'numver' was not declared in this scope; did you mean 'number'?
   14 |     numver[tmp-1] += 1;
      |     ^~~~~~
      |     number
a.cc:20:31: error: 'j' was not declared in this scope
   20 |     cout << (total - number[A[j] - 1] + 1) << endl;
      |                               ^
Language: C++

#include <iostream>
using namespace std;
main()
{
	int N,M,A;
	
 cin>>N>>M;
 A=N*(N-1)/2;
 B=M*(M-1)/2;
 
 cout<<A+B;
	 
	
	
	
	
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:2: error: 'B' was not declared in this scope
    9 |  B=M*(M-1)/2;
      |  ^
Language: C++

#include <iostream>
using namespace std;
main
{
	int N,M;
	
 cin>>"N">>"M";
 
 if(N>M)
 {cout<<"M";
	 }
	 else
	 {cout<<"N";
		 }	
	 
	
	
	
	
}

Compiler output:
a.cc:3:1: error: 'main' does not name a type
    3 | main
      | ^~~~
Language: C++

#include <iostream>
using namespace std;
main
{
	int N,M;
	
 cin>>N>>M;
 
 if(N>M)
 {cout<<M;
	 }
	 else
	 {cout<<N;
		 }	
	 
	
	
	
	
}

Compiler output:
a.cc:3:1: error: 'main' does not name a type
    3 | main
      | ^~~~
Language: C

#include<stdio.h>
int main()
{
int n,x;
x=n*(n_1)/2;
scanf("%d",&x);
printf("%d\n",even);


return 0;



}

Compiler output:
main.c: In function 'main':
main.c:5:6: error: 'n_1' undeclared (first use in this function)
    5 | x=n*(n_1)/2;
      |      ^~~
main.c:5:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:15: error: 'even' undeclared (first use in this function)
    7 | printf("%d\n",even);
      |               ^~~~
Language: C

#include<stdio.h>
int main()
{
int n;
if(n%2==0) {
printf("Even\n");

}
else if {
printf("Odd\n");

}

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: expected '(' before '{' token
    9 | else if {
      |         ^
      |         (
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'M' cannot be used as a function
    7 |   cout<<N*(N-1)/2+M(M-1)/2<<endl;
      |                   ~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  int count=0;
cin>>N>>M;
 vector<int>vec(N);
  vector<int>vec(M);
  for(int i;i<N;i++){
  for(int j;j<M;j++){
  if((vec.at(i)+vec.at(j))%2==0){
  
  count++;
  }
  
  }
  }
  
  cout<<count<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: redeclaration of 'std::vector<int> vec'
    8 |   vector<int>vec(M);
      |              ^~~
a.cc:7:13: note: 'std::vector<int> vec' previously declared here
    7 |  vector<int>vec(N);
      |             ^~~
Language: C++

include<bits/stdc++.h>
using namespace std;
int main(){
int N,M;
  int count=0;
cin>>N>>M;
 vector<int>vec(N);
  vector<int>vec(M);
  for(int i;i<N;i++){
  for(int j;j<M;j++){
  if((vec.at(i)+vec.at(j))%2==0){
  
  count++;
  }
  
  }
  }
  
  cout<<count<<endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin>>N>>M;
      | ^~~
a.cc:7:2: error: 'vector' was not declared in this scope
    7 |  vector<int>vec(N);
      |  ^~~~~~
a.cc:7:9: error: expected primary-expression before 'int'
    7 |  vector<int>vec(N);
      |         ^~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int>vec(M);
      |          ^~~
a.cc:11:7: error: 'vec' was not declared in this scope
   11 |   if((vec.at(i)+vec.at(j))%2==0){
      |       ^~~
a.cc:19:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   19 |   cout<<count<<endl;
      |   ^~~~
      |   count
a.cc:19:16: error: 'endl' was not declared in this scope
   19 |   cout<<count<<endl;
      |                ^~~~
Language: C

#include<iostream>
using namespace std;
int main()
{
    int a,b,i,sum1,sum2;
    cin>>a>>b;
    sum1=0;
    sum2=0;
    for(i=a-1;i>0;i--){
        sum1=sum1+i;
    }
    for(i=b-1;i>0;i--){
        sum2=sum2+i;
    }
    cout<<sum1+sum2;
}


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

#iclude<stdio.h>
int main(){
  char s[99];
  scanf("%s",s);
  int i;
  for(i=0;s[i]!='\0';i++);
  int j,x=1;
  for(j=0;j<i/2;j++){
    if(s[j]!=s[i-j-1]){
      x=0;
    }
  }
  for(j=0;j<(i-2)/2;j++){
    if(s[j]!=s[(i-2)/2-j]){
      x=0;
    }
  }
  for(j=(i+2)/2;j<i-1;j++){
    if(s[j]!=s[i-1-j]){
      x=0;
    }
  }
  if(x==0){
    printf("No");
  }else{
    printf("Yes");
  }
  return 0;
                     }

Compiler output:
main.c:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude<stdio.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%s",s);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #iclude<stdio.h>
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%s",s);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:24:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   24 |     printf("No");
      |     ^~~~~~
main.c:24:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:24:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:26:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   26 |     printf("Yes");
      |     ^~~~~~
main.c:26:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
int main(){
  char s[99];
  scanf("%s",s);
  int i;
  for(i=0;s[i]!='\0';i++);
  int j,x=1;
  for(j=0;j<i/2;j++){
    if(s[j]!=s[i-j-1]){
      x=0;
    }
  }
  for(j=0;j<(i-2)/2;j++){
    if(s[j]!=s[(i-2)/2-j]){
      x=0;
    }
  }
  for(j=(i+2)/2;j<i-1;j++){
    if(s[(j+2)/2]!=s[i-1-j]{
      x=0;
    }
  }
  if(x==0){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
                     }

Compiler output:
main.c: In function 'main':
main.c:19:28: error: expected ')' before '{' token
   19 |     if(s[(j+2)/2]!=s[i-1-j]{
      |       ~                    ^
      |                            )
main.c:22:3: error: expected expression before '}' token
   22 |   }
      |   ^
Language: C

#include<stdio.h>
int main(){
  char s[99];
  scanf("%s",s);
  int i;
  for(i=0;s[i]!='\0';i++);
  int j,x=1;
  for(j=0;j<i/2;j++){
    if(s[j]!=s[i-j-1]){
      x=0;
    }
  }
  for(j=0;j<(i-2)/2;j++){
    if(s[j]!=s[(i-2)/2-j]){
      x=0;
    }
  }
  for(j=(i+2)/2;j<i-1;j++){
    if(s[(j+2)/2]!=s[(i-1-j]){
      x=0;
    }
  }
  if(x==0){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
                     }

Compiler output:
main.c: In function 'main':
main.c:19:28: error: expected ')' before ']' token
   19 |     if(s[(j+2)/2]!=s[(i-1-j]){
      |                      ~     ^
      |                            )
Language: C

#include<stdio.h>
int main(){
  char s[99];
  scanf("%s",s);
  int i;
  for(i=0;s[i]!='\0';i++);
  int j,x=1;
  for(j=0,j<i/2;j++){
    if(s[j]!=s[i-j-1]){
      x=0;
    }
  }
  for(j=0;j<(i-2)/2;j++){
    if(s[j]!=s[(i-2)/2-j]){
      x=0;
    }
  }
  for(j=(i+2)/2;j<i-1;j++){
    if(s[(i+2)/2]!=s[(i-1-j]){
      x=0;
    }
  }
  if(x==0){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
                     }

Compiler output:
main.c: In function 'main':
main.c:8:20: error: expected ';' before ')' token
    8 |   for(j=0,j<i/2;j++){
      |                    ^
      |                    ;
main.c:19:28: error: expected ')' before ']' token
   19 |     if(s[(i+2)/2]!=s[(i-1-j]){
      |                      ~     ^
      |                            )
Language: C++

#include<iostream>
using namespace std;

int main(){
int N,M;
cin>>N>>M;
cout<<N^2-N<<M^2-M<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: no match for 'operator^' (operand types are 'std::basic_ostream<char>' and 'int')
    7 | cout<<N^2-N<<M^2-M<<endl;
      | ~~~~~~~^~~~~~~
      |     |      |
      |     |      int
      |     std::basic_ostream<char>
a.cc:7:8: note: candidate: 'operator^(int, int)' (built-in)
    7 | cout<<N^2-N<<M^2-M<<endl;
      | ~~~~~~~^~~~~~~
a.cc:7:8: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
                 from /usr/include/c++/14/string:68,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/cstddef:146:3: note: candidate: 'constexpr std::byte std::operator^(byte, byte)'
  146 |   operator^(byte __l, byte __r) noexcept
      |   ^~~~~~~~
/usr/include/c++/14/cstddef:146:18: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::byte'
  146 |   operator^(byte __l, byte __r) noexcept
      |             ~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:94:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator^(_Ios_Fmtflags, _Ios_Fmtflags)'
   94 |   operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:94:27: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Fmtflags'
   94 |   operator^(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:144:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator^(_Ios_Openmode, _Ios_Openmode)'
  144 |   operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:144:27: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Openmode'
  144 |   operator^(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:191:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator^(_Ios_Iostate, _Ios_Iostate)'
  191 |   operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:191:26: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Iostate'
  191 |   operator^(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~^~~
a.cc:7:19: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    7 | cout<<N^2-N<<M^2-M<<endl;
      |                ~~~^~~~~~
Language: C++

"use strict"

function main(input){
  const args = input.split(' ');
  const N = args[0];
  const M = args[1];

  var ans = 0;
  if(2 <= N){
    ans += N*(N-1)/2;
  }
  if(2 <= M){
    ans += M*(M-1)/2;
  }

  console.log(ans);




}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


Compiler output:
a.cc:1:1: error: expected unqualified-id before string constant
    1 | "use strict"
      | ^~~~~~~~~~~~
a.cc:23:5: error: expected constructor, destructor, or type conversion before '(' token
   23 | main(require("fs").readFileSync("/dev/stdin", "utf8"));
      |     ^
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:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>

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: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:6:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |         cout<<N*(N-1)/2+M*(M-1)/2<<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:6:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |         cout<<N*(N-1)/2+M*(M-1)/2<<endl;
      |                                    ^~~~
      |                                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  int n ,m, k = 0;
  cin >> n >> m;
  if n <= 1{

  }
  else{
      k= k + n*(n-1);
  }
  if m <= 1{

  }
  else{
      k = k + m*(m-1);
  }
  cout << k  << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected '(' before 'n'
    7 |   if n <= 1{
      |      ^
      |      (
a.cc:10:3: error: 'else' without a previous 'if'
   10 |   else{
      |   ^~~~
a.cc:13:6: error: expected '(' before 'm'
   13 |   if m <= 1{
      |      ^
      |      (
a.cc:16:3: error: 'else' without a previous 'if'
   16 |   else{
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);cout.tie(NULL);
  ll n,n;
  cin>>n>>m;
  cout<< n*n - n + m*m - m ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: redeclaration of 'll n'
    7 |   ll n,n;
      |        ^
a.cc:7:6: note: 'll n' previously declared here
    7 |   ll n,n;
      |      ^
a.cc:8:11: error: 'm' was not declared in this scope
    8 |   cin>>n>>m;
      |           ^
Language: C++

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


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

    cout << (N(N-1)+M(M-1))/2 << endl;

}




Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'N' cannot be used as a function
    9 |     cout << (N(N-1)+M(M-1))/2 << endl;
      |              ~^~~~~
a.cc:9:22: error: 'M' cannot be used as a function
    9 |     cout << (N(N-1)+M(M-1))/2 << endl;
      |                     ~^~~~~