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

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int MOD = 1000000007;
const ll INF = 1LL << 60;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, k;
    cin >> n >> k;
    ll cnt = 0;
    vector<ll> vc(n+1);
    vc[0] = 0;
    for (int i = 1; i <= n; i++)
    {
        vc[i] = (vc[i - 1] + i);
    }

    for (int i = k-1; i <= n; i++)
    {
        ll max = vc[vc.size()-1]-vc[n-i-1];
        ll min = vc[i];
        cnt += (max - min + 1)%MOD;
        cnt %=MOD;
    }
    cout << cnt << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
long long n,k,ans=0,sum[2000010];
int main()
{
	cin>>n>>k;
	if (k>n){
		cout<<1<<endl;
		return 0;
	} 
	for (long long i=1;i<=2000000;i++) sum[i]=(sum[i-1]+i)%(1000000000+7);
	for (long long i=k;i<=n;i++){
		ans+=(sum[n]-sum[n-i]-sum[i-1]+1);
		ans%=(1000000000+7);
	}
	cout<<(ans+1)%(1000000000+7)<<endl;
	return 0;
}

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

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

int main() {
    //変数定義, 入力処理
    // vector<vector<int>> data(3, vector<int>(4)); //二次元配列
    int N, K, cnt = 0;
    int mod = 1e9 + 7;
    cout << mod << endl;
    cin >> N >> K;
    //処理
    for (int i = K - 1; i <= N; i++) {
        cnt += ((double)(2 * N - i) / 2) * (i + 1) - ((double)i / 2) * (i + 1) + 1;
        cnt %= mod;


    }
    //出力処理
    cout << cnt << endl;
    return 0;
}


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

#include <iostream>
using namespace std;
typedef long long ll;

int main(){
  ll n, k;
  cin >> n >> k;
  ll min = 0;
  ll max = 0;
  ll count = 0;
  for (k; k<=n+1; k++){
    
    for(int j=0; j<k; j++){
      min += j;
      max += (n-j)
    }
    count += (max-min+1);
    min = 0;
    max = 0;
    
  }
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: expected ';' before '}' token
   15 |       max += (n-j)
      |                   ^
      |                   ;
   16 |     }
      |     ~
Language: C

#include<bits/stdc++.h>
#include<bits/extc++.h>

using namespace std;
using namespace __gnu_pbds;

const int maxn = 2e5 + 7;
const int mod = 1e9 + 7;

long long n,k;
long long ans;
long long pre[maxn];
long long val[maxn];

int main()
{
	scanf("%lld%lld",&n,&k);
	for(int i=0;i<=n;i++)
		pre[i] = (pre[i-1]+i)%mod;
	for(int i=1;i<=n+1;i++)
	{
		long long x=pre[i-1];
		long long y=(i==n+1)?pre[n]:pre[n]-pre[n-i];
		val[i]=(y-x+1+mod)%mod;
	}
	
	for(long long i=k;i<=n+1;i++)
	{
		ans=(ans+val[i])%mod;
	}
	
	printf("%lld\n",ans);
	return 0;
}




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

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <cassert>
#include <fstream>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

const ll mod = 1e9 + 7;

vector<string> g;

int main() {

    
    ll n, k;
    cin >> n >> k;
    
    ll ret = 0;
    for (ll i = k; i <= n + 1; ++i)
    {
        ll min = ((i - 1) * i) / 2ll;
        ll max = ((2ll * n + 1 - i) * i) / 2ll;
        ret += (max - min + 1ll) % mod;
        ret %= mod;
    }
    
    
    cout << ret << endl;

    
    return 0;
}

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>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

