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

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

using ll=long long;
using int64=int64_t;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

ll div1(ll x){
  return x%1000000007;
}

//ost:列順で大きい,kst:列の中で大きい

main(){
    ll n=in(),k=in(),a[n],ans=0,ost,kst;
    for (int i=0;i<n;i++) cim >> a[i];
    for (int i=0;i<n;i++){
        ost=0;
        kst=0;
        for (int i2=0;i2<n;i2++){
            if (a[i2]<a[i] && i<i2) ost++;
            if (a[i2]<a[i]) {
                kst++;
            }
        }
      ans+=div1(ost*k)+div1(kst*k*(k-1)/2);
      ans=div1(ans);
      //cout << a[i] <<' ' << ost << ' ' << kst  << ' ' << ans << endl;
    }
    cout << ans << endl;
}

Compiler output:
a.cc:52:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   52 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:54:27: error: 'cim' was not declared in this scope
   54 |     for (int i=0;i<n;i++) cim >> a[i];
      |                           ^~~
Language: C++

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

int main(){
  int n,k,j;
  cin>>n>>k;
  int a[n];
  int i,inv=0;
  for(i=0;i<n;i++){
    cin>>a[i];
    
  }
  int total = 0;
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      if(a[i]>a[j]) total++;
      else if(a[i]<a[j]) inv++;
    }
  }
  int a = (k*(k+1)*total)/2 - k*inv;
  cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: conflicting declaration 'int a'
   20 |   int a = (k*(k+1)*total)/2 - k*inv;
      |       ^
a.cc:7:7: note: previous declaration as 'int a [n]'
    7 |   int a[n];
      |       ^
Language: C++

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

using ll=long long;
using int64=int64_t;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

ll div1(ll x){
  return x%1000000007;
}

//ost:列順で大きい,kst:列の中で大きい

main(){
    ll n=in(),k=in(),a[n],ans=0,ost,kst;
    forin(a,n);
    for (int i=0;i<n;i++){
        ost=0;
        kst=0;
        for (int i2=0;i2<n;i2++){
            if (a[i2]<a[i] && i<i2) ost++;
            if (a[i2]<a[i]) {
                kst++;
            }
        }
      ans+=div1(ost*k)+div1(kst*k*(k-1)/2);
      ans=div1(ans);
      //cout << a[i] <<' ' << ost << ' ' << kst  << ' ' << ans << endl;
    }
    cout << ans << endl;
}

Compiler output:
a.cc:52:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   52 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:54:11: error: cannot convert 'll*' {aka 'long long int*'} to 'int*'
   54 |     forin(a,n);
      |           ^
      |           |
      |           ll* {aka long long int*}
a.cc:14:17: note:   initializing argument 1 of 'void forin(int*, int)'
   14 | void forin(int* x,int y){
      |            ~~~~~^
Language: C++

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

const int maxn=2005;
int n,k,a[maxn],l[maxn],r[maxn];
long long p=0,lq=0,rq=0;

int main(){
    memset(a,0,sizeof(a));
    memset(l,0,sizeof(l));
    memset(r,0,sizeof(r));
    scanf("%d%d",&n,&k);
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            if(a[i]>a[j]) l[i]++;
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=i-1;j>=1;j--){
            if(a[i]>a[j]) r[i]++;
        }
    }
    for(int i=k-1;i>=1;i--){
        rq+=i;
        rq=rq%1000000007;
    }
    lq=(rq+k)%1000000007;
    for(int i=1;i<=n;i++){
        p+=l[i]*lq+r[i]*rq;
        p=p%1000000007;
    }
    printf("%lld",p);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'memset' was not declared in this scope
   10 |     memset(a,0,sizeof(a));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pf push_front

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
double pi = 3.141592653589793;
ll mod = 1000000007;
ll INF = 1000000001;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;



int main(){
    int n, l, m;
    ll k, ans = 0;
    cin >> n >> k;
    vi a(n＋10);
    rep(i, n){
        cin >> a[i];
    }
    for (int i = 0; i < n; i++){
        l = 0;
        m = 0;
        for (int j = 0; j < n; j++){
            if(a[i]>a[j]){
                l++;
                if(i<j){
                    m++;
                }
            }
        }
        ans += (k * m + k * l * (k - 1) / 2)%mod;
    }
    ans = ans % mod;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:10: error: 'n\U0000ff0b10' was not declared in this scope
   34 |     vi a(n＋10);
      |          ^~~~~
Language: C++

#include "stdafx.h"
#include "time.h"



int main()
{
	int i, j, m, d1, d10,  M, D,count=0;

	scanf_s("%d", &M);
	scanf_s("%d", &D);

	if(D <= 21 || M <= 3)
	{
		count = 0;
		printf("%d", count);
		return 0;
	}

	d10 = D / 10;
	d1 = D % 10;
	if (d10 >= 3) d1 = 9;

	for (m = 4; m <=M; m++)
	{
		for (i = 2; i < d10; i++)
		{
			d1 = m / i;
			for (j = 2; j < d1; j++)
			{
				if (m == i * j) 
				{
					count++;
				}
				

			}
		}
	}
	printf("%d", count);
	return 0;
}


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

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

int main(){
  int n,k,j;
  cin>>n>>k;
  int a[n];
  int i,inv=0;
  for(i=0;i<n;i++){
    cin>>a[i];
    if(i!=0 && a[i]>a[i-1]) inv++;
  }
  int total = 0;
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      if(a[i]>a[j]) total++;
    }
  }
  int a = (k*(k+1)*total)/2 - k*inv;
  cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: conflicting declaration 'int a'
   19 |   int a = (k*(k+1)*total)/2 - k*inv;
      |       ^
