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

import java.util.Scanner;

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

		int n = Integer.parseInt(sc.next());
		Long sum = 0;

		for (int i = 1; i < n; i++) {
			sum += i;
		}

		System.out.println(sum);
	}
}

Compiler output:
Main.java:8: error: incompatible types: int cannot be converted to Long
		Long sum = 0;
		           ^
1 error
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'n' was not declared in this scope
    8 |     answer = n * (n-1) / 2
      |              ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:41: error: expected primary-expression before 'long'
    8 |     answer = ((long long int)N-1)*(1 + (long long int))N-1)/2;
      |                                         ^~~~
a.cc:8:41: error: expected ')' before 'long'
    8 |     answer = ((long long int)N-1)*(1 + (long long int))N-1)/2;
      |                                        ~^~~~
      |                                         )
a.cc:8:62: error: expected ')' before ';' token
    8 |     answer = ((long long int)N-1)*(1 + (long long int))N-1)/2;
      |                                   ~                          ^
      |                                                              )
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected '}' at end of input
    8 |     return 0;
      |              ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: Java

import java.util.Scanner;

public class Main {
	public static int ceil(int a, int b){
		int x = (a + (b - 1))/b;
		return x;
	}

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long N = sc.nextInt();
		long ans;
		ans = N*(N-1)/2;
		// 出力
		System.out.println(ans);
	

Compiler output:
Main.java:15: error: reached end of file while parsing
		System.out.println(ans);
		                        ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long main() {
  long long n;
  long long remainder = 0;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    remainder += i % n;
  }
  cout << remainder;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

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

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

#include <bits/stdc+=.h>
using namespace std;
int main()
{
	int a;
	long long pro=(a*(a-1))/2;
	cout<<pro<<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>
using namespace std;
int main () {
  long long a;
  cin>>a;
  cout<<n*(n-1)/2;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'n' was not declared in this scope
    6 |   cout<<n*(n-1)/2;
      |         ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'n' was not declared in this scope
    6 |   cout<<n*(n-1)/2;
      |         ^
Language: C

#include<stdio.h>

int main(void){
  int n;
  scanf("%d", &n);
  
  printf("%d\n", n*(N-1)/2);
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define INF INT_MAX
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a * b / gcd(a, b);};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){std::fill( (T*)array, (T*)(array+N), val );};
template<class T>inline bool chmax(T& a,T b){if(a < b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a > b){a=b;return true;}return false;};



int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  
  ll n;
  cin >> n;
  int res = n * (n - 1) / 2 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:29: error: invalid operands of types 'll' {aka 'long long int'} and '<unresolved overloaded function type>' to binary 'operator<<'
   30 |   int res = n * (n - 1) / 2 << endl;
      |             ~~~~~~~~~~~~~~~~^~~~~~~
Language: C++

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

int main(){
  int N;
  longlong ans=0;
  cin>>N;
 
  ans=(N-1)*N/2;
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'longlong' was not declared in this scope
    7 |   longlong ans=0;
      |   ^~~~~~~~
a.cc:10:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |   ans=(N-1)*N/2;
      |   ^~~
      |   abs
Language: C++

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

int main(){
  int N;
  int ans=0;
  cin>>N;
 
  ans=(N-1)*N/2
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected ';' before 'cout'
   10 |   ans=(N-1)*N/2
      |                ^
      |                ;
   11 |   cout<<ans;
      |   ~~~~
Language: C++

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

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

Compiler output:
a.cc:2:17: error: 'srd' is not a namespace-name
    2 | using namespace srd;
      |                 ^~~
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;
      |   ^~~
      |   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:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << n*(n-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++


using namespace std;

int main( ) {
    long long N;
    cin >> N;
    long long ans;
    if ( N%2 == 0 ){
        ans = ( N / 2 ) * ( N - 1 );
    } else {
        ans = N * ( ( N - 1 ) / 2 );
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     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 | 
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout << ans << endl;
      |     ^~~~
a.cc:13:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:20: error: 'endl' was not declared in this scope
   13 |     cout << ans << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 |
Language: C++

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

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

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
using namespace std;



int main(void){
    int n;
    cin>>n;
    ans=n*(n-1)/2;
    cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |     ans=n*(n-1)/2;
      |     ^~~
      |     abs
Language: C++

#include<bits/stdc++.h>

int main(){
    scanf("%lld",&N);
    ll ans=0;
    for (ll i = 1; i < N;i++)
    {
        ans += i;
    }
    printf("%lld", ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:19: error: 'N' was not declared in this scope
    4 |     scanf("%lld",&N);
      |                   ^
a.cc:5:5: error: 'll' was not declared in this scope
    5 |     ll ans=0;
      |     ^~
a.cc:6:12: error: expected ';' before 'i'
    6 |     for (ll i = 1; i < N;i++)
      |            ^~
      |            ;
a.cc:6:20: error: 'i' was not declared in this scope
    6 |     for (ll i = 1; i < N;i++)
      |                    ^
a.cc:8:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |         ans += i;
      |         ^~~
      |         abs
a.cc:10:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     printf("%lld", ans);
      |                    ^~~
      |                    abs
Language: C++

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

int main(void){
    ll n;
    cin >> n;
    ll ans = n(n-1)/2;
    cout << ans << endl;

    return 0;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:5:3: note: in expansion of macro 'll'
    5 |   ll n;
      |   ^~
a.cc:5:6: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   ll n;
      |      ^
      |      yn
Language: C++

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

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

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

#include <bits/stdc++.h>
#include <math.h>
#include <cmath>
 
using namespace std;
using std::cout;
using ll =long long;
bool is_int_lround(double x){
  return std::lround(x)==x;
}
int ketasuu(int x){
  int n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}
ll gcd11(ll x, ll y){
  long long a= max(x,y), b=min(x,y), c=a%b;
  while( c!=0){
    a =b;
    b =c;
    c = a%b;
  }
  return b;
}

int ab(int x, int y){
  if(x>=y){
    return x-y;
  }
  else if(y>x){
    return y-x;
  }
}
int main(){
  int n;
  cin>> n;
  int ans =0;
  for(int i=0;i <n){
    ans += i;
  }
  cout <<ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:19: error: expected ';' before ')' token
   41 |   for(int i=0;i <n){
      |                   ^
      |                   ;
a.cc: In function 'int ab(int, int)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: C++

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

int main(){
  ll n;
  cin >> n;
  ll sum = 0;
  rep(i,n){
    sum += i;
  }

  cout << sum << endl;

  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll n;
      |   ^~
a.cc:8:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |   cin >> n;
      |          ^
      |          yn
a.cc:9:5: error: expected ';' before 'sum'
    9 |   ll sum = 0;
      |     ^~~~
      |     ;
a.cc:11:5: error: 'sum' was not declared in this scope
   11 |     sum += i;
      |     ^~~
a.cc:14:11: error: 'sum' was not declared in this scope
   14 |   cout << sum << endl;
      |           ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int 64_t ans=0;
  for(int i=1;i<n;i++){
    ans+=i;
  }
  cout<<ans<<endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: expected unqualified-id before numeric constant
    6 |   int 64_t ans=0;
      |       ^~~~
a.cc:8:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |     ans+=i;
      |     ^~~
      |     abs
a.cc:10:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;

int main() {
  //input
  int N;
  cin >> N;
  
  //main
  
  
  //output
  int ans = (1+N-1)*(N-1)/2;
  cout << ans << endl;
  }
}

Compiler output:
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

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

int main(){
    long long N;
    cin >> N;
    cout << N * (N - 1) / 2 << endl;
  
  return 0
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: expected ';' before '}' token
   11 |   return 0
      |           ^
      |           ;
   12 | }
      | ~
Language: C++


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

int main()
{
     ll int N;
    cin >> N;
    
    ll int max = N*(N-1);
    cout << max/2 <<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: two or more data types in declaration of 'N'
    8 |      ll int N;
      |      ^~
a.cc:9:12: error: 'N' was not declared in this scope
    9 |     cin >> N;
      |            ^
a.cc:11:5: error: two or more data types in declaration of 'max'
   11 |     ll int max = N*(N-1);
      |     ^~
a.cc:12:16: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator/'
   12 |     cout << max/2 <<endl;
      |             ~~~^~
Language: C++


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

int main()
{
    ll N;
    cin >> N;
    cout << N(N-1)/2 <<endl;
    
}


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

#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define MM 1000000007
using namespace std;

int main()
{
	ll n;
	cin>>n;5
	
	cout<<((n)*(n-1))/2LL;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expected ';' before 'cout'
   10 |         cin>>n;5
      |                 ^
      |                 ;
   11 | 
   12 |         cout<<((n)*(n-1))/2LL;
      |         ~~~~
Language: C++

#include<iostream>

int main ()
{
	int n;
	cin >> n;
	cout<< ((n+1)/3);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >> n;
      |         ^~~
      |         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:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |         cout<< ((n+1)/3);
      |         ^~~~
      |         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<stdio.h>
int main(){
int n;
cin >>n;
cout << n*(n-1)/2;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'cin' was not declared in this scope
    4 | cin >>n;
      | ^~~
a.cc:5:1: error: 'cout' was not declared in this scope
    5 | cout << n*(n-1)/2;
      | ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
typedef long long ll;
using namespace std;

int main(){
  ll N;
  cin >> N;
  cout <<  N * (N-1) * 0.5LL<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: unable to find numeric literal operator 'operator""LL'
   13 |   cout <<  N * (N-1) * 0.5LL<< endl;
      |                        ^~~~~
Language: C++

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

int main()
{
	int n;
	cin >> n;
  	long long ans = n*(n-1)/2
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected ',' or ';' before 'cout'
   11 |         cout << ans << endl;
      |         ^~~~
Language: C++

#include "SaveFuncs.cpp"

/*****/

#include <iostream>
#include <array>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <iomanip>	//cout << fixed << setprecision(桁数);
#include <stdexcept>

using namespace std;
using ll = long long;

#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; i++)
#define rep1(i, n) for(int i=1, i##_len=(n); i<i##_len; i++)
#define rrep(i, n) for(int i=(n)-1; i >= 0; i--)
#define rrep1(i, n) for(int i=(n); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define pair(a, b) make_pair(a, b);
//#define int long long
constexpr int INF = 2000000100;
constexpr ll DIV = 1000000007;	// 10e9+7
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> T divUp(T a, T b) { if (a % b == 0) { return a / b; } return a / b + 1; }
std::string strMulti(std::string t, int n) { std::string out = ""; for (int i = 0; i < n; i++) { out += t; } return out; }
template<class T> T math_P(T m, T n) { T ret = 1; for (T i = m; i > m - n; i--) { ret *= i; } return ret; }
template<class T> T math_C(T m, T n) { T ret = mathP(m, n); for (T i = 2; i <= n; i++) { ret /= i; } return ret; }
template<class T> bool compare_by_b(pair<T, T> a, pair<T, T> b) { if (a.second != b.second) { return a.second < b.second; } return a.first < b.first; }
template<class T> T math_gcd(T a, T b) { a = abs(a); b = abs(b); if (a < b) { std::swap(a, b); } T tmp; while (b != 0) { tmp = b; b = a % b; a = tmp; } return a; }
template<class T> T math_lcm(T a, T b) { a = abs(a); b = abs(b); if (a > b) { std::swap(a, b); } if (a == 1) { return b; } T i = a; while (i % b != 0) { i += a; } return i; }

/*****/

int Main()
{
	int N;
	cin >> N;

	int ret = 0;
	ret = N * (N - 1) / 2;

	cout << ret;

	return 0;
}

/*****/

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);

	//std::cout << std::fixed << std::setprecision(10);

	Main();

	return 0;
}


Compiler output:
a.cc:1:10: fatal error: SaveFuncs.cpp: No such file or directory
    1 | #include "SaveFuncs.cpp"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
     
    public class Main {
     
    	public static void main(String[] args) throws IOException, Exception{
    		BufferedReader st = new BufferedReader(new InputStreamReader(System.in));
    		int n = getInt(st);
    		long t = n*(n-1)/2;
    		System.out.println(t)
    	}
     
    	private static int getInt(BufferedReader st) throws Exception, IOException {
    		int num = Integer.parseInt(st.readLine());
    		return num;
    	}
    }

Compiler output:
Main.java:11: error: ';' expected
    		System.out.println(t)
    		                     ^
1 error
Language: Java

    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
     
    public class Main {
     
    	public static void main(String[] args) throws IOException, Exception{
    		BufferedReader st = new BufferedReader(new InputStreamReader(System.in));
    		int n = getInt(st);
    		long t = 0;
    		for (int i = 1;i<n;i++) {
    			t+=i;
    		}
    		anser(t);
    	}
     
    	private static int getInt(BufferedReader st) throws Exception, IOException {
    		int num = Integer.parseInt(st.readLine());
    		return num;
    	}
     
    	private static void anser(int num) {
    		System.out.println(num);
    	}
    }

Compiler output:
Main.java:14: error: incompatible types: possible lossy conversion from long to int
    		anser(t);
    		      ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N;
      |          ^
Language: C++

#include<stdio.h>
int main()https://atcoder.jp/contests/abc139/submissions/me
{
	long long int N;
	long long int k;
	long long int r = 0;
	
	scanf("%ld", &N);
	
	for(k=0; k<N; k++)
	{
		r = r + k;
	}
	
	printf("%ld", r);
}

Compiler output:
a.cc:2:11: error: expected initializer before 'https'
    2 | int main()https://atcoder.jp/contests/abc139/submissions/me
      |           ^~~~~
Language: C++

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

int main() {
  int_64 N;
  cin >> N;
  int_64 answer;
  answer = N*(N-1)/2;
  cout << answer << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'int_64' was not declared in this scope; did you mean 'rintf64'?
    5 |   int_64 N;
      |   ^~~~~~
      |   rintf64
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N;
      |          ^
a.cc:7:9: error: expected ';' before 'answer'
    7 |   int_64 answer;
      |         ^~~~~~~
      |         ;
a.cc:8:3: error: 'answer' was not declared in this scope
    8 |   answer = N*(N-1)/2;
      |   ^~~~~~
Language: C++

#include <iostream>
#include <math.h>

using namespace std;
int main(){
    int i,count=0;
    long long N

    cin >> N;
    
    for(i=1;i<N;i++){
        count += i;
    }
    cout << count << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected initializer before 'cin'
    9 |     cin >> N;
      |     ^~~
a.cc:11:15: error: 'N' was not declared in this scope
   11 |     for(i=1;i<N;i++){
      |               ^
Language: C++

#include <iostream>
#include <math.h>

using namespace std;
int main(){
    int i,count=0,N,H,b_H=0,max=0;

    cin >> N;
    
    for(i=1;i<N;i++){
        count += i
    }
    cout << count << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before '}' token
   11 |         count += i
      |                   ^
      |                   ;
   12 |     }
      |     ~
Language: C++

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: 'a' was not declared in this scope
    4 |         cin>>a;
      |              ^
Language: Java

import java.util.*;
import java.lang.Math; 

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

Compiler output:
Main.java:10: error: incompatible types: possible lossy conversion from long to int
		int m = n*(n-1)/2;
		               ^
1 error
Language: Java

import java.util.Scanner;

public class work {

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

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

#include <iostream>

int main(){
	int N
	long int ans=0;
	std::cin >> N;
	ans = N*(N-1)/2;
	std::cout << ans << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected initializer before 'long'
    5 |         long int ans=0;
      |         ^~~~
a.cc:6:21: error: 'N' was not declared in this scope
    6 |         std::cin >> N;
      |                     ^
a.cc:7:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |         ans = N*(N-1)/2;
      |         ^~~
      |         abs
Language: C++


using namespace std;

int main(void){
  long N;
  cin >> N;
  
  long M;
  M= N*(N-1)/2;
  
  cout << M << endl;
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   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 | 
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout << M << endl;
      |   ^~~~
a.cc:11:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:16: error: 'endl' was not declared in this scope
   11 |   cout << M << endl;
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 |
Language: C++

#include<iostream>
int main()
{
 	long long n;
  cin>>n;
  long long ans = n*(n-1)/2;
  cout<<ans;
}

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;
      |   ^~~
      |   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<<ans;
      |   ^~~~
      |   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>
typedef ll long long
using namespace std;

int main(){
    ll N;  cin >> N;
    cout << N*(N-1)/2 << endl;
}

Compiler output:
a.cc:2:9: error: 'll' does not name a type
    2 | typedef ll long long
      |         ^~
a.cc: In function 'int main()':
a.cc:6:5: error: 'll' was not declared in this scope
    6 |     ll N;  cin >> N;
      |     ^~
a.cc:6:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     ll N;  cin >> N;
      |            ^~~
      |            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:6:19: error: 'N' was not declared in this scope
    6 |     ll N;  cin >> N;
      |                   ^
a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |     cout << N*(N-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:7:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |     cout << N*(N-1)/2 << endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <locale>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>

const long long int INF = 1e9;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define Rep(i, n) for(int i = 1; i <= (int)(n); i++)
#define llrep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define llRep(i, n) for(ll i = 1; i <= (ll)(n); i++)

using namespace std;

struct Point{
	int x,y;
};

bool vector_finder(std::vector<ll> vec, ll number) {
    auto itr = std::find(vec.begin(), vec.end(), number);
    size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return true;
    }
  else { // 発見できなかったとき
    return false;
    }
}

ll factorial(ll N){
    ll ans = 1;
    llRep(i,N){
        ans *= i;
    }
    return ans;
}

ll extended_factorial(ll N){
    ll ans = 1;
    llRep(i,N){
        ans *= i;
        ans %= (ll)(1e9+7);
    }
    return ans;
}

vector<ll> Eratosthenes(ll N){
    bool arr[N+1];
    //initialization
    arr[0] = false;
    arr[1] = false;
	for(ll i = 2; i < N+1; i++){
		arr[i] = true;
	}
    //eratosthenes
	for(ll i = 2; i <= sqrt(N); i++){
		if(arr[i]){
			for(ll j = 0; i * (j + 2) <= N; j++){
				arr[i *(j + 2)] = false;//not prime number
			}
		}
	}
    vector<ll> prime;
    llRep(i,N){
        if (arr[i]==true){
            prime.push_back(i);
        }
    }
    return prime;
}

ll gcd(ll a, ll b){
  ll temp;
	while (a % b != 0){
		temp = b;
		b = a % b;
		a = temp;
	}
	return b;
}

ll lcm(ll a, ll b){
  return a * b / gcd(a,b);
}

char alphabet[] = {
    'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'
};


int main(){
    ll N,
    cin >> N;
    if (N==1){
        cout << 0 << endl;
        return 0;
    }
    cout << N*(N-1) /2<< endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:102:9: error: expected initializer before '>>' token
  102 |     cin >> N;
      |         ^~
Language: C++

#include <iostream>
using namespace std;
int main()
{
  cin>>x;
  cour<< (x*x-1)/2;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: 'x' was not declared in this scope
    5 |   cin>>x;
      |        ^
a.cc:6:3: error: 'cour' was not declared in this scope
    6 |   cour<< (x*x-1)/2;
      |   ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll n;
      |   ^~
a.cc:6:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   cin>>n;
      |        ^
      |        yn
Language: Java

import java.util.*;

public static void Main(){
	Scanner sc = new Scanner(System.in);
  	int n = sc.nextInt();
  	long ans = 0;
  	for(int i = 1 ; i < n ; i++){
      ans += i;
    }
  	System.out.println(ans);
}

Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public static void Main(){
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

#include<iostream>
using namespace std;
int main()
{
  long long double n,x;
  x=(n*(n-1))/2;
  cout<<x<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: 'long long' specified with 'double'
    5 |   long long double n,x;
      |        ^~~~
a.cc:5:8: error: 'long long' specified with 'double'
Language: C++

#include<bits/stdc++.h>
using namespace std ;
int main()
{
  long long num=0 ;
  cin>>num ;
  long long ans=0 ;
   for(i=1;i<num;i++)
   {
     ans+=i ;
   }
  cout<<ans ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
    8 |    for(i=1;i<num;i++)
      |        ^
Language: Java

import java.util.Scanner;

public class D {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = Long.parseLong(sc.next());
        long ret = (n * (n - 1)) / 2;
        System.out.println(ret);
    }
}


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

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

public class Main{
  	public static void main(String[] args) /*throws IOException*/{
      	Scanner scan=new Scanner();
      	int N=scan.nextInt();
      	long ans=(long)N*(N-1);
      	ans>>=1;
      	System.out.println(ans);
    }
}

Compiler output:
Main.java:6: error: no suitable constructor found for Scanner(no arguments)
      	Scanner scan=new Scanner();
      	             ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
1 error
Language: C++

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

int main(){
  ll N;
  cin >> N;
  ll ans = N*(N-1)/2;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:4:9: error: 'Long' does not name a type; did you mean 'long'?
    4 | typedef Long Long ll;
      |         ^~~~
      |         long
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll N;
      |   ^~
a.cc:8:10: error: 'N' was not declared in this scope
    8 |   cin >> N;
      |          ^
a.cc:9:5: error: expected ';' before 'ans'
    9 |   ll ans = N*(N-1)/2;
      |     ^~~~
      |     ;
a.cc:10:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: Java

import java.util*;

public class Main {
	public static void main(String args[]) {
      Scanner scan = new Scanner(System.in);
      int num = scan.nextInt();
      int maxSum=0;
      for(int i=0; i<num; i++){
        maxSum+=scan.nextInt();
      }
      maxSum=maxSum-1;
      System.out.println(maxSum);
    }
}

Compiler output:
Main.java:1: error: ';' expected
import java.util*;
                ^
1 error
Language: C++

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

int main(){
    int N;
    cin >> N;
    else{
    cout << ((N - 1) * N)/ 2 << endl;
    }
}

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

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

    return 0;

}


Compiler output:
a.cc:2:18: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long;
      |                  ^~~~
a.cc:4:1: note: in expansion of macro 'int'
    4 | int main(){
      | ^~~
a.cc:4:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | int main(){
      |     ^~~~
a.cc: In function 'int main()':
a.cc:2:18: error: declaration does not declare anything [-fpermissive]
    2 | #define int long long;
      |                  ^~~~
a.cc:5:5: note: in expansion of macro 'int'
    5 |     int n; cin >> n;
      |     ^~~
a.cc:5:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |     int n; cin >> n;
      |         ^
      |         yn
Language: C

#include <stdio.h>
#include <conio.h>

void main()
{
  int n;
  float ans;
  scanf("%d",n);
  printf("%f",((n-1)*n)/2);
}

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

#include <studio.h>
#include <conio.h>

void main()
{
  int n;
  float ans;
  scanf("%d",n);
  printf("%f",((n-1)*n)/2);
}

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

#include <iostream>
using namesoace std;
int main(){
    long long n;
    cin >> n;
    cout << n*(n-1)/2 << endl;
}

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

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

public class D {

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null; }
        String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try { tokenizer = new StringTokenizer(reader.readLine()); } 
                catch (IOException e) { throw new RuntimeException(e);} }
            return tokenizer.nextToken(); }
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
    }

    static InputReader r = new InputReader(System.in);
    static PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        
        long n = r.nextLong();

        pw.println(n * (n-1) / 2);

        pw.close();
    }
}

/**
                _        _                 _                                                
               | |      | |               | |                                               
   ___ ___   __| | ___  | |__  _   _    __| | __ _ _ __ _ __ ___ _ __     _   _  __ _  ___  
  / __/ _ \ / _` |/ _ \ | '_ \| | | |  / _` |/ _` | '__| '__/ _ \ '_ \   | | | |/ _` |/ _ \ 
 | (_| (_) | (_| |  __/ | |_) | |_| | | (_| | (_| | |  | | |  __/ | | |  | |_| | (_| | (_) |
  \___\___/ \__,_|\___| |_.__/ \__, |  \__,_|\__,_|_|  |_|  \___|_| |_|   \__, |\__,_|\___/ 
                                __/ |                               ______ __/ |            
                               |___/                               |______|___/             
 */

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

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

public class Main {

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null; }
        String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try { tokenizer = new StringTokenizer(reader.readLine()); } 
                catch (IOException e) { throw new RuntimeException(e);} }
            return tokenizer.nextToken(); }
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
    }

    static InputReader r = new InputReader(System.in);
    static PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        
        long n = r.nextLong();

        pw.println(n * (n-1)) / 2;

        pw.close();
    }
}

/**
                _        _                 _                                                
               | |      | |               | |                                               
   ___ ___   __| | ___  | |__  _   _    __| | __ _ _ __ _ __ ___ _ __     _   _  __ _  ___  
  / __/ _ \ / _` |/ _ \ | '_ \| | | |  / _` |/ _` | '__| '__/ _ \ '_ \   | | | |/ _` |/ _ \ 
 | (_| (_) | (_| |  __/ | |_) | |_| | | (_| | (_| | |  | | |  __/ | | |  | |_| | (_| | (_) |
  \___\___/ \__,_|\___| |_.__/ \__, |  \__,_|\__,_|_|  |_|  \___|_| |_|   \__, |\__,_|\___/ 
                                __/ |                               ______ __/ |            
                               |___/                               |______|___/             
 */

Compiler output:
Main.java:29: error: not a statement
        pw.println(n * (n-1)) / 2;
                              ^
1 error
Language: Java

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

public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		
		out.close();
	}
	
	static class TaskC
	{
		void solve(int TestCase, InputReader in, PrintWriter out)
		{
			long n = in.nextLong();
			n--;
			
			out.println(n * (n + 1) / 2);
		}
	}
	
	static class InputReader
	{
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		
		public InputReader(InputStream stream)
		{
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}
		
		public String next()
		{
			while(tokenizer == null || !tokenizer.hasMoreTokens())
			{
				try
				{
					tokenizer = new StringTokenizer(reader.readLine());
				}
				catch(IOException e)
				{
					throw new RuntimeException(e);
				}
			}
			
			return tokenizer.nextToken();
		}
		
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
		
		public long nextLong()
		{
			Long.parseLong(next());
		}
	}
}

Compiler output:
Main.java:66: error: missing return statement
		}
		^
1 error
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll N;
      |   ^~
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N;
      |          ^
a.cc:7:5: error: expected ';' before 'ans'
    7 |   ll ans=N*(N-1)/2;
      |     ^~~~
      |     ;
a.cc:8:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:13:18: error: expected ';' before 'printf'
   13 |   ans = N*(N-1)/2
      |                  ^
      |                  ;
   14 |   printf("%d\n",ans);
      |   ~~~~~~