long long modpow(long long a, long long n, long long mod) {
    long long x = 1;
    while (n > 0) {
        if (n & 1) x = x * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return x;
}

int main(){
  map<ll,int> mp;
  ll n,k;
  cin >> n >> k;
  //10^100のあまり
  const ll C = modpow(10, 100, 1000000007);
  //cout << C << endl;
  ll count = 0;
  for(ll i=k; i<=n+1; i++){
    ll simoiketa = i*(i-1)/2;
  	ll kamiiketa = (2*n+1-i)*i/2;
    count += (kamiiketa - simoiketa)%1000000007 + 1;
    count = count%1000000007
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:29: error: expected ';' before '}' token
   29 |     count = count%1000000007
      |                             ^
      |                             ;
   30 |   }
      |   ~
Language: C

   ll n, k, ans = 0;
    scanf("%lld%lld",&n,&k);
    for(; k <= n + 1; k++){
        ans += (n - k + 1) * k + 1;
        ans %= mod;
    }
    printf("%lld\n",ans);

Compiler output:
main.c:1:4: error: unknown type name 'll'
    1 |    ll n, k, ans = 0;
      |    ^~
main.c:2:11: error: expected declaration specifiers or '...' before string constant
    2 |     scanf("%lld%lld",&n,&k);
      |           ^~~~~~~~~~
main.c:2:22: error: expected declaration specifiers or '...' before '&' token
    2 |     scanf("%lld%lld",&n,&k);
      |                      ^
main.c:2:25: error: expected declaration specifiers or '...' before '&' token
    2 |     scanf("%lld%lld",&n,&k);
      |                         ^
main.c:3:5: error: expected identifier or '(' before 'for'
    3 |     for(; k <= n + 1; k++){
      |     ^~~
main.c:3:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
    3 |     for(; k <= n + 1; k++){
      |             ^~
main.c:3:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    3 |     for(; k <= n + 1; k++){
      |                        ^~
main.c:7:12: error: expected declaration specifiers or '...' before string constant
    7 |     printf("%lld\n",ans);
      |            ^~~~~~~~
main.c:7:21: error: expected declaration specifiers or '...' before 'ans'
    7 |     printf("%lld\n",ans);
      |                     ^~~
Language: C

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <cassert>
#include <fstream>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

const ll mod = 1e9 + 7;

vector<string> g;

int main() {

    
    ll n, k;
    cin >> n >> k;
    
    ll ret = 0;
    for (ll i = k; i <= n + 1; ++i)
    {
        ll min = ((i - 1) * i) / 2ll;
        ll max = ((2ll * n + 1 - i) * i) / 2ll;
        ret += (max - min + 1ll) % mod;
        ret %= mod;
    }
    
    
    cout << ret << endl;
    
    ll t = 1;
    for (int i = 0; i < t; ++i)
    {
        

        cout << "Case #" << i + 1 << ": " << ret << endl;
    }

    
    return 0;
}

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

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <cassert>
#include <fstream>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

const ll mod = 1e9 + 7;

vector<string> g;

int main() {

    ifstream in("input.txt");
    cin.rdbuf(in.rdbuf());
    
    ll n, k;
    cin >> n >> k;
    
    ll ret = 0;
    for (ll i = k; i <= n + 1; ++i)
    {
        ll min = ((i - 1) * i) / 2ll;
        ll max = ((2ll * n + 1 - i) * i) / 2ll;
        ret += (max - min + 1ll) % mod;
        ret %= mod;
    }
    
    
    cout << ret << endl;

    
    return 0;
}

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

#include <iostream>
using namespace std;
typedef long long ll;

int main(){
  ll n, k;
  cin >> n >> k;
  ll min = 0;
  ll max = 0;
  ll tmp=n;
  ll count = 0;
  for (k; k<=n+1; k++){
    
    for(int j=0; j<k; j++){
      min += j;
    }
    for(int j=k; j>0; j--){
      max += tmp;
      tmp--;
    }
    count += (max-min+1);
    tmp = n;
    
  }
  cout << count % (pow(10, 9)+7) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: 'pow' was not declared in this scope
   25 |   cout << count % (pow(10, 9)+7) << endl;
      |                    ^~~
Language: C++

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

#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)(n-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se second
#define debug(...) {cerr<<"[L"<<__LINE__<<"] "; _debug(__VA_ARGS__);}

template<typename T>
string join(const vector<T>&v, string del=", "){ stringstream s;
    for(auto x : v) s << del << x; return s.str().substr(del.size());
}
template<typename T>
ostream& operator<<(ostream& o, const vector<T>&v){
    if(v.size()) o << "[" << join(v) << "]"; return o;
}
template<typename T>
ostream& operator<<(ostream& o, const vector<vector<T> >&vv){
    int l = vv.size();
    if(l){ o<<endl; rep(i,l) o << (i==0 ? "[ " : ",\n  " ) << vv[i] << (i==l-1 ? " ]" : ""); }
    return o;
}
inline void _debug(){cerr<<endl;}
template<class First, class... Rest>
void _debug(const First& first, const Rest&... rest){cerr<<first<<" ";_debug(rest...);}

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

const double PI = (1*acos(0.0));
const double EPS = 1e-9;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const ll mod = 1e9 + 7;

inline void finput(string filename) {
    freopen(filename.c_str(), "r", stdin);
}

int main(){
    ios_base::sync_with_stdio(0);
    // finput("./input");
    int n, k; cin >> n >> k;
    mint ans = 0;
    vl cs(n+2);
    rep(i,n+2) cs[i+1] = cs[i] + (i+1);
    REP(i,k,n+2){
        ans += mint(cs[n+1] - cs[n+1-i] - cs[i] + 1);
    }
    cout << ans.x << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:5: error: 'mint' was not declared in this scope; did you mean 'uint'?
   53 |     mint ans = 0;
      |     ^~~~
      |     uint
a.cc:57:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   57 |         ans += mint(cs[n+1] - cs[n+1-i] - cs[i] + 1);
      |         ^~~
      |         abs
a.cc:59:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   59 |     cout << ans.x << endl;
      |             ^~~
      |             abs
Language: C

#include<stdio.h>
int main(void){
  int nNum;
  int chosenNum;
  int count = 0;
  int i;
  int indpNum[nNum - chosenNum];
  int fase = chosenNum;
  int min[200000];
  int max[200000];
  int sum;
  
  
  
  scanf("%d %d",&nNum,&chosenNum);
  
  
  
  for(fase=chosenNum;fase< ;fase++){
  
    min[fase] = 0+1+2;
  
    max[fase] = 1+2+3;
  
  indpNum[fase] = max[fase] - min[fase] +1 ;
  }
  
  for(fase=chosenNum;fase< ;fase++){
    sum += indpNum[fase];
  }
  
  
  printf("%d",sum);

}

Compiler output:
main.c: In function 'main':
main.c:19:28: error: expected expression before ';' token
   19 |   for(fase=chosenNum;fase< ;fase++){
      |                            ^
main.c:28:28: error: expected expression before ';' token
   28 |   for(fase=chosenNum;fase< ;fase++){
      |                            ^
Language: C++


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

int main() {
  int64_t N=0;
  int64_t K=0
  cin>>N>>K;
  int64_t total=0;
  for(int64_t i=K; i<N+2; i++){
    total+=N*i-i*(i-1)+1;
  }
  total %=1000000007LL;
  cout<< total;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'cin'
    8 |   cin>>N>>K;
      |   ^~~
Language: C++

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

int main() {
  int N,K;
  cin >> N >> K;
  long long a=0;
  for(int i=K; i<=N+1; i++){
    a+=(((2*N-i+1)*i)/2)-((i*(i-1))/2);
  }
 b = a%(1000000007);
  cout << b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:2: error: 'b' was not declared in this scope
   11 |  b = a%(1000000007);
      |  ^
Language: C++

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

typedef long long int ll;
typedef pair<int,int> pii;
const int mod = 1e9+7;

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

    ll ans = 0;
    for(ll i = k; i <= n + 1; i++){
        ans += i * (n - i + 1) + 1;
        ans %= MOD;
    }

    cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'MOD' was not declared in this scope
   15 |         ans %= MOD;
      |                ^~~
Language: C++

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

int main() {
  int N,K;
  cin >> N >> K;
  long long a=0;
  for(int i=K; i<=N+1; i++){
    a+=(((2*N-i+1)*i)/2)-((i*(i-1))/2);
  }
  int b = a%(pow(10,9)+7);
  cout << b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   11 |   int b = a%(pow(10,9)+7);
      |           ~^~~~~~~~~~~~~~
      |           |           |
      |           |           __gnu_cxx::__promote<double>::__type {aka double}
      |           long long int
Language: C

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REP1(i,n) for(int i = 1; i < n+1 ;i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)(x).size())
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
typedef long long ll;
using p = pair<int, int>;
using P = pair<ll, ll>;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
using Graph = VV;
const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){
    COMinit();
    ios::sync_with_stdio(false); cin.tie(0);
    int n,k;
    cin >> n >> k;
    ll ans = 0;
    FOR(i,k,n+2){
        if(k == n+1) ans++;
        else{
            ans+=i*(2*n-i+1)/2 - i*(i-1)/2;
        }
    }
    cout << ans << endl;


}
 

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

#include<bits/stdc++.h>
using namespace std;
int plus(int s){
  return s-1+((s==1)?0:plus(s-1));
}
int minus(int s,int k){
  return s+((k==1)?0:minus(s-1,k-1));
}
int func(int N,int K){
  return minus(N,K)-plus(K)+1+((N-K-1)?func(N,K++):1);
}
int main(){
  int N, K;
  cin >> N >> K;
  long As = ((N-K-1)?func(N,K):1);
  cout << As;
}

Compiler output:
a.cc: In function 'int plus(int)':
a.cc:4:24: error: reference to 'plus' is ambiguous
    4 |   return s-1+((s==1)?0:plus(s-1));
      |                        ^~~~
In file included from /usr/include/c++/14/string:49,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:3:5: note:                 'int plus(int)'
    3 | int plus(int s){
      |     ^~~~
a.cc: In function 'int minus(int, int)':
a.cc:7:22: error: reference to 'minus' is ambiguous
    7 |   return s+((k==1)?0:minus(s-1,k-1));
      |                      ^~~~~
/usr/include/c++/14/bits/stl_function.h:163:12: note: candidates are: 'template<class _Tp> struct std::minus'
  163 |     struct minus;
      |            ^~~~~
a.cc:6:5: note:                 'int minus(int, int)'
    6 | int minus(int s,int k){
      |     ^~~~~
a.cc: In function 'int func(int, int)':
a.cc:10:10: error: reference to 'minus' is ambiguous
   10 |   return minus(N,K)-plus(K)+1+((N-K-1)?func(N,K++):1);
      |          ^~~~~
/usr/include/c++/14/bits/stl_function.h:163:12: note: candidates are: 'template<class _Tp> struct std::minus'
  163 |     struct minus;
      |            ^~~~~
a.cc:6:5: note:                 'int minus(int, int)'
    6 | int minus(int s,int k){
      |     ^~~~~
a.cc:10:21: error: reference to 'plus' is ambiguous
   10 |   return minus(N,K)-plus(K)+1+((N-K-1)?func(N,K++):1);
      |                     ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:3:5: note:                 'int plus(int)'
    3 | int plus(int s){
      |     ^~~~
Language: C

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <iomanip>
using namespace std;
#define int long long


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

    int n,k; cin >> n >> k;
    int ans = 0;
    int x = 1000000007;

    for(int i = k;i < n+2;i ++){
        int sum = 0;
        int SUM = 0;
        
        sum = (i-1) * i / 2;
        SUM = (2 * n - i + 1) * i / 2;

        ans += SUM - sum + 1;
        ans %= x;
    }

    cout << ans << endl;
}



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

#include<bits/stdc++.h>
using namespace std;
int plus(int s){
  return s-1+((s==1?)0:plus(s-1));
}
int minus(int s,int k){
  return s+((k==1?)0:minus(s-1,k-1));
}
int func(int N,int K){
  return minus(N,K)-plus(K)+1+((N-K-1)?func(N,K++):1);
}
int main(){
  int N, K;
  cin >> N >> K;
  long As = ((N-K-1)?func(N,K):1);
  cout << As;
}

Compiler output:
a.cc: In function 'int plus(int)':
a.cc:4:21: error: expected primary-expression before ')' token
    4 |   return s-1+((s==1?)0:plus(s-1));
      |                     ^
a.cc:4:21: error: expected ':' before ')' token
    4 |   return s-1+((s==1?)0:plus(s-1));
      |                     ^
      |                     :
a.cc:4:21: error: expected primary-expression before ')' token
a.cc:4:22: error: expected ')' before numeric constant
    4 |   return s-1+((s==1?)0:plus(s-1));
      |              ~       ^
      |                      )
a.cc: In function 'int minus(int, int)':
a.cc:7:19: error: expected primary-expression before ')' token
    7 |   return s+((k==1?)0:minus(s-1,k-1));
      |                   ^
a.cc:7:19: error: expected ':' before ')' token
    7 |   return s+((k==1?)0:minus(s-1,k-1));
      |                   ^
      |                   :
a.cc:7:19: error: expected primary-expression before ')' token
a.cc:7:20: error: expected ')' before numeric constant
    7 |   return s+((k==1?)0:minus(s-1,k-1));
      |            ~       ^
      |                    )
a.cc: In function 'int func(int, int)':
a.cc:10:10: error: reference to 'minus' is ambiguous
   10 |   return minus(N,K)-plus(K)+1+((N-K-1)?func(N,K++):1);
      |          ^~~~~
In file included from /usr/include/c++/14/string:49,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_function.h:163:12: note: candidates are: 'template<class _Tp> struct std::minus'
  163 |     struct minus;
      |            ^~~~~
a.cc:6:5: note:                 'int minus(int, int)'
    6 | int minus(int s,int k){
      |     ^~~~~
a.cc:10:21: error: reference to 'plus' is ambiguous
   10 |   return minus(N,K)-plus(K)+1+((N-K-1)?func(N,K++):1);
      |                     ^~~~
/usr/include/c++/14/bits/stl_function.h:160:12: note: candidates are: 'template<class _Tp> struct std::plus'
  160 |     struct plus;
      |            ^~~~
a.cc:3:5: note:                 'int plus(int)'
    3 | int plus(int s){
      |     ^~~~
Language: C

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};
 
mint f(int n) {
  if (n == 0) return 1;
  mint x = f(n/2);
  x *= x;
  if (n%2 == 1) x *= 2;
  return x;
}
 
mint choose(int n, int a) {
  mint x = 1, y = 1;
  rep(i,a) {
    x *= n-i;
    y *= i+1;
  }
  return x / y;
}
 
int main() {
  int n, k;
  cin >> n >> k;
  // mint ans = f(n);
  // ans -= 1;
  // ans -= choose(n,a);
  // cout << choose(n,b).x << endl;
  // ans -= choose(n,b);
  // cout << ans.x << endl;
  // return 0;
  //各Kについていくつ組み合わせが存在するか調べる　最小値と最大値が分かればその間の数は必ず作れる気がする 
  vector<mint> a(n + 1);
  vector<mint> b(n + 1);
  rep(i, n + 1)a[i] = i;
  for(int i = n; i > 0; i--)b[n - i] = i;
  mint ans = 0;
  for(int i = k; i <= n + 1; i++){
    mint min = ( a[0] + a[i - 1]) / 2;
    min *= i;
    mint max = (b[0] + b[i - 1]) / 2;
    max *= i;
    ans += max - min + 1;
  }
  cout << ans.x << endl;
}

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

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
template <class T> void chmin(T &a, const T &b) noexcept { if (b < a) a = b; }
template <class T> void chmax(T &a, const T &b) noexcept { if (a < b) a = b; }
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cout << H << " "; debug_out(T...); }
#ifdef _DEBUG
  #define debug(...) debug_out(__VA_ARGS__)
#else
  #define debug(...) 
#endif

const int mod = 1000000007;
// const int mod = 998244353;
struct mint {
  ll x;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  ll n, k;
  cin >> n >> k;
  mint ans(0);
  mint itrmin = 0, itrmax = n;
  mint mini = 0, maxi = 0;
  rep(i,k) {
    mini += itrmin;
    maxi += itrmax;
    itrmin += 1;
    itrmax -= 1;
  }
  for (ll i = k; i <= n+1; ++i) {
    ans += maxi - mini + 1;
    mini += itrmin;
    maxi += itrmax;
    itrmin += 1;
    itrmax -= 1;
  }
  cout << ans << endl;
  return 0;
}

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

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

const long long MOD = 1000000007;
const int MAX_C = 20001;
long long Com[MAX_C][MAX_C];

int main()
{
  ll n, k;
  cin >> n >> k;
  vector<ll> dp = {};
  dp.resize(n, 0);

  // 累積和
  for (auto i = 0; i < n + 1; i++)
  {
    if (i != 0)
    {
      dp[i] = (dp[i - 1] + i) % MOD;
    }
  }

  ll total = 0;
  for (auto i = k; i < n + 1; i++)
  {
    auto max = dp[n] - dp[n - i];
    auto min = dp[i - 1];
    auto val = max - min + 1;
    if (val < 0)
      val += MOD;
    total += val;
    total %= MOD;
  }

  total += 1;
  total %= MOD;
  cout << total << endl;
  return 0;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include "bits/stdc++.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

public class Main {

	static final int MOD = 1000000007;
	static int N;
	static int K;
	static int ans = 0;
	static int[][] memo = new int[N+2][Integer.MAX_VLUE];
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		K = sc.nextInt();
		dfs(0, 0, 0);
		System.out.println(ans);
	}

	static int dfs(int i, int sum, int count) {


		if (count >= K && memo[i][sum] == 0) {
			ans++;
			ans %= MOD;
			memo[i][sum] = 1;
		}

		if (i > N)
			return 0;

		dfs(i+1, sum+i, count+1);
		
		dfs(i+1, sum, count);

		return -1;
	}
}

Compiler output:
Main.java:9: error: cannot find symbol
	static int[][] memo = new int[N+2][Integer.MAX_VLUE];
	                                          ^
  symbol:   variable MAX_VLUE
  location: class Integer
1 error
Language: C++

#include<iostream>
using namespace std;
int main(){
	int N,K,pro;
	unsigned long int sum;
	cin>>N>>K;
	for(int i=K;i<=N+1;i++){
		pro=1;
		cou=0;
		for(int t=1;t<=i;t++){
			pro*=(N+t-i)/t;
		}
		sum+=pro;
		sum%=1000000007;
	}
	cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'cou' was not declared in this scope
    9 |                 cou=0;
      |                 ^~~
Language: C

#include <bits/stdc++.h>

#define st              first
#define nd              second
#define pb              push_back
#define lwb             lower_bound
#define upb             upper_bound
#define all(a)          (a).begin(), (a).end()
#define Reset(s, n)     memset(s, n, sizeof(s))
#define Sz(a)           int((a).size())
#define Max(a, b, c)    max(max((ll)(a), (ll)(b)), (ll)(c))
#define Min(a, b, c)    min(min((ll)(a), (ll)(b)), (ll)(c))
#define Unique(a)       (a).resize(unique(all(a)) - (a).begin())
#define bit(n, i)       (((n) >> (i)) & 1)
#define cntbit(n)       __builtin_popcountll(n)

using namespace std;

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;

const int MOD = 1e9 + 7;
const ll INF = 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-12;
inline bool isPrime (ll x){ if(x <= 1) return 0; if(x <= 3) return 1; if (!(x % 2) || !(x % 3)) return 0; ll s = sqrt(1.0 * x) + EPS; for(ll i = 5; i <= s; i += 6){if (!(x % i) || !(x % (i + 2))) return 0;}return 1;}
inline ll fpow(ll n, ll k, ll p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
inline int inv(int a, ll p = MOD) {return fpow(a, p - 2, p);}
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline void onbit(ll &a, int i){a |= 1LL << i;}
inline void offbit(ll &a, int i){onbit(a, i), a -= (1LL << i);}

const int N = 1e6 + 5;

ll n, m, k;
ll a[N], b[N];

void solve(){
   cin >> n >> k;
   ll res = 0;
   n++;
   for(int i = 1; i <= n; i++){
      a[i] = i;
      a[i] = a[i - 1] + a[i];
   }
   for(int i = k; i <= n; i++){
      res += a[n] - a[n - i] - a[i] + 1;
      res %= MOD;
   }
   cout << res << "\n";

}

int main(){
   ios_base::sync_with_stdio(0);
   cin.tie(0); cout.tie(0);
   cout << fixed << setprecision(10);
   //    freopen("input.txt", "r", stdin);
   //    freopen("output.txt", "w", stdout);
   int query = 1;
   // cin >> query;
   int start = 1000 * clock() / CLOCKS_PER_SEC;
   while(query--) solve();
   cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC  - start << "ms\n";
}


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

#include<bits/stdc++.h>
using namespace std;
int mod=1000000007;
#define ll long long
int main(){
	ll n,k;
	cin>>n>>k;
	ll ans=0;
	for(int i=k;i<=(n+1);i++){
		ans = (ans+(((n*(n+1))%mod)/2)%mod+1-(((i*(i-1))%mod)/2)%mod-((((n+1-i)*(n-i))%mod)/2)%mod)%mod;
	//cout<<ans<<endl;
	}
	cout<<ans;
	return 0;
}

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

#include <iostream>
using namespace std;

// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};


const int MOD = 1000000007;
using mint = Fp<MOD>;

int main() {
  
  int a, b;
  cin >> a >> b;
  mint n = a;
  mint k = b;
  long long ans;
  for (int i = a; i < a+b; i++) {
  	long long c = n*k -k*k + k + 1
    ans += c;
  }
  long long c = ans;
    cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:36: error: cannot convert 'Fp<1000000007>' to 'long long int' in initialization
   73 |         long long c = n*k -k*k + k + 1
      |                       ~~~~~~~~~~~~~^~~
      |                                    |
      |                                    Fp<1000000007>
Language: C++

#include<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
#include<vector>
#include<map>
#include<queue>
#include<cmath>
using namespace std;
using ll = long long int;
typedef pair<int,int> P;
 
 const ll P=1000000007;
ll KurikaeshiJijou(long long int n,long long int s, long long int m){
	if(s==0) return 1;
	if(s%2==0){
		long long int t= (KurikaeshiJijou(n,s/2,m))%m;
		return ((t%m)*(t%m))%m;	
	}else{
		return (n * KurikaeshiJijou(n,s-1,m))%m;
	}
}

ll comb(int n,int k){
    long long int x=1;
	long long int y=1;
	for(int s=0;s<k;s++){
		x=(x*(n-s))%P;
		y=(y*(s+1))%P;
	}
	x=(x*(KurikaeshiJijou(y,P-2,P)))%P;
    return x;
}


const ll d=226732710;
int main(void){
   int N,K;
   cin >> N >> K;
   N++;
   ll ans=0;
    for(int i=1;i<=K;i++){
        ans+=comb(N,i);
        if(ans>P)ans%=P;
    }
    cout << ans << endl;
}

Compiler output:
a.cc:13:11: error: 'const ll P' redeclared as different kind of entity
   13 |  const ll P=1000000007;
      |           ^
a.cc:11:23: note: previous declaration 'typedef struct std::pair<int, int> P'
   11 | typedef pair<int,int> P;
      |                       ^
a.cc: In function 'll comb(int, int)':
a.cc:28:30: error: expected primary-expression before ';' token
   28 |                 x=(x*(n-s))%P;
      |                              ^
a.cc:29:30: error: expected primary-expression before ';' token
   29 |                 y=(y*(s+1))%P;
      |                              ^
a.cc:31:34: error: expected primary-expression before '-' token
   31 |         x=(x*(KurikaeshiJijou(y,P-2,P)))%P;
      |                                  ^
a.cc:31:38: error: expected primary-expression before ')' token
   31 |         x=(x*(KurikaeshiJijou(y,P-2,P)))%P;
      |                                      ^
a.cc:31:43: error: expected primary-expression before ';' token
   31 |         x=(x*(KurikaeshiJijou(y,P-2,P)))%P;
      |                                           ^
a.cc: In function 'int main()':
a.cc:44:17: error: expected primary-expression before ')' token
   44 |         if(ans>P)ans%=P;
      |                 ^
a.cc:44:24: error: expected primary-expression before ';' token
   44 |         if(ans>P)ans%=P;
      |                        ^
Language: C++

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

int main() {
    int N,K;
    cin >> N >> K;
    int X =0;
    for (i = K; i<=N+1; i++){
        X += (
            N*i-n*(n+1)/2-(i*(i-1))/2+1
        );
    }
        cout << X << endl;

    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'i' was not declared in this scope
    8 |     for (i = K; i<=N+1; i++){
      |          ^
a.cc:10:17: error: 'n' was not declared in this scope
   10 |             N*i-n*(n+1)/2-(i*(i-1))/2+1
      |                 ^
Language: C++

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

int main() {
  int N,K;
  cin >> N >> K;
  long long a=0;
  for(int i=K; i<=N+1; i++){
    a+=(((2*N-i+1)*i)/2)-((i*(i-1))/2);
  }
  cout << a%(pow(10,9)+7) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   11 |   cout << a%(pow(10,9)+7) << endl;
      |           ~^~~~~~~~~~~~~~
      |           |           |
      |           |           __gnu_cxx::__promote<double>::__type {aka double}
      |           long long int
Language: C

#include<algorithm>
#include<iostream>
#include<stdio.h>
#include<iostream>
#include<stdio.h>
#include<vector>
#include<set>
#include<string>
#include<iomanip>
#include<queue>
#include<functional>
#include<cmath>
#include<map>
#define rep(i,n) for(int i=0; i<(int)n; i++)//n回繰り返す
using namespace std;
using ll = long long;
using P = pair<int, int>;
using graph = vector<vector<int>>;
const ll mod = 10 ^ 9 + 7;
ll modw(int N, int K);

int main() {
    int N, K; cin >> N >> K;
    cout << modw(N,K) << endl;
   

}
ll modw(int N, int K) {
    ll ans = 0, s = (N - K) * (N - K + 1) / 2, b = N * (N + 1) / 2 - s;
    while (K <= N) {
        ans += (b - s);
        b += (N - K);
        s -= (N - K);
        K++;
        ans %= mod;
    }
    return ans;
}

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

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

int main(){ 
    Int N, K, p, A, B, C, BtimesC, 6ans, 6inv;

    cin >> N >> K;
    p = 1000000007;

    A = N + 2 - K;
    B = N + 1 - K;
    C = (N + 2 * K) % p;

    BtimesC = (B * C) % p;

    6ans = ((BtimesC + 6) * A) % p;


    vector<Int> L(10);

    L[1] = 6;
    rep1(i,9) {
        L[i+1] = (((((L[i] * L[i]) % p) * L[i]) % p) * L[i] * L[i] * L[i] * L[i] * L[i] * L[i] * L[i]) % p;
    }

    6inv = (L[9] * 6 * 6 * 6 * 6 * 6) % p;

    cout << 6ans * 6inv % p << endl;







}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:36: error: expected unqualified-id before numeric constant
    8 |     Int N, K, p, A, B, C, BtimesC, 6ans, 6inv;
      |                                    ^~~~
a.cc:19:5: error: unable to find numeric literal operator 'operator""ans'
   19 |     6ans = ((BtimesC + 6) * A) % p;
      |     ^~~~
a.cc:29:5: error: unable to find numeric literal operator 'operator""inv'
   29 |     6inv = (L[9] * 6 * 6 * 6 * 6 * 6) % p;
      |     ^~~~
a.cc:31:13: error: unable to find numeric literal operator 'operator""ans'
   31 |     cout << 6ans * 6inv % p << endl;
      |             ^~~~
a.cc:31:20: error: unable to find numeric literal operator 'operator""inv'
   31 |     cout << 6ans * 6inv % p << endl;
      |                    ^~~~
Language: C++

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

int main() {
  int N,K;
  long long int R = 1, F = 1,A,sum;
  cin >> N >> K;
  for( int i= 1 ; i < k ; i++ ){
      F *=i;
    }
  for(int l = K;l >= K; l++){
    for( int i= N+1 ; i >= (N-l) ; i-- ){
      R *=i;
    }
    F *=(l+1);
    A = R/F;
    sum += A;
  }
  cout << sum << endl;
}


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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define pb push_back
const int maxn = 10000;
const int INF32 = 1'050'000'000;
const long long INF64 = 4'000'000'000'000'000'000;
const int MOD7 = 1'000'000'007;
const int MOD9 = 1'000'000'009;

void ERROR(int num) { printf("ERROR%d!\n",num); }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
int dx[8]={-1,0,1,0,1,1,-1,-1};
int dy[8]={0,-1,0,1,1,-1,1,-1};

vector<ll> vec;
vector<ll> sum, sum2;

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

	if(K >= N){
		cout << 1 << endl;
		return 0;
	}

	vec.resize(N+1);
	for(ll i = 0; i < N+1; i++){
		vec[i] = i; //% MOD7;
	}
	
	ll front_sum = 0;
	rep(i,K){
		front_sum = (front_sum + vec[i]) % MOD7;
	}
	ll back_sum = 0;
	rep(i,K){
		back_sum = (back_sum + vec[N-i]) % MOD7;
	}
	ll total = (back_sum - front_sum + 1) % MOD7;

	for(int i = K; i <= N; i++){
		front_sum = (front_sum + vec[i]) % MOD7;
		back_sum = (back_sum + vec[N-i]) % MOD7;
		total = (total + (back_sum - front_sum)%MOD7 + 1))%MOD7  % MOD7;
		//cout << total << endl;
	}
	cout << total << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:66: error: expected ';' before ')' token
   47 |                 total = (total + (back_sum - front_sum)%MOD7 + 1))%MOD7  % MOD7;
      |                                                                  ^
      |                                                                  ;
Language: Java

import java.util.*;

public class Main {
	//途中まで
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        long n = scan.nextLong();
        long k = scan.nextLong();
        long count = 0;
        long sum = 0;
        
		List<Long> list = new ArrayList<Long>(); 
		//listに計算した合計値をaddしていく
      
        //２個選ぶ
        for(int i=0; i<n+1; i++){
        for(int j=i+1; j<n+1; j++){
        	list.add(2*Math.pow(10,100)+i+j);
        }
        }

        List<Long> listB = new ArrayList<Long>(new HashSet<>(list));
        System.out.println("ListB = " + listB);

        //３個選ぶ
        for(int i=0; i<n+1; i++){
        for(int j=i+1; j<n+1; j++){
        for(int s=j+1; s<n+1; s++){
        	list.add(3*Math.pow(10,100)+i+j+s);
        }
        }
        }

        List<Long> listC = new ArrayList<Long>(new HashSet<>(list));
        System.out.println("ListC = " + listC);

	    scan.close();	
    }
    

}

Compiler output:
Main.java:19: error: incompatible types: double cannot be converted to Long
        	list.add(2*Math.pow(10,100)+i+j);
        	                             ^
Main.java:30: error: incompatible types: double cannot be converted to Long
        	list.add(3*Math.pow(10,100)+i+j+s);
        	                               ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: C

#include<bits/stdc++.h>
using namespace std;
long long n,k,ans=0;
int main()
{
	cin>>n>>k;
	if (k>n){
		cout<<1<<endl;
		return 0;
	} 
	for (long long i=k;i<=n;i++){
		int tempmin=0,tempmax=0;
		for (long long j=1;j<i;j++) tempmin=(tempmin+j)%(1000000000+7);
		for (long long j=(n-i+1);j<=n;j++) tempmax=(tempmax+j)%(1000000000+7);
		ans+=(tempmax-tempmin+1);
		ans%=(1000000000+7);
	}
	cout<<(ans+1)%(1000000000+7)<<endl;
	return 0;
}

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

#include<iostream>
using namespace std;
int main(){
long long N,K;
  cin>>N>>K;
  long long asum=0;
  long long bsum=0;
  long long csum=0;
  for (long long j=K;j<=N+1; j++){csum+=j*(N-j+1)
  }
  cout<<csum%1000000007<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:50: error: expected ';' before '}' token
    9 |   for (long long j=K;j<=N+1; j++){csum+=j*(N-j+1)
      |                                                  ^
      |                                                  ;
   10 |   }
      |   ~
Language: Java

import java.util.*;

public class Main {
	//途中まで
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        long n = scan.nextLong();
        long k = scan.nextLong();
        long count = 0;
        long sum = 0;
        
		List<Long> list = new ArrayList<Long>(); 
		//listに計算した合計値をaddしていく
      
        //２個選ぶ
        for(int i=0; i<n+1; i++){
        for(int j=i+1; j<n+1; j++){
        	list.add(2*Math.pow(10,100)+i+j);
        }
        }

        List<Long> listB = new ArrayList<Long>(new HashSet<>(list));
        System.out.println("ListB = " + listB);

        //３個選ぶ
        for(int i=0; i<n+1; i++){
        for(int j=i+1; j<n+1; j++){
        for(int s=j+1; s<n+1; s++){
        	list.add(3*2*Math.pow(10,100)+i+j+s);
        }
        }
        }

        List<Long> listC = new ArrayList<Long>(new HashSet<>(list));
        System.out.println("ListC = " + listC);

	    scan.close();	
    }
    

}

Compiler output:
Main.java:19: error: incompatible types: double cannot be converted to Long
        	list.add(2*Math.pow(10,100)+i+j);
        	                             ^
Main.java:30: error: incompatible types: double cannot be converted to Long
        	list.add(3*2*Math.pow(10,100)+i+j+s);
        	                                 ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: C++

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

int main() {
  int N,K;
  long long int R = 1, F = 1,A,sum;
  cin >> N >> K;
  for( int i= 1 ; i < k ; i++ ){
      F *=i;
    }
  for(int l = K;l >= K; l++){
    for( int i= N+1 ; i >= (N-l) ; i-- ){
      R *=i;
    }
    F *=(l+1)
    A = R/F;
    sum += A;
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: 'k' was not declared in this scope
    8 |   for( int i= 1 ; i < k ; i++ ){
      |                       ^
a.cc:15:14: error: expected ';' before 'A'
   15 |     F *=(l+1)
      |              ^
      |              ;
   16 |     A = R/F;
      |     ~
Language: C

#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	int n, k;
	cin >> n >> k;
	if(k-n==1){
		cout << 1;
		return 0;
	}
	cout << n << " " <<k<< endl;
	long long int a1=0;
	long long int b1=n;
	long long int a2=0;
	long long int b2=n;
	long long int sum=0;
	long long int m=1000000007;

	if(k==1){
		for(int i=k; i<n+1; i++){
				a2=a1+i;
				b2=b1+n-i;
				sum=(sum-a2+b2+1)%m;
				a1=a2;
				b1=b2;
				cout << a1 << " " <<b1 << endl;
		}
		
		cout << sum;
	    return 0;
	}
	for(int i=1; i<k-1; i++){
		a1=a1+i;
		b1=b1+n-i;
	}
	cout << a1 << " " <<b1<< endl;
	for(int i=k-1; i<n+1; i++){
		a2=a1+i;
		b2=b1+n-i;
		sum=(sum-a2+b2+1)%m;
		a1=a2;
		b1=b2;
	}
	cout << sum;
    return 0;
}

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

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

const int mod = 1e9 + 7;
long long calc(long long a, long long b, long long p)
{
	if (b == 0) return 1;
	if (b % 2 == 0)
	{
		long long d = calc(a, b / 2, p);
		return (d * d) % p;
	}
	else
		return (a * calc(a, b - 1, p)) % p;
}
long long nCr(int n, int r) {
  if ( r * 2 > n ) r = n - r;
  long long dividend = 1;
  long long divisor  = 1;
  for (int i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
	dividend %= mod;
	divisor  *= i;
	divisor %= mod;
  }
  return dividend * calc(divisor, mod - 2, mod) % mod;
}
signed main(void)
{
	long long n, k;
	long long sum, ans;
	cin >> n >> k;
	ans = 0;
	for(int i = k; i <= n; i++)
	{
		if (i % 2 != 0)
			sum = i * (i - 1) / 2;
		else
			sum = i * (i / 2 - 1) + (i / 2);
		ans += (2 * n + 1 - i) * i / 2  - sum + 1;
		cout << sum << endl;
		//ans += (((2 * n + 1 - k) * k)% mod * (2, mod - 2, mod) - n - sum + 1) % mod;
	}
		if ((n + 1) % 2 != 0)
			sum = (n + 1) * n / 2;
		else
			sum = (n + 1) * ((n + 1) / 2 - 1) + ((n + 1) / 2);
	ans += (2 * n + 1 - n) * n / 2  - sum + 1;
	cout << ans << endl;
	return 0;
}


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