a.cc:7:7: note: previous declaration as 'int a [n]'
    7 |   int a[n];
      |       ^
Language: C++

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

int main() {
int64_t N,K,s,t,c=0;
  cin>>N>>K;
  t=N*K;

  vector<int64_t> A(N);
  vector<int64_t> B(t);
 
    for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
 for(int j=0;j<K;j++){
  for(int i=0;i<N;i++){
   s=i+j*N;
    B.at(s)=A.at(i);
 }
 }
   for(int i=0;i<N*K;i++){
    for(int j=0;j<N*K && i<j;j++){
      ifB.at(i)>B.at(j)){
        c++;
      }
    }
  }
  cout<<c%(1000000000+7)<<endl;
      
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:7: error: 'ifB' was not declared in this scope
   23 |       ifB.at(i)>B.at(j)){
      |       ^~~
Language: C

#include <stdio.h>

#define mod 1000000007
int main(void)
{
	int N;
	long int K;
	scanf("%d %ld",&N,&K);
	int A[N],i,j;
	long long int castle[N],kate[N];
	for(i=0;i<N;i++){
		scanf("%d",&A[i]);
		castle[i] = 0;
		kate[i] = 0;
	}
	for(i=0;i<N;i++){
		for(j=0;j<N;j++)
		{
			if(A[i] > A[j]){
				if(i<j) castle[i]++;
				else kate[i]++;
			}
		}
	}
	long long int ans = 0;
	/*
	for(i=0;i<N;i++){
		printf("castle[%d] = %lld, kate[%d] = %lld\n",i,castle[i],i,kate[i]);
	}
	*/
	long long long int a,b,c,d;
	for(i=0;i<N;i++){
		a = castle[i]*K*(K+1)/2;
		b = kate[i]*K*(K-1)/2;
		//printf("%lld,%lld\n",a,b);
		c = a % mod;
		d = b % mod;
		ans += c;
		ans = ans % mod;
		ans += d;
		ans = ans % mod;
	}
	//ans = ans%mod;
	printf("%lld",ans);
	
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:31:19: error: 'long long long' is too long for GCC
   31 |         long long long int a,b,c,d;
      |                   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,k;
  cin>>n>>k;
  vector<int> a(n);
  vector<int> b(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
    b[i]=a[i];
  }
  int cn=0;
  sort(b.begin(),b.end());
  reverse(b.begin(),b.end());
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      if(a[i]>a[j]){
       cn++;
      }
    }
  }

  int gg=0;
  for(int i=0;i<n-1;i++){
    if(b[i]==b[i+1]) continue;
    gg+=n-1-i;
  }

  int ans=0;
  ans=(cn*k+(k*(k-1)/2)*gg)(1000000000+7);
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:28: error: expression cannot be used as a function
   30 |   ans=(cn*k+(k*(k-1)/2)*gg)(1000000000+7);
      |       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
Language: C++

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

using ll=long long;
using int64=int64_t;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

ll div1(ll x){
  return x%1000000007;
}

//ost:列順で大きい,kst:列の中で大きい

