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

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

#define BUF_SIZE 15

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

int main(void) {
    int n = get_int();
    uint64_t sum = (uint64_t)(n-1) * n / 2;
    printf("%llu\n", sum);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:5: error: unknown type name 'uint64_t'
   21 |     uint64_t sum = (uint64_t)(n-1) * n / 2;
      |     ^~~~~~~~
main.c:4:1: note: 'uint64_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
    3 | #include <stdlib.h>
  +++ |+#include <stdint.h>
    4 | 
main.c:21:21: error: 'uint64_t' undeclared (first use in this function)
   21 |     uint64_t sum = (uint64_t)(n-1) * n / 2;
      |                     ^~~~~~~~
main.c:21:21: note: 'uint64_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
main.c:21:21: 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 n ;
 cin >>n ;
 cout  << n(n-1)/2 <<endl;



}


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

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextInt();
        long sum = 0;
        sum = n/2*(n-1);
        System.out.print(sum);
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
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++

import java.util.*;

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

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
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
  cin>>N;
  cout<<N*(N-1)/2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin>>N;
      |   ^~~
a.cc:7:9: error: 'N' was not declared in this scope
    7 |   cout<<N*(N-1)/2<<endl;
      |         ^
Language: C++

int main(void) {
  int N;
  cin >> N;
  vector<int> a(N);
  deque<int> b;
  rrep(i,N){  
      a[i-1]=i;
      b.push_back(i);
  }
  int f = b.front();
  b.pop_front();
  b.push_back(f);
 
  ll ans=0;
  rep(i,N){
      ans += a[i]%b[i];
    //   cout << a[i] << " " << b[i] << endl;
  }

  fin(ans);
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> N;
      |   ^~~
a.cc:4:3: error: 'vector' was not declared in this scope
    4 |   vector<int> a(N);
      |   ^~~~~~
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   vector<int> a(N);
      |          ^~~
a.cc:5:3: error: 'deque' was not declared in this scope
    5 |   deque<int> b;
      |   ^~~~~
a.cc:5:9: error: expected primary-expression before 'int'
    5 |   deque<int> b;
      |         ^~~
a.cc:6:8: error: 'i' was not declared in this scope
    6 |   rrep(i,N){
      |        ^
a.cc:6:3: error: 'rrep' was not declared in this scope
    6 |   rrep(i,N){
      |   ^~~~
a.cc:10:11: error: 'b' was not declared in this scope
   10 |   int f = b.front();
      |           ^
a.cc:14:3: error: 'll' was not declared in this scope
   14 |   ll ans=0;
      |   ^~
a.cc:15:3: error: 'rep' was not declared in this scope
   15 |   rep(i,N){
      |   ^~~
a.cc:20:7: error: 'ans' was not declared in this scope
   20 |   fin(ans);
      |       ^~~
a.cc:20:3: error: 'fin' was not declared in this scope
   20 |   fin(ans);
      |   ^~~
Language: C

#include<stdio.h>
#include<conio.h>
#include<math.h>
int main(){
        int n;
        long long x;
        scanf("%d",&n);
        x=(n*(n-1)/2);
        printf("%lld\n",x);

return 0;
}



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

#include<stdio.h>
#include<conio.h>
#include<math.h>
int main(){
        int n;
        long long x;
        scanf("%d",&n);
        x=(n*(n-1)/2);
        printf("%lld",x);

return 0;
}


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

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

void solve(long long n) {
  long long ans = (n-1) * n / 2;
  return ans;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
  long long N;
  scanf("%lld", &N);
  solve(N);
  return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int)':
a.cc:6:10: error: return-statement with a value, in function returning 'void' [-fpermissive]
    6 |   return ans;
      |          ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bitset>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef long long LL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<string, int> PSI;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define SORTG(c) sort((c).begin(),(c).end(),greater<auto>())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define REP(i,n)  for(int i=0; i<(n); i++)

//constant
//--------------------------------------------
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
const LL MOD = 1e9+7; 
int main(){
   int n;
   cin >> n;
   cout << n(n-1)/2 << endl;
}

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


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

int main() {
	int n;
  	cin >> n;
	int Ans = 0;
  	
  	if (n != 1){
    	for(int i = 0; i<n; i++){
        Ans += i;
        }
    }
  
  cout << Ans << endl;
}

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

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


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
    6 |   cin>>N;
      |        ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i,l,r) for(size_t i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long

using namespace std;

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


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

#include <bits/stdc++.h>
#define FOR(i,l,r) for(size_t i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long

using namespace std;

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


Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:9:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |   cin >> n;
      |          ^
      |          yn
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 <bits/stdc++.h>
using namespace std;



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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: no match for 'operator/=' (operand types are 'std::basic_ostream<char>' and 'int')
   10 |   cout << n/=2;
      |   ~~~~~~~~~^~~
Language: C++

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



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


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

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



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


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

/*
 * 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.
 */
package main;

import java.util.Scanner;

/**
 *
 * @author Nour
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
Scanner in=new Scanner(System.in);
int x=in.nextInt();
int i=0;

int sum=0;


while((x!=i)){

    sum=sum+i;
    i++;
}
System.out.print(sum+"\n");

}
}

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

#include <bits/stdc++.h>


using namespace std;

=

int main() {


    int n;
    cin >> n;
    long long int sum = 0;
    for (int i=1;i<n;i++) {
        sum += i;
    }
    cout << sum;

    return 0;
}

Compiler output:
a.cc:6:1: error: expected unqualified-id before '=' token
    6 | =
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T,class U> using P = pair<T,U>;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;

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

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

#include <bits/stdc++.h>
#define pi 3.14159
using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;
const int N = 2e7 + 9, M = 1e7, OO = 0x3f3f3f3f;
int main(){
  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:8:11: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    8 |   int main(){
      |           ^~
a.cc:8:11: note: remove parentheses to default-initialize a variable
    8 |   int main(){
      |           ^~
      |           --
a.cc:8:11: note: or replace parentheses with braces to value-initialize a variable
a.cc:8:13: error: a function-definition is not allowed here before '{' token
    8 |   int main(){
      |             ^
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        System.out.println(sum(t));
    }

    public static int sum(int number){
        int result = 0;
        for(int i = number - 1; i >=0; i--){
            result += i;
        }
        return result;
    }

Compiler output:
Main.java:16: error: reached end of file while parsing
    }
     ^
1 error
Language: Java

import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		long n = stdIn.nextLong();
		
		long[] order = new long[n];
		
		for(int i = 0; i < n; i++) {
			order[i] = i+1;
		}
		
		long [] Order = new long[n];
		for(int i = 0; i < n; i++) {
			if(i==n-1) {
				Order[i] = 1;
			}else {
				
				Order[i] = i+2;
			}
		}
		
		long max = 0;
		
		for(int i = 0; i < n; i++) {
			max += order[i] % Order[i];
		}
		System.out.println(max);
	}

}


Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from long to int
		long[] order = new long[n];
		                        ^
Main.java:15: error: incompatible types: possible lossy conversion from long to int
		long [] Order = new long[n];
		                         ^
2 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: expected primary-expression before 'long'
    6 |     cout << long int(((N - 1) * N) / 2) << endl;
      |             ^~~~
Language: C++

#include<iostream> int main(){ long n; std::cin >> n; std::cout << n * (n - 1) / 2; return 0;}

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include<iostream> int main(){ long n; std::cin >> n; std::cout << n * (n - 1) / 2; return 0;}
      |                    ^~~
/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++

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

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

#include<iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: 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:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |       cout<<(n-1)*n/2;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |         cout<<0;
      |         ^~~~
      |         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;


int main() {
	int n;
	cin >> n;
	long long ans=0;
	for(int i=0; i<n; i++)
		ans += i;
	}
	cout << ans << endl;
}


Compiler output:
a.cc:12:9: error: 'cout' does not name a type
   12 |         cout << ans << endl;
      |         ^~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C++

#include <vector>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i=0;i<n;i++)
#define REPS(i,n,s) for(int i=s;i<n;i++)
#define SORT(c) sort((c).begin(),(c).end())
#define ALL(a) (a).begin(),(a).end()

void solve() {
  int n;
  cin >> n;
  if(n == 1) {
    cout << 0 << endl;
    return 0;
  }

  int ans = 0;
  REP(i, n - 2) {
    ans += i + 2;
  }
  cout << ans + 1 << endl;
}

int main() {
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:24:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   24 |     return 0;
      |            ^
Language: C++

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

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

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

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

#inlcude<bits/stdc++.h>
using namespace std;
int main()
{long long mod=1000000000+1;
int n;
  cin>>n;
  cout<<((((n-1)%mod)*(n%mod))/2)%mod;



return 0;}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int 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 | #inlcude<bits/stdc++.h>
a.cc:7:3: error: 'cout' was not declared in this scope
    7 |   cout<<((((n-1)%mod)*(n%mod))/2)%mod;
      |   ^~~~
a.cc:7:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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



return 0;}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int 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 | #inlcude<bits/stdc++.h>
a.cc:7:3: error: 'cout' was not declared in this scope
    7 |   cout<<((n-1)*(n))/2;
      |   ^~~~
a.cc:7:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>

using namespace std
int main(){
  long n; cin >> n;
  n--;
  cout << n * (n + 1) / 2 << endl;
  
 return 0; 
}

Compiler output:
a.cc:3:20: error: expected ';' before 'int'
    3 | using namespace std
      |                    ^
      |                    ;
    4 | int main(){
      | ~~~
Language: C++

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespcase'
    2 | using namespcase std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:2: 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:3: 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:20: 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: C++

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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e6 + 5;

int n, a[maxn];

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);

  cin>>n;
  for (int i=0; i<n; i++) {
    cin>>a[i];
  }
  int ans = 0;
  int dp = 0;
  for (int i=n-2; i>=0; i--) {
    if (a[i] >= a[i+1]) {
      dp++;
    } else {
      dp = 0;
    }
    ans = max(dp, ans);
  }

  cout<<ans<<endl;
  

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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e6 + 5;

int n, a[maxn];

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);

  ll x; cin>>x;
  x--;
  ll ans = x * (x + 1) / 2;
  cout<<ans<<endl;
  

  return 0;
}


Compiler output:
a.cc:43:6: error: redefinition of 'template<class T> void out(T)'
   43 | void out(T x) { cout << x << endl; exit(0); }
      |      ^~~
a.cc:7:6: note: 'template<class T> void out(T)' previously declared here
    7 | void out(T x) { cout << x << endl; exit(0); }
      |      ^~~
a.cc:46:11: error: redefinition of 'const int maxn'
   46 | const int maxn = 1e6 + 5;
      |           ^~~~
a.cc:10:11: note: 'const int maxn' previously defined here
   10 | const int maxn = 1e6 + 5;
      |           ^~~~
a.cc:48:5: error: redefinition of 'int n'
   48 | int n, a[maxn];
      |     ^
a.cc:12:5: note: 'int n' previously declared here
   12 | int n, a[maxn];
      |     ^
a.cc:48:8: error: redefinition of 'int a [1000005]'
   48 | int n, a[maxn];
      |        ^
a.cc:12:8: note: 'int a [1000005]' previously declared here
   12 | int n, a[maxn];
      |        ^
a.cc:50:5: error: redefinition of 'int main()'
   50 | int main() {
      |     ^~~~
a.cc:14:5: note: 'int main()' previously defined here
   14 | int main() {
      |     ^~~~
Language: C++

#include <iostream>
#include <algorithm>

#define BR "\n"
#define REP(i,n) for(int i=0;i<n;i++)

using namespace std;
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int n;
	long r = 0;
	cin >> n;
	for(int i = 0; i < n; i++) {
		r += i;
	}
	cout << r << endl;
}

/*

Compiler output:
a.cc:20:1: error: unterminated comment
   20 | /*
      | ^
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:6:5: error: 'll' was not declared in this scope
    6 |     ll N;
      |     ^~
a.cc:7:12: error: 'N' was not declared in this scope
    7 |     cin >> N;
      |            ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: expected ';' before 'cout'
    6 |         cin>>n;1
      |                 ^
      |                 ;
    7 |         cout<<n*(n-1)/2<<endl;
      |         ~~~~
Language: Java

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

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

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main()
{
    int n;
    cin >> n;
    int ans = n*(n-1)/2;
    cout << ans << endl;
    return 0;
}#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
int main()
{
    int n;
    cin >> n;
    int ans = n*(n-1)/2;
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc:15:2: error: stray '#' in program
   15 | }#include<iostream>
      |  ^
a.cc:15:3: error: 'include' does not name a type
   15 | }#include<iostream>
      |   ^~~~~~~
a.cc:22:5: error: redefinition of 'int main()'
   22 | int main()
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main()
      |     ^~~~
Language: Java

import java.util.*;
public class Main{


public static void main(String[] args){
Scanner obj=new Scanner(System.in);
  int n=obj.nextInt();
  int max=0;
  n=n-1;
  max=n*(n-1)/2;

System.out.println(max);


}

Compiler output:
Main.java:15: error: reached end of file while parsing
}
 ^
1 error
Language: C

#include<stdio.h>
int main()
{
int n,i,j,k,f=1,m=1,p,c=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{f=1;
m=1;
 for(j=1;j<=n-i;j++)
{f=f*j;}

 for(k=1;k<=n;k++)
{m=m*k;}

p=m/f;
c=c+(i%p);
}


Compiler output:
main.c: In function 'main':
main.c:17:1: error: expected declaration or statement at end of input
   17 | }
      | ^
Language: C

#include<stdio.h>
int main()
{
int n,i,j,k,f=1,m=1,p,c=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{f=1;
m=1;
 for(j=1;j<=n-i;j++)
{f=f*j;}
 for(k=1;k<=n;j++)
{m=m*k;}
p=m/f;
c=c+(i%p);
}
printf("%d",c);
retuen 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:1: error: 'retuen' undeclared (first use in this function)
   17 | retuen 0;
      | ^~~~~~
main.c:17:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:7: error: expected ';' before numeric constant
   17 | retuen 0;
      |       ^~
      |       ;
Language: C

#include<stdio.h>
void main()
{
int n,j,f=1,m=1,p,c=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{f=1;
m=1;
 for(j=1;j<=n-i;j++)
{f=f*j}
 for(j=1;j<=n;j++)
{m=m*j}
p=m/f;
c=c+(i%p);
}
printf("%d",c);
}



Compiler output:
main.c: In function 'main':
main.c:6:5: error: 'i' undeclared (first use in this function)
    6 | for(i=1;i<=n;i++)
      |     ^
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:7: error: expected ';' before '}' token
   10 | {f=f*j}
      |       ^
      |       ;
main.c:12:7: error: expected ';' before '}' token
   12 | {m=m*j}
      |       ^
      |       ;
Language: C

#include<stdio.h>
int fact(int,int);
int main()
{
int n,sum=0,c,d;
scanf("%d",&n);
c=fact(n,0);
for(i=1;i<=n;i++)
{
d=fact(n,i);
m=i%(c/d);
sum+=m;
}
return 0;
}
int fact(int x,int r)
{
int j=1,f;
while(j<=(x-r))
{
 f=f*j;
j++;
return f;
}

Compiler output:
main.c: In function 'main':
main.c:8:5: error: 'i' undeclared (first use in this function)
    8 | for(i=1;i<=n;i++)
      |     ^
main.c:8:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:1: error: 'm' undeclared (first use in this function)
   11 | m=i%(c/d);
      | ^
main.c: In function 'fact':
main.c:24:1: error: expected declaration or statement at end of input
   24 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> p;
long long n;
int main(){
	cin >> n;
	long long res = 0;
//	for (int i = 1; i < n; i++) res += 1LL*i % (i + 1);
	res = (1 + n - 1)*(n-1)/2 
	cout << res << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:34: error: expected ';' before 'cout'
   11 |         res = (1 + n - 1)*(n-1)/2
      |                                  ^
      |                                  ;
   12 |         cout << res << endl;
      |         ~~~~
Language: C++

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespcace'
    2 | using namespcace std;
      |       ^~~~~~~~~~
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 /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:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |    cout<<sum;}
      |    ^~~~
      |    std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.Scanner;

public class modSum {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int mod = 0;
		for(int i = 1;i < n;i++) {
			mod = mod + i;
		}
		System.out.print(mod);
	}
}


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

#include<iostream>

using namespace std;

int main(){
  long long N;
  long long out = 0;
  
  cin >> N;
  
  for (long long i = 1 ; i<N i++){
    out += i;
  }
  
  cout << out;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: expected ';' before 'i'
   11 |   for (long long i = 1 ; i<N i++){
      |                             ^~
      |                             ;
Language: C++

#include<stdio.h>
int main(void){
  double N;
  scanf("%lf",&N);
  double i = N%2;
  if(N == 1){
    i = 0;
  }else if(N == 2){
    i = 1;
  }else{
	switch(i){
	  case 0:
		i = N*(N-1)/2-1;
		break;
	  case 1:
		i = N*(N-1)/2;
        break;
	}
  }
  printf("%lf",i);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    5 |   double i = N%2;
      |              ~^~
      |              | |
      |              | int
      |              double
a.cc:11:16: error: switch quantity not an integer
   11 |         switch(i){
      |                ^
Language: C++

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


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 /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 << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout << ans << 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: Java

//MondSum
import java.util.*;
public class d0901{
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int a[]=new int[n];
    long total=0;
    for (int i=0;i<n;i++) {
      a[i]=i+1;
      total=total+a[i];
    }
     System.out.println(total-a[n-1]);
  }
}


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


public class Main {

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

    for(int i = n;i >= 1;i--) {
      sum += (n-i+1) % n;
    }

    System.out.println(sum);


  }

}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:3:15: error: 'n' was not declared in this scope
    3 |   scanf("%d",&n);
      |               ^
Language: C++

#include <iostream>

using namespace std;
using lint = long long;

int main(){
    lint n; cin >> n;

    lint sum = 0;

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

    cout << sum << endl;

    return 0;
}
}

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

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define swap(type ,a ,b) {type t; t=a; a=b; b=t;}
#define forN(i,n) for(i=0;i<n;i++)
#define forR(i,s,n) for(i=s;i<n;i++)
#define ll long long

ll gcb(x,y) {ll t;while((t=x%y)!=0){x=y;y=t;}return y;}
ll lcm(x,y) {return x*y/gcd(x,y)};

using namespace std;

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

Compiler output:
a.cc:10:8: error: 'x' was not declared in this scope
   10 | ll gcb(x,y) {ll t;while((t=x%y)!=0){x=y;y=t;}return y;}
      |        ^
a.cc:10:10: error: 'y' was not declared in this scope
   10 | ll gcb(x,y) {ll t;while((t=x%y)!=0){x=y;y=t;}return y;}
      |          ^
a.cc:10:11: error: expression list treated as compound expression in initializer [-fpermissive]
   10 | ll gcb(x,y) {ll t;while((t=x%y)!=0){x=y;y=t;}return y;}
      |           ^
a.cc:11:8: error: 'x' was not declared in this scope
   11 | ll lcm(x,y) {return x*y/gcd(x,y)};
      |        ^
a.cc:11:10: error: 'y' was not declared in this scope
   11 | ll lcm(x,y) {return x*y/gcd(x,y)};
      |          ^
a.cc:11:11: error: expression list treated as compound expression in initializer [-fpermissive]
   11 | ll lcm(x,y) {return x*y/gcd(x,y)};
      |           ^
a.cc: In function 'int main()':
a.cc:18:14: error: 'n' cannot be used as a function
   18 |     cout << n(n-1)/2 << endl;
      |             ~^~~~~
Language: Java

import java.util.*;
class Main{ 
public static void main(String[] args) {
        Scanner scn =new Scanner(System.in);
        int N=scn.nextInt();
        int[] pi=new int[N];
        for (int i = 0; i <N; i++) {
            pi[i]=i;
        }
        int sum=0;
        for(int j=0;j<N-1;j++){
            sum+=j/pi[j+1];
        }
        system.out.println(sum);
    }
}


Compiler output:
Main.java:14: error: package system does not exist
        system.out.println(sum);
              ^
1 error
Language: Java

ソースコード 

Copy
Copy
import java.util.*;
class Main{ 
public static void main(String[] args) {
        Scanner scn =new Scanner(System.in);
        int N=scn.nextInt();
        int[] pi=new int[N];
        for (int i = 0; i <N; i++) {
            pi[i]=i;
        }
        int sum=0;
        for(int j=0;j<N-1;j++){
            sum+=j/pi[j+1];
        }
        system.out.println(sum);
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
?????? 
^
1 error
Language: Java

import java.util.*;
class Main{ 
public static void main(String[] args) {
        Scanner scn =new Scanner(System.in);
        int N=scn.nextInt();
        int[] Pi=new int[N];
        for (int i = 0; i <N; i++) {
            pi[i]=i;
        }
        int sum=0;
        for(int j=0;j<N-1;j++){
            sum+=j/pi[j+1];
        }
        system.out.println(sum);
    }
}

Compiler output:
Main.java:8: error: cannot find symbol
            pi[i]=i;
            ^
  symbol:   variable pi
  location: class Main
Main.java:12: error: cannot find symbol
            sum+=j/pi[j+1];
                   ^
  symbol:   variable pi
  location: class Main
Main.java:14: error: package system does not exist
        system.out.println(sum);
              ^
3 errors
Language: Java

import java.util.*
class Main{ 
public static void main(String[] args) {
        Scanner scn =new Scanner(System.in);
        int N=scn.nextInt();
        int[] Pi=new int[N];
        for (int i = 0; i <N; i++) {
            pi[i]=i;
        }
        int sum=0;
        for(int j=0;j<N-1;j++){
            sum+=j/pi[j+1];
        }
        system.out.println(sum);
    }
}

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

class Main{ 
public static void main(String[] args) {
        Scanner scn =new Scanner(System.in);
        int N=scn.nextInt();
        int[] Pi=new int[N];
        for (int i = 0; i <N; i++) {
            pi[i]=i;
        }
        int sum=0;
        for(int j=0;j<N-1;j++){
            sum+=j/pi[j+1];
        }
        system.out.println(sum);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner scn =new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner scn =new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
            pi[i]=i;
            ^
  symbol:   variable pi
  location: class Main
Main.java:11: error: cannot find symbol
            sum+=j/pi[j+1];
                   ^
  symbol:   variable pi
  location: class Main
Main.java:13: error: package system does not exist
        system.out.println(sum);
              ^
5 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long number, sum = 0;
    number = Long.parseInt(sc.next());
    sum = number * (number - 1) / 2;
    System.out.println(sum);
  }
}


Compiler output:
Main.java:7: error: cannot find symbol
    number = Long.parseInt(sc.next());
                 ^
  symbol:   method parseInt(String)
  location: class Long
1 error
Language: Java

import java.util.Scanner;

public class Main{

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

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

    System.out.pritnln(sum);

  }

}


Compiler output:
Main.java:15: error: cannot find symbol
    System.out.pritnln(sum);
              ^
  symbol:   method pritnln(long)
  location: variable out of type PrintStream
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(){
    int N, cin >> N;
    int ans;

    rep(i,N-1){
        ans += i+1;
    }

    cout << ans <<endl;

}

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

#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
using namespace std;
#define LOCAL  1
#define UPLOAD 2
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
template <class T = long long> T input(){T x;cin >> x;return x;}
template <class T> void output(T x){cout << x << endl;}
#define debug(x) cerr << #x<< ": " << x<< '\n';

#define int long long

int main()
{
#if ENVIRONMENT == LOCAL
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
  int N = input();
  
  int ret = (float)(N-1)/2*N;
  output(ret);

  return 0;
}

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

#include <iostream>
using namsepace std;

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namsepace'
    2 | using namsepace std;
      |       ^~~~~~~~~
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 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 << 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:28: 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/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

using namespace std;

ll n;

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


Compiler output:
a.cc:5:1: error: 'll' does not name a type
    5 | ll n;
      | ^~
a.cc: In function 'int main()':
a.cc:8:16: error: 'n' was not declared in this scope
    8 |         cin >> n;
      |                ^
Language: C++

#include<iostream>
using namespace std;

typedef long long ll;

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

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

#include <bits/stdc++.h>

using namespace std;

using ll = int64_t;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = 2147483647;
constexpr ll L_INF = 9223372036854775807LL;

//===


int main()
{
  int n;
  cin >> n;
  cout << n*(n+1)/2 << endl:
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:28: error: expected ';' before ':' token
   21 |   cout << n*(n+1)/2 << endl:
      |                            ^
      |                            ;
Language: C++

#include <bits/stdc++.h>

typedef long long ll;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |         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:11:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |         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

#include<stdio.h>
int main()
{
  int i;
  long long j;
scanf("%d",&i);
  j=i(i-1)/2;
  printf("%lld",j);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:5: error: called object 'i' is not a function or function pointer
    7 |   j=i(i-1)/2;
      |     ^
main.c:4:7: note: declared here
    4 |   int i;
      |       ^
Language: C

#include<stdio.h>
int main()
{
  long long i,j;
scanf("%lld",&i);
  j=i(i-1)/2;
  printf("%lld",j);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:5: error: called object 'i' is not a function or function pointer
    6 |   j=i(i-1)/2;
      |     ^
main.c:4:13: note: declared here
    4 |   long long i,j;
      |             ^
Language: C

#include<stdio.h>
int main()
{
  long long i;
scanf("%lld",&i);
  i=i(i-1)/2;
  printf("%lld",i);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:5: error: called object 'i' is not a function or function pointer
    6 |   i=i(i-1)/2;
      |     ^
main.c:4:13: note: declared here
    4 |   long long i;
      |             ^