main(){
    int n=in(),k=in(),a[n];
    ll ans=0,ost,kst;
    forin(a,n);
    for (int i=0;i<n;i++){
        ost=0;
        kst=0;
        for (int i2=0;i2<n;i2++){
            if (a[i2]<a[i] && i<i2) ost++;
            if (a[i2]<a[i]) {
                kst++;
            }
        }
      ans+=div1(ost*k)+div1(kst*k*(k-1)/2);
      ans=div1(ans);
      //cout << a[i] <<' ' << ost << ' ' << kst  << ' ' << ans << endl;
    }
    cout << ans << endl;

Compiler output:
a.cc:52:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   52 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:69:25: error: expected '}' at end of input
   69 |     cout << ans << endl;
      |                         ^
a.cc:52:7: note: to match this '{'
   52 | main(){
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  
  int n;
  cin >> n;
  int64_t k;
  cin >> k;
  int64_t mod = 1000000007;
  
  vector<int_64_t> cont1(n);
  
  for(int i = 0 ; i < n ; i++){
    cin >> cont1.at(i);
  }
  
  vector<int64_t> cont2(n);
  vector<int64_t> cont3(n);
  
  for(int i = 0 ; i < n ; i++){
    
    for(int j = i+1 ; j < n ; j++){
      if(i == j){
        continue;
      }
        if(cont1.at(i) > cont1.at(j)){
          cont2.at(i)++;
        }
    }
  }
  
  for(int i = 0 ; i < n ; i++){
    
    for(int j = 0 ; j < n ; j++){
      if(i == j){
        continue;
      }
        if(cont1.at(i) > cont1.at(j)){
          cont3.at(i)++;
        }
    }
  }
  int64_t sum = 0; 
  for(int i = 0 ; i < n ; i++){
    
    sum +=  (k*cont3.at(i)*(k - 1) + k*cont2.at(i) - cont3.at(i)*k*(k-1)/2 ) % mod;
    sum % mod;
  }
  cout << sum % mod << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'int_64_t' was not declared in this scope; did you mean 'int64_t'?
   11 |   vector<int_64_t> cont1(n);
      |          ^~~~~~~~
      |          int64_t
a.cc:11:18: error: template argument 1 is invalid
   11 |   vector<int_64_t> cont1(n);
      |                  ^
a.cc:11:18: error: template argument 2 is invalid
a.cc:14:18: error: request for member 'at' in 'cont1', which is of non-class type 'int'
   14 |     cin >> cont1.at(i);
      |                  ^~
a.cc:26:18: error: request for member 'at' in 'cont1', which is of non-class type 'int'
   26 |         if(cont1.at(i) > cont1.at(j)){
      |                  ^~
a.cc:26:32: error: request for member 'at' in 'cont1', which is of non-class type 'int'
   26 |         if(cont1.at(i) > cont1.at(j)){
      |                                ^~
a.cc:38:18: error: request for member 'at' in 'cont1', which is of non-class type 'int'
   38 |         if(cont1.at(i) > cont1.at(j)){
      |                  ^~
a.cc:38:32: error: request for member 'at' in 'cont1', which is of non-class type 'int'
   38 |         if(cont1.at(i) > cont1.at(j)){
      |                                ^~
Language: C++

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

long int_compare(const long* a, const long* b)
{
    return (*a > *b) ? 1
                     : (*a < *b) ? -1
                                 : 0;
}

void copy_arr(long* dst, long* src, long n)
{
    for (long i = 0; i < n; i++) {
        *dst++ = *src++;
    }
}

long get_index(long* a, long key, long n)
{
    long past = a[0];
    long order = 0;
    for (long i = 0; i < n; i++) {
        if (past != a[i]) {
            order++;
        }
        if (a[i] == key) {
            return order;
        }
        past = a[i];
    }
    return 0;
}

int main(void)
{
    const long mod = 1000000007;

    long n, k;
    scanf("%ld %ld", &n, &k);

    long* a = calloc(n, sizeof(long));
    for (long i = 0; i < n; i++) {
        scanf("%ld", &a[i]);
    }

    long count = 0;

    long* sorted = calloc(n, sizeof(long));
    copy_arr(sorted, a, n);
    qsort(sorted, n, sizeof(long), (int (*)(const void*, const void*))(*int_compare));

    for (long i = 0; i < n; i++) {
        long first_elem = 0;
        for (long j = i + 1; j < n; j++) {
            if (a[i] > a[j]) {
                first_elem++;
            }
        }
        long idx = get_index(sorted, sorted[i], n);
        count += (k * (2 * first_elem + (k - 1) * idx) / 2) % mod;
        count %= mod;
    }

    printf("%ld\n", count);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:21: error: invalid conversion from 'void*' to 'long int*' [-fpermissive]
   41 |     long* a = calloc(n, sizeof(long));
      |               ~~~~~~^~~~~~~~~~~~~~~~~
      |                     |
      |                     void*
a.cc:48:26: error: invalid conversion from 'void*' to 'long int*' [-fpermissive]
   48 |     long* sorted = calloc(n, sizeof(long));
      |                    ~~~~~~^~~~~~~~~~~~~~~~~
      |                          |
      |                          void*
Language: C++

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

int main() {
  int N, K; cin >> N >> K;
  int cnt = 0;
  int F = N*K;
  vector<int> a(F);
  
  for(int i=0; i<F ; i++){
    cin >> a.at(i);
  }
  
  for(int A=0; A<F ; A++){
  for(int i=0; i<F-1 ; i++){
    if(a.at(i) > a.at(i+1){
      cnt++;
      swap(a.at(i),a.at(i+1));
    }
    }
  }
  
    
  cout << cnt % 1000000007 << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:16:27: error: expected ')' before '{' token
   16 |     if(a.at(i) > a.at(i+1){
      |       ~                   ^
      |                           )
a.cc:20:5: error: expected primary-expression before '}' token
   20 |     }
      |     ^
Language: C

#include <iostream>
using namespace std;
int main()
{
	int N,f=0,b=0;
	long long int K,ans=0;
	cin >> N >>K;
	int A[N];
	for(int i=0;i<N;i++) cin >> A[i];
	for(int i=0;i<N;i++)
	{
		b=0;
		f=0;
		for(int j=0;j<i;j++)
			if(A[j]<A[i]) f++;
		for(int j=i+1;j<N;j++)
			if(A[j]<A[i]) b++;
		ans+=(f*K*(K-1)+b*K*(K+1))/2;
		ans%=1000000007;
	}
	cout << ans << endl;
}

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

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

using ll=long long;
using int64=int64_t;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

ll div1(ll x){
  return x%1000000007;
}

//ost:列順で大きい,kst:列の中で大きい

main(){
    int n=in(),k=in(),a[n];
    ll ans=0,ost,kst;
    forin(a,n);
    for (int i=0;i<n;i++){
        ost=0;
        kst=0;
        for (int i2=0;i2<n;i2++){
            if (a[i2]<a[i] && i<i2) ost++;
            if (a[i2]<a[i]) {
                kst++;
            }
        }
      ans+=div1(ost*k+kst*k*(k-1)/2+(k*kst*(k-1))%2);
      //cout << a[i] <<' ' << ost << ' ' << kst  << ' ' << ans << endl;
    }
    cout << div1(ans) << endl;

Compiler output:
a.cc:52:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   52 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:68:31: error: expected '}' at end of input
   68 |     cout << div1(ans) << endl;
      |                               ^
a.cc:52:7: note: to match this '{'
   52 | main(){
      |       ^
Language: C++

import java.util.Scanner;
import java.math.BigInteger;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);
    final long MOD = 1000000000 + 7;

    while (in.hasNext()) {
      int N = in.nextInt();
      long K = in.nextLong();
      int[] A = new int[N];

      for (int i = 0; i < A.length; ++i) {
        A[i] = in.nextInt();
      }

      int[] smaller = new int[N];
      long countRev = 0;
      for (int i = 0; i < A.length; ++i) {
        for (int j = 0; j < A.length; ++j) {
          if (A[i] > A[j]) {
            ++smaller[i];

            if (i < j) {
              ++countRev;
            }
          }
        }
      }

      countRev *= K;
      countRev %= MOD;
      
      long base = (K * (K - 1)) / 2;

      for (int i = 0; i < smaller.length; ++i) {
        BigInteger b = BigInteger.valueOf(base).multiply(BigInteger.valueOf(smaller[i])).mod(BigInteger.valueOf(MOD));
        long increase = b.longValue();

        countRev = (countRev + increase) % MOD;
      }

      System.out.println(countRev);
    }
  }
}

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

n, k = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)
fir = 0
sec = 0
for i in 0..n-1
  for j in 0..i-1
    fir += 1 if a[j] > a[i]
  end
end
for i in 0..n-1
  for j in 0..n-1
    sec += 1 if a[j] > a[i]
  end
end
fir %= 1000000007
fir *= k
fir %= 1000000007
sec %= 1000000007
sec *= k
sec %= 1000000007
sec *= k - 1
sec %= 1000000007
sec /= 2
ans = (fir + sec) % 1000000007
puts ans

Compiler output:
a.cc:5:10: error: too many decimal points in number
    5 | for i in 0..n-1
      |          ^~~~
a.cc:6:12: error: too many decimal points in number
    6 |   for j in 0..i-1
      |            ^~~~
a.cc:10:10: error: too many decimal points in number
   10 | for i in 0..n-1
      |          ^~~~
a.cc:11:12: error: too many decimal points in number
   11 |   for j in 0..n-1
      |            ^~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n, k = gets.split.map(&:to_i)
      | ^
Language: C++

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

int main() {
  int N, K; cin >> N >> K;
  int cnt = 0;
  int F = N*K;
  vector<int> a(F);
  
  for(int i=0; i<F ; i++){
    cin >> a.at(i);
  }
  
  for(int A=0; A<F ; A++){
  for(int i=0; i<F-1 ; i++){
    if(a.at(i) > a.at(j)){
      cnt++;
    }
    }
  }
  
    
  cout << cnt % 1000000007 << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: 'j' was not declared in this scope
   16 |     if(a.at(i) > a.at(j)){
      |                       ^
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <map>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

int main(int argc, const char * argv[]) {
    
    // source code
  int n = inputValue();
  int k = inputValue();
  int a[n];
  int init[n];
  int dist[n];
  ll answer;
  ll div = 10*10*10*10*10*10*10*10*10 + 9;
  inputArray(a,n);
  map<int,int> mapdict{};
  rep(i,n)
  {
    if(mapdict.count(i) == 0)
    {
      mapdict.emplace(i,1);
    }
    else
    {
      mapdict.at(i)++;
    }
  }
  rep(i,n)
  {
	repd(j,0,i)
    {
      if(a[i]<a[j])
      {
        init[i]++;
      }
    }
    for( auto i = mapdict.begin(); i != mapdict.end() ; ++i ) {
      if((i->first) < a[i])
      {
        break;
      }
      dist[i] += (i->second);
  	}
  }
  rep(i,n)
  {
    answer += init[i] + dist[i] * (k - 1);
    if(answer >= div)
    {
      answer = answer%div;
    }
  }
  
  
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:83:24: error: no match for 'operator[]' (operand types are 'int [n]' and 'std::_Rb_tree_iterator<std::pair<const int, int> >')
   83 |       if((i->first) < a[i])
      |                        ^
a.cc:87:11: error: no match for 'operator[]' (operand types are 'int [n]' and 'std::_Rb_tree_iterator<std::pair<const int, int> >')
   87 |       dist[i] += (i->second);
      |           ^
Language: C++

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

int main(){
  int N,K,count=0;
  double a=7.0;
  cin >> N >> K;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin >> vec.at(i);
  }
  for(int i=0;i<K;i++){
    for(int j=0;j<N;j++){
      vec.push_back(vec.at(j));
    }
  }
  for(int i=0;i<vec.size();i++){
    for(int j=1;j<vec.size()+1;j++){
      if(i<j){
        if(vec.at(i) > vec.at(j)){
          count++;
        }
      }
    }
  }
  cout << count % (1e9 + a) << endl;
}  


Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   26 |   cout << count % (1e9 + a) << endl;
      |           ~~~~~ ^ ~~~~~~~~~
      |           |            |
      |           int          double
Language: C++

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

int main(){
  int N,K,count=0;
  double a=7;
  cin >> N >> K;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin >> vec.at(i);
  }
  for(int i=0;i<K;i++){
    for(int j=0;j<N;j++){
      vec.push_back(vec.at(j));
    }
  }
  for(int i=0;i<vec.size();i++){
    for(int j=1;j<vec.size()+1;j++){
      if(i<j){
        if(vec.at(i) > vec.at(j)){
          count++;
        }
      }
    }
  }
  cout << count % (1e9 + a) << endl;
}  


Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   26 |   cout << count % (1e9 + a) << endl;
      |           ~~~~~ ^ ~~~~~~~~~
      |           |            |
      |           int          double
Language: C++

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

const int maxn=2005;
int n,k,a[maxn];
long long l[maxn],r[maxn];
long long p=0;

int main(){
    memset(a,0,sizeof(a));
    memset(l,0,sizeof(l));
    memset(r,0,sizeof(r));
    scanf("%d%d",&n,&k);
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++){
            if(a[i]>a[j]) l[i]++;
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=i-1;j>=1;j--){
            if(a[i]>a[j]) r[i]++;
        }
    }
    for(long long i=k;i>=1;i--){
        for(int j=1;j<=n;j++){
            long long x=l[j]*i+r[i]*(i-1);
            p+=x%1000000007;
            p=p%1000000007;
        }
    }
    printf("%lld",p);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'memset' was not declared in this scope
   11 |     memset(a,0,sizeof(a));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <map>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

int main(int argc, const char * argv[]) {
    
    // source code
  int n = inputValue();
  int k = inputValue();
  int a[n];
  int init[n];
  int dist[n];
  ll answer;
  ll div = 10*10*10*10*10*10*10*10*10 + 9;
  inputArray(a,n);
  map<int,int> mapdict{};
  rep(i,n)
  {
    if(mapdict.count(i) == 0)
    {
      mapdict.emplace(i,1);
    }
    else
    {
      mapdict.at(i)++;
    }
  }
  rep(i,n)
  {
	repd(j,0,i)
    {
      if(a[i]<a[j])
      {
        init[i]++;
      }
    }
    for( auto i = mapdict.begin(); i != mapdict.end() ; ++i ) {
      if(i ->first < a[i])break;
      dist[i] += i->second;
  	}
  }
  rep(i,n)
  {
    answer += init[i] + dist[i] * (k - 1);
    if(answer >= div)
    {
      answer = answer%div;
    }
  }
  
  
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:83:23: error: no match for 'operator[]' (operand types are 'int [n]' and 'std::_Rb_tree_iterator<std::pair<const int, int> >')
   83 |       if(i ->first < a[i])break;
      |                       ^
a.cc:84:11: error: no match for 'operator[]' (operand types are 'int [n]' and 'std::_Rb_tree_iterator<std::pair<const int, int> >')
   84 |       dist[i] += i->second;
      |           ^
Language: C++

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

int main(){
  int N,K,count=0;
  cin >> N >> K;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin >> vec.at(i);
  }
  for(int i=0;i<K;i++){
    for(int j=0;j<N;j++){
      vec.push_back(vec.at(j));
    }
  }
  for(int i=0;i<vec.size();i++){
    for(int j=1;j<vec.size()+1;j++){
      if(i<j){
        if(vec.at(i) > vec.at(j)){
          count++;
        }
      }
    }
  }
  cout << count % (1e9 + 7) << endl;
}  


Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   25 |   cout << count % (1e9 + 7) << endl;
      |           ~~~~~ ^ ~~~~~~~~~
      |           |            |
      |           int          double
Language: C++

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

int main(){
  int N,K,count=0,a=0;
  cin >> N >> K;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin >> vec.at(i);
  }
  for(int i=0;i<K;i++){
    for(int j=0;j<N;j++){
      vec.push_back(vec.at(j));
    }
  }
  for(int i=0;i<vec.size();i++){
    j+=a;
    for(int j=1;j<vec.size()+1;j++){
      if(vec.at(i) > vec.at(j)){
        count++;
      }
    }
    a++;
  }
  cout << count % (1e9 + 7) << endl;
}  


Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'j' was not declared in this scope
   17 |     j+=a;
      |     ^
a.cc:25:17: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   25 |   cout << count % (1e9 + 7) << endl;
      |           ~~~~~ ^ ~~~~~~~~~
      |           |            |
      |           int          double
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

int main(int argc, const char * argv[]) {
    
    // source code
  int n = inputValue();
  int k = inputValue();
  int a[n];
  int init[n];
  int dist[n];
  ll answer;
  ll div = 10*10*10*10*10*10*10*10*10 + 9;
  inputArray(a,n);
  map<int,int> mapdict{};
  rep(i,n)
  {
    if(mapdict.count(i) == 0)
    {
      mapdict.emplace(i,1);
    }
    else
    {
      mapdict(i)++;
    }
  }
  rep(i,n)
  {
	repd(j,0,i)
    {
      if(a[i]<a[j])
      {
        init[i]++;
      }
    }
    for (const auto& [key, value] : mapdict){
      if(key < a[i])break;
      dist[i] += value;
    }
  }
  rep(i,n)
  {
    answer += init[i] + dist[i] * (k - 1);
    if(answer >= div)
    {
      answer = answer%div;
    }
  }
  
  
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:60:3: error: 'map' was not declared in this scope
   60 |   map<int,int> mapdict{};
      |   ^~~
a.cc:10:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    9 | #include <stack>
  +++ |+#include <map>
   10 | #include <string>
a.cc:60:7: error: expected primary-expression before 'int'
   60 |   map<int,int> mapdict{};
      |       ^~~
a.cc:63:8: error: 'mapdict' was not declared in this scope
   63 |     if(mapdict.count(i) == 0)
      |        ^~~~~~~
a.cc:81:37: error: 'mapdict' was not declared in this scope
   81 |     for (const auto& [key, value] : mapdict){
      |                                     ^~~~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

int main(int argc, const char * argv[]) {
    
    // source code
  int n = inputValue();
  int k = inputValue();
  int a[n];
  int init[n];
  int dist[n];
  ll answer;
  ll div = 10*10*10*10*10*10*10*10*10 + 9;
  inputArray(*a,n);
  map<int,int> mapdict{};
  rep(i,n)
  {
    if(mapdict.count(i) == 0)
    {
      mapdict.emplace(i,1);
    }
    else
    {
      mapdict(i)++;
    }
  }
  rep(i,n)
  {
	repd(j,0,i)
    {
      if(a[i]<a[j])
      {
        init[i]++;
      }
    }
    for (const auto& [key, value] : mapdict){
      if(key < a[i])break;
      dist[i] += value;
    }
  }
  rep(i,n)
  {
    answer += init[i] + dist[i] * (k - 1);
    if(answer >= div)
    {
      answer = answer%div;
    }
  }
  
  
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:59:14: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   59 |   inputArray(*a,n);
      |              ^~
      |              |
      |              int
a.cc:25:23: note:   initializing argument 1 of 'void inputArray(int*, int)'
   25 | void inputArray(int * p, int a){
      |                 ~~~~~~^
a.cc:60:3: error: 'map' was not declared in this scope
   60 |   map<int,int> mapdict{};
      |   ^~~
a.cc:10:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    9 | #include <stack>
  +++ |+#include <map>
   10 | #include <string>
a.cc:60:7: error: expected primary-expression before 'int'
   60 |   map<int,int> mapdict{};
      |       ^~~
a.cc:63:8: error: 'mapdict' was not declared in this scope
   63 |     if(mapdict.count(i) == 0)
      |        ^~~~~~~
a.cc:81:37: error: 'mapdict' was not declared in this scope
   81 |     for (const auto& [key, value] : mapdict){
      |                                     ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int M = 1e9+7 ;
long long sum=0;
int main()
{
	int n,k;
	int a[2005];
	long long b[2005];
	cin >> n >> k;
	for(int i=0;i<n;i++) {
		cin >>a[i]; 
	}
	memset(f,0,sizeof(f)) ;
	for(int i=0;i<n;i++) {
		for(int j=i+1;j<n;j++) {
			if(a[i]>a[j]) {
				sum++;
			}
		}
	}
	sum=(sum*k)%M ;
	memset(b,0,sizeof(b)) ;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(a[i]>a[j]) b[i]++;
		}
	}
	for(int i=0;i<n;i++) {
		sum=(sum%M+b[i]*k*(k-1)/2%M)%M;	
	}
	cout << sum<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'f' was not declared in this scope
   14 |         memset(f,0,sizeof(f)) ;
      |                ^
Language: C++

int n=in(),k=in(),a[n];
    ll ans=k*n,ost,kst;
    forin(a,n);
    for (int i=0;i<n;i++){
        ost=0;
        kst=0;
        for (int i2=0;i2<n;i2++){
            cout << a[i] << " num " << a[i2] << endl;
            if (a[i2]=a[i] && i<i2) ost++;
            if (a[i2]=a[i]) {
                kst++;
                cout << a[i] << " a " << a[i2] << endl;
            }
        }
        ans+=ost*k+kst*k/2+(k*kst)%2;
    }
    cout << div1(ans) << endl;

Compiler output:
a.cc:1:7: error: 'in' was not declared in this scope; did you mean 'n'?
    1 | int n=in(),k=in(),a[n];
      |       ^~
      |       n
a.cc:2:5: error: 'll' does not name a type
    2 |     ll ans=k*n,ost,kst;
      |     ^~
a.cc:3:10: error: expected constructor, destructor, or type conversion before '(' token
    3 |     forin(a,n);
      |          ^
a.cc:4:5: error: expected unqualified-id before 'for'
    4 |     for (int i=0;i<n;i++){
      |     ^~~
a.cc:4:18: error: 'i' does not name a type
    4 |     for (int i=0;i<n;i++){
      |                  ^
a.cc:4:22: error: 'i' does not name a type
    4 |     for (int i=0;i<n;i++){
      |                      ^
a.cc:17:5: error: 'cout' does not name a type
   17 |     cout << div1(ans) << endl;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using Int = int256_t;
typedef pair<int,int> P;
typedef priority_queue<int> Pr;
Int const MOD = 1000000007;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


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

    Int n,k; Int ans=0; cin>>n>>k; int a[n]; Int b[n]={},c[n]={};
    for (int i = 0; i < n; i++)cin>>a[i];
    for (int i = 0; i < n; i++){
        for (int j = 0; j < n; j++){
            if(j<i&&a[i]>a[j])b[i]++;
            else if(j>i&&a[i]>a[j])c[i]++;
        }
    }
    Int kb=(k*(k-1))/2,kc=((k+1)*k)/2;
    for (int i = 0; i < n; i++)ans=(ans+b[i]*kb+c[i]*kc)%MOD;
    cout<<ans<<'\n';
}

Compiler output:
a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {
  int N,K;
  cin>>N>>K;
  int S=N*K;
  vector<int>A(N);
  int a=0;
  
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  for(int i=0;i<S;i++){
    for(int j=i;j<S;j++){
      if(A.at(i)<A.at(j)){
        a++;
      }
    }
  }
   int ans=a%(10*10*10*10*10*10*10*10*10+7) 

    cout<<ans<<endl;
  
}



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

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

long main() {
  long N, K; cin >> N >> K;
  long cnt = 0;
  vector<long> a(N*K);
  vector<long> b(N*K);
  
  for(long i=0; i<K*N ; i++){
    cin >> a.at(i);
  }
  b=a;
  
  sort(b.begin(), b.end());
  
   for(long i=0; i<K*N ; i++){
     if(a.at(i)==b.at(i)){
       cnt++;
     }
   }
  cout << cnt % 1000000007 << endl;
}
  


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

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

int main(void){
	int n;
	long k;
	int *a;
	long set = 0, count = 0;
	long sum = 0;
	scanf("%d %ld", &n, &k);
	a = malloc(sizeof(int));
	for(int i = 0; i < n; i++){
		scanf("%d", a + i);
		for(int j = 0; j < i; j++){
			if(a[j] > a[i]){
				//printf("%d:%d\n", a[j], a[i]);
				count++;
			}
		}
	}
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			if(a[i] > a[j])set++;
		}
	}
	set %= 1000000007;
	count %= 1000000007;
	sum = (set * (k * (k - 1) / 2 % 1000000007) % 1000000007 + count * k % 1000000007;
	//printf("count: %d, set: %d\n", count, set);
	printf("%ld\n", sum % 1000000007);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:28:90: error: expected ')' before ';' token
   28 |         sum = (set * (k * (k - 1) / 2 % 1000000007) % 1000000007 + count * k % 1000000007;
      |               ~                                                                          ^
      |                                                                                          )
main.c:31:18: error: expected ';' before '}' token
   31 |         return 0;
      |                  ^
      |                  ;
   32 | }
      | ~
Language: C++

#include <stdio.h>
#include <iostream>
 
using namespace std;
int main()
{
  	
  	int i, j,per,per_;
	int N,K;
  	int s[2001];
 	long cnt;
 
  	scanf("%d %d\n", &N,&K);
  	for (i = 0; i < N; i++) cin >> s[i];
  
  	per=0;
 	for(i=0;i<N-1;i++){
      	for(j=i+1;j<N;j++){
   			if(s[i]>s[j])
          		per++;
        }
    }
  	
  	per_ = 0;
  	if(K >= 2){
      for(i=0;i<N-1;i++){
        f(s[N-1]>s[i])
          per_++;
      }
    }
  	
  	cnt = per * K + (K-1)*per_;
  	cnt %= (1000000000 + 7);
 
  	printf("%d\n",cnt);
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'f' was not declared in this scope
   27 |         f(s[N-1]>s[i])
      |         ^
Language: C++

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

int main() {
int64_t N,K,c=0;
  vector<int64_t> A(N);
  vector<int64_t> B(0);
  cin>>N>>K;
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
 for(int i=0;i<K;i++){
   B=B.insert(B.end(),A.begin(),A.end());
 }
  
   for(int i=0;i<N*K;i++){
    for(int j=0;j<N*K;j++){
      if(i<j && B.at(i)>B.at(j)){
        c++;
      }
    }
  }
  cout<<c%(1000000000+7)<<endl;
      
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:40: error: no match for 'operator=' (operand types are 'std::vector<long int>' and 'std::vector<long int>::iterator')
   13 |    B=B.insert(B.end(),A.begin(),A.end());
      |                                        ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'std::vector<long int>::iterator' to 'const std::vector<long int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'std::vector<long int>::iterator' to 'std::vector<long int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'std::vector<long int>::iterator' to 'std::initializer_list<long int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: Java

import java.util.*;
public class Main2{
    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] A = new int[N];
        int[] B = new int[N*K];
        int count = 0;
        for(int i = 0; i < N; i++){
            A[i] = sc.nextInt();
        }
        for(int i = 0; i < K; i++){
            for(int j = 0; j < N; j++){
                B[j+i*N] = A[j];
            }
        }
for(int i = 0; i < N*K -1; i++){
for(int j = i+1; j < N*K; j++){
if(B[i] > B[j])count = (count+1)%1000000007;
}
}
System.out.println(count);
    }
}

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

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); i++)
#define intt int64_t
#define all(vec) vec.begin(), vec.end()
#define MOD 1000000007

int main() {
    int n, k;
    scanf("%d %d", &n, &k);
    vector<int> vec(n);
    rep(i,n) scanf("%d", &vec.at(i));
    vector<int> small(n, 0);
    vector<int> smalll(n, 0);
    rep(i,n) {
        rep(j,n) {
            if (vec.at(i) > vec.at(j)) {
                small.at(i)++;
                if (i > j) smalll.at(i)++;
            }
        }
    }
    intt ans=0;
    rep(i,n) {
        ans += ((intt)(k+1)/2*small.at(i)-smalll.at(i))*k;
        ans %= MOD;
    }
    printf("%d\n", ans%MOD);
}v

Compiler output:
a.cc:29:2: error: 'v' does not name a type
   29 | }v
      |  ^
Language: C++

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

int main() {
  int N, K; cin >> N >> K;
  int cnt = 0;
  vector<int> a(N*K);
  vector<int> b(N*K)
  
  for(int i=0; i<K*N ; i++){
    cin >> a.at(i);
  }
  b=a;
  
  sort(b.begin(), b.end());
  
   for(int i=0; i<K*N ; i++){
     if(a.at(i)==b.at(i)){
       cnt++
     }
   }
  cout << cnt << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'for'
   10 |   for(int i=0; i<K*N ; i++){
      |   ^~~
a.cc:10:16: error: 'i' was not declared in this scope
   10 |   for(int i=0; i<K*N ; i++){
      |                ^
a.cc:19:13: error: expected ';' before '}' token
   19 |        cnt++
      |             ^
      |             ;
   20 |      }
      |      ~
Language: C++

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

using ll=long long;
using int64=int64_t;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

int div1(ll x){
  return x%1000000007;
}

//ost:列順で大きい,kst:列の中で大きい

main(){
    int n=in(),k=in(),a[n];
    ll ans=0,ost,kst;
    forin(a,n);
    for (int i=0;i<n;i++){
        ost=-1;
        kst=0;
        cout << a[i] << " num " << a[i2] << endl;
        for (int i2=0;i2<n;i2++){
            if (a[i2]<=a[i] && i<i2) ost++;
            if (a[i2]<=a[i]) {
                kst++;
                cout << a[i] << " a " << a[i2] << endl;
            }
        }
        ans+=ost*k+kst*k/2+(k*kst)%2;
    }
    cout << div1(ans) << endl;
}

Compiler output:
a.cc:52:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   52 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:59:38: error: 'i2' was not declared in this scope; did you mean 'i'?
   59 |         cout << a[i] << " num " << a[i2] << endl;
      |                                      ^~
      |                                      i
Language: C++

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

int main() {
int64_t N,K,c=0,C;
  vector<int64_t> A(N);
  vector<int64_t> B(0);
  cin>>N>>K;
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
 for(int i=0;i<K;i++){
   B.insert(B.end(),A.begin(),A.end());
 }
  
   for(int i=0;i<N*K;i++){
    for(int j=0;j<N*K;j++){
      if(B.at(i)>B.at(j)){
        c++;
      }
    }
  }
  C=c%2
  cout<<C%(1000000000+7)<<endl;
      
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:8: error: expected ';' before 'cout'
   23 |   C=c%2
      |        ^
      |        ;
   24 |   cout<<C%(1000000000+7)<<endl;
      |   ~~~~
Language: Java

public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int N = sc.nextInt();
			int K = sc.nextInt();
			int[] nums = new int[N];
			for (int i = 0; i < N; i++) {
				nums[i] = sc.nextInt();
			}
			long[] childCount = new long[N];
			for (int i = N - 1; i > 0; i--) {
				for (int j = i - 1; j >= 0; j--) {
					if (nums[j] > nums[i]) {
						childCount[j] = (childCount[j] + childCount[i]) + 1;
					}
				}
			}
			long div = 1000000007;
			long k;
			if( K %2 == 1) {
				long amari1 = K % div;
				long amari2 = (K+1)/2 % div;
				k = amari1 * amari2 % div;
			}else {
				long amari1 = K/2 % div;
				long amari2 = (K+1) % div;
				k = amari1 * amari2 % div;
			}
			System.out.println(childCount[0] * k % div);
		}
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		try (Scanner sc = new Scanner(System.in)) {
		     ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		try (Scanner sc = new Scanner(System.in)) {
		                      ^
  symbol:   class Scanner
  location: class Main
2 errors