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

from itertools import permutations, combinations

N,K = map(int,input().split())

ans = 0
_list = list(range(N+1))
_list.sort(reverse = True)
h = 0
l = 0
cnt = -1

for i in range(N+1):
    h += _list[i]
    cnt += 1
    l += cnt
    if i >= K-1:
        ans += h - l + 1
        
print(ans%(10**9 + 7))

Compiler output:
main.c:1:1: error: unknown type name 'from'
    1 | from itertools import permutations, combinations
      | ^~~~
main.c:1:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    1 | from itertools import permutations, combinations
      |                ^~~~~~
main.c:1:16: error: unknown type name 'import'
Language: C

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

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

import java.util.*;
import java.io.*;
  public class Task {
     
static BufferedReader s1;
static BufferedWriter out;
static String read() throws IOException{String line="";while(line.length()==0){line=s1.readLine();continue;}return line;}
static int int_v (String s1){return Integer.parseInt(s1);}
static long long_v(String s1){return Long.parseLong(s1);}
static int[] int_arr() throws IOException{String[] a=read().split(" ");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}
static long[] long_arr() throws IOException{String[] a=read().split(" ");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}
static void assign(){s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}

  public static void main(String args[]) throws  IOException {
        assign();
        int t=1;//int_v(read());
        while(t--!=0){
            int[] n1=int_arr();
            int n=n1[0],k=n1[1];
            long[] pre=new long[n+1];
            long s=0,mod=(long)1e9+7,res=0;
            for(int i=1;i<=n;i++){s+=i;pre[i]=pre[i-1]+i;}
            for(int i=k;i<=n;i++){
                long min=pre[i-1],max=s-pre[n-i];
                res+=max-min+1;
            }
            out.write(((res+1)%mod)+"\n"); //0 1 2 3 ,5+4

        }
             out.flush();
    }
           
}


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

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

ll n, k, sum = 1, mod = 1000000007;

ll gauss(ll n)
{
    return (n * (n + 1) / 2) % mod;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin >> n >> k;
    while (k <= n)
    {
        ll min = gauss(k - 1);
        ll max = (gauss(n) - gauss(n - k) + mod) % mod;
        sum += (max - min + 1 + mod) % mod;
        k++;
    }

    cout << sum % mod;
    cin >> 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

def resolve():
    m = 10**9 + 7
    ans = 0
    n, k = map(int, input().split())
    for i in range(k, n+2):
        low = i*(i-1)//2
        high = i*(2*n - i + 1)//2
        ans += (high - low + 1)
    ans %= m
    print(ans)
resolve()

Compiler output:
main.c:1:1: error: unknown type name 'def'
    1 | def resolve():
      | ^~~
main.c: In function 'resolve':
main.c:1:14: error: expected declaration specifiers before ':' token
    1 | def resolve():
      |              ^
Language: C

#include <iostream>
#include <vector>
#include <tuple>
#include <fstream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#define REP(i, n) for(int i = 0; i < n; i++)
using ll = long long;
using namespace std;


int main() {

  cin.tie(0);
  ios::sync_with_stdio(false);

  ll n,k,ans=0, tmp;
  cin >> n >> k;

  for(ll i = k; i < n+2; i++){
    tmp = i * (n-i + 1) + 1;
    ans += tmp;
  }
  
  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>
#define cout16 cout << setprecision(16) 
#define rep(i,n) for(int i=0;i<n;i++ )
#define rep2(i,f,n) for(int i=f;i<n;i++ )
#define SORT(A) sort(A.begin(),A.end())
#define REV(A) reverse(A.begin(),A.end())
typedef long long int ll;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vll = std::vector<ll>;
using vvll = std::vector<std::vector<ll>>;
using P = std::pair<int,int>;
using vp = std::vector<P>;
using namespace std;
#define INF 1001001001
#define LL_INF 1001001001001001001
#define fi first
#define se second
// 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;
//const int mod = 998244353;
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 { 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, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
int main(void) {
	ll n,k; cin >> n >> k;
	mint ans = 0;
	for(ll i=k; i<=n+1; i++){
		ll mn = i*(i-1)/2;
		ll mx = n*(n+1)/2 - (n-i)*(n-i+1)/2;
		ans = ans+mx-mn+1;
	}
	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>
#define cout16 cout << setprecision(16) 
#define rep(i,n) for(int i=0;i<n;i++ )
#define rep2(i,f,n) for(int i=f;i<n;i++ )
#define SORT(A) sort(A.begin(),A.end())
#define REV(A) reverse(A.begin(),A.end())
typedef long long int ll;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vll = std::vector<ll>;
using vvll = std::vector<std::vector<ll>>;
using P = std::pair<int,int>;
using vp = std::vector<P>;
using namespace std;
#define INF 1001001001
#define LL_INF 1001001001001001001
#define fi first
#define se second
// 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;
//const int mod = 998244353;
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 { 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, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
int main(void) {
	ll n,k; cin >> n >> k;
	mint ans = 0;
	for(ll i=k; i<=n+1; i++){
		ll mn = i*(i-1)/2;
		ll mx = n*(n+1)/2 - (n-i)*(n-i+1)/2;
		ans += mx-mn+1;
	}
	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 main(){
	int n, k;
	cin >> n >> k;
	long long sum = 0;
	long long mod = 1e9 + 7;
	for(int i = k; i <= n + 1; i++){
		long long maxi, mini;
		mini = i * (i - 1)/2;
		maxi = n * i - mini;
		sum += maxi - mini + 1;

	}
	cout << sum % mod <<  '\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;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
ll N, K;

int main()
{
    cin >> N >> K;
    ll ans = 0;
    for (ll i = K; i <= N + 1; i++)
    {
        ll minsum = i * (i - 1) / 2;
        minsum %= MOD;
        ll maxsum = (N + (N - i + 1)) * i / 2;
        maxsum %= MOD;
        ans += (MOD + maxsum - minsum + 1) % MOD;
        ans %= MOD;
    }
    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;

#define rep(i, a, b) for(long long int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define mod 1000000007
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
void solution(){
    int n,m;cin>>m>>n;
    long long int sum=0;
    rep(i,n,m+2){
    ll y= (i*(m + 1 -i))%mod +1;
    sum =(sum%mod + y%mod)%mod;
    }
    cout<<sum%mod<<endl;
}

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);
	solution();
	}
	return 0;
}

Compiler output:
a.cc:27:9: error: expected unqualified-id before 'return'
   27 |         return 0;
      |         ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
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 REPR(i, n) for(int (i) = (n); (i) >= 0; --(i))
#define FOR(i, n, m) for(int (i) = (n); (i) < (m); ++(i))

constexpr int INF = 1e9;
//constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9+7;


int main(){
  int N, K;
  cin >> N >> K;
  ll maxs = 0, mins = 0;
  ll ans = 0;
  REP(i, N+1){
    mins += i;
    maxs += N-i;
    if(i+1 >= K){
      ans += maxs - mins + 1;
      ans %= mod;
    }
  }
  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;

long long int calcmin(int n, int k) {
  long long int sum = 0;
  for(int i=0; i<k; i++) {
    sum += i;
  }
  return sum;
}
long long int calcmax(int n, int k) {
  long long int sum = 0;
  for(int i=n; i>=n-k+1; i--) {
    sum += i;
  }
  return sum;
}

int main() {
  int n, k;
  cin >> n >> k;
  long long int sum = 0;

  int mod = 1000000000+7;
  int min = calcmin(n, k);
  int max = calcmax(n, k);
    
  for(int i=k; i<=n+1; i++) {
    sum += max - min + 1;
    sum %= mod;
    min += i+1;
    max += n+1-i;
  }
    cout << sum << endl;
}


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<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>

using namespace std;

const long long mod = 1e9+7;

long long bin(long long n, long long p)
{
  long long r =1;
  for(int i = p+1; i <= n; i++)
  {
    r *= i;
  	r %= mod;
  }
  
  for(int i = 1; i <= n-p; i++)
    r /= i;
  
  return r;
}

long long fastPow(long long base, long long exp)
{
  long long ans = 1;
  while(exp)
  {
    if(exp & 1)
      ans *= base;
    
    ans %= mod;
    exp = exp >> 1;
    base = (base*base)%mod;
  }
  
  return ans;
}

int main()
{
  long long n,k;
  cin >> n >> k;
  long long  total = fastPow(2,n+1);
  total -= max(n-2,0)*max(n-2,(long long)0);
  long long r = bin(n+1,k);
  r -= max(min(k,n)-2,(long long)0)*max(n-2,(long long)0);
  
  cout << total - r << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:15: error: no matching function for call to 'max(long long int, int)'
   46 |   total -= max(n-2,0)*max(n-2,(long long)0);
      |            ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:46:15: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   46 |   total -= max(n-2,0)*max(n-2,(long long)0);
      |            ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:46:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   46 |   total -= max(n-2,0)*max(n-2,(long long)0);
      |            ~~~^~~~~~~
Language: C++

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

const long long mod = 1e9+7;

long long bin(long long n, long long p)
{
  long long r =1;
  for(int i = p+1; i <= n; i++)
  {
    r *= i;
  	r %= mod;
  }
  
  for(int i = 1; i <= n-p; i++)
    r /= i;
  
  return r;
}

long long fastPow(long long base, long long exp)
{
  long long ans = 1;
  while(exp)
  {
    if(exp & 1)
      ans *= base;
    
    ans %= mod;
    exp = exp >> 1;
    base = (base*base)%mod;
  }
  
  return ans;
}

int main()
{
  long long n,k;
  cin >> n >> k;
  long long  total = fastPow(2,n+1);
  total -= max(n-2,0)*max(n-2,0);
  long long r = bin(n+1,k);
  r -= max(min(k,n)-2,0)*max(n-2,0);
  cout << total - r << enld;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   41 |   cin >> n >> k;
      |   ^~~
      |   std::cin
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:43:12: error: 'max' was not declared in this scope; did you mean 'std::max'?
   43 |   total -= max(n-2,0)*max(n-2,0);
      |            ^~~
      |            std::max
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:45:12: error: 'min' was not declared in this scope; did you mean 'std::min'?
   45 |   r -= max(min(k,n)-2,0)*max(n-2,0);
      |            ^~~
      |            std::min
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:46:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   46 |   cout << total - r << enld;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:46:24: error: 'enld' was not declared in this scope
   46 |   cout << total - r << enld;
      |                        ^~~~
Language: C++

#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
typedef long long ll;
ll dp(int n,int k)
{
  ll table[n+1][k+1];
  for(int i=1; i<=N; i++)
  {
    for(int j=0; j<=i; j++)
    {
      if(j==0 || j==i)
        table[i][j]=1;
      else
        table[i][j]=(table[i-1][j]%mod+table[i-1][j-1]%mod)%mod;
    }
  }
    return table[n][k];
}
      
     
 
int main()
{
  int n,k;
  cin>>n>>k;
  ll ans=dp(n+1,k);
  cout<<ans;
  return 0;
}

Compiler output:
a.cc: In function 'll dp(int, int)':
a.cc:8:19: error: 'N' was not declared in this scope
    8 |   for(int i=1; i<=N; i++)
      |                   ^
Language: C++

#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
typedef long long ll;
ll dp(int n,int k)
{
  ll table[N+1][K+1];
  for(int i=1; i<=N; i++)
  {
    for(int j=0; j<=i; j++)
    {
      if(j==0 || j==i)
        table[i][j]=1;
      else
        table[i][j]=(table[i-1][j]%mod+table[i-1][j-1]%mod)%mod;
    }
  }
    return table[n][k];
}
      
     

int main()
{
  int n,k;
  cin>>n>>k;
  ll ans=dp(n+1,k);
  cout<<ans;
  return 0;
}

Compiler output:
a.cc: In function 'll dp(int, int)':
a.cc:7:12: error: 'N' was not declared in this scope
    7 |   ll table[N+1][K+1];
      |            ^
a.cc:7:17: error: 'K' was not declared in this scope
    7 |   ll table[N+1][K+1];
      |                 ^
a.cc:13:9: error: 'table' was not declared in this scope
   13 |         table[i][j]=1;
      |         ^~~~~
a.cc:15:9: error: 'table' was not declared in this scope
   15 |         table[i][j]=(table[i-1][j]%mod+table[i-1][j-1]%mod)%mod;
      |         ^~~~~
a.cc:18:12: error: 'table' was not declared in this scope
   18 |     return table[n][k];
      |            ^~~~~
Language: C++

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

using namespace std;

const long long mod = 1e9+7;

long long bin(long long n, long long p)
{
  long long r =1;
  for(int i = p+1; i <= n; i++)
  {
    r *= i;
  	r %= mod;
  }
  
  for(int i = 1; i <= n-p; i++)
    r /= i;
  
  return r;
}

long long fastPow(long long base, long long exp)
{
  long long ans = 1;
  while(exp)
  {
    if(exp & 1)
      ans *= base;
    
    ans %= mod;
    exp = exp >> 1;
    base = (base*base)%mod;
  }
  
  return ans;
}

int main()
{
  long long n,k;
  cin >> n >> k;
  
  cout << fastPow(2,n+1) - bin(n+1,k) << enld;
}
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:45:42: error: 'enld' was not declared in this scope
   45 |   cout << fastPow(2,n+1) - bin(n+1,k) << enld;
      |                                          ^~~~
Language: C++

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

const long long mod = 1e9+7;

long long bin(long long n, long long p)
{
  long long r =1;
  for(int i = p+1; i <= n; i++)
  {
    r *= i;
  	r %= mod;
  }
  
  for(int i = 1; i <= n-p; i++)
    r /= i;
  
  return r;
}

long long fastPow(long long base, long long exp)
{
  long long ans = 1;
  while(exp)
  {
    if(exp & 1)
      ans *= base;
    
    ans %= mod;
    exp = exp >> 1;
    base = (base*base)%mod;
  }
  
  return ans;
}

int main()
{
  long long n,k;
  cin >> n >> k;
  
  cout << fastPow(2,n+1) - bin(n+1,k) << enld;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:41:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   41 |   cin >> n >> k;
      |   ^~~
      |   std::cin
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:43:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   43 |   cout << fastPow(2,n+1) - bin(n+1,k) << enld;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:43:42: error: 'enld' was not declared in this scope
   43 |   cout << fastPow(2,n+1) - bin(n+1,k) << enld;
      |                                          ^~~~
Language: C++

#include<bits/stdc++.h>
using name space std;
int main(){
  int64_t N,K<count;
  cin >> N >> K;
  count=0;
  for(int64_t i=K;i<N+2;i++)
  count += (N-i+1)*i-1;
  cout << count %1000000007 << endl;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'name'
    2 | using name space std;
      |       ^~~~
a.cc: In function 'int main()':
a.cc:4:14: error: expected initializer before '<' token
    4 |   int64_t N,K<count;
      |              ^
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> N >> K;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:15: error: 'K' was not declared in this scope
    5 |   cin >> N >> K;
      |               ^
a.cc:6:3: error: 'count' was not declared in this scope; did you mean 'std::count'?
    6 |   count=0;
      |   ^~~~~
      |   std::count
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: 'std::count' declared here
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
a.cc:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   cout << count %1000000007 << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |   cout << count %1000000007 << endl;
      |                                ^~~~
      |                                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
ll sum(ll l, ll r)
{
  return (l + r) * (r - l + 1) / 2;
}
int main()
{
  int N, K;
  cin >> N >> K;
  ll sm = 0;
  for (int i = K; i <= N + 1; i++)
  {

    sm += sum(N - i + 1, N) + 1 - sum(0, i - 1);
    sm %= MOD;
  }

  cout << sm << 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<iostream>
using namespace std;
int main(){
int N, K;
cin >> N;
cin >> K;
long long s = 0;
for (int i = K ; i <= N +1; ++i){
s += i*(N -i +1) +1;
  s = s % 1000000007;
}
  cout << s << endl;
}


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

#include <bits/stdc++.h>
#define ll long long
#define ford(i,a,b) for(int i=(a);i>=b;i--)
#define rep(i,a,b) for(int i=(a);(i)<(b);(i)++)
#define mpi map<int,int>
#define N 200005
#define pql priority_queue<ll>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
using namespace std;
ll n,k,ans;
int main() {
	cin>>n>>k;
	for(ll i=k;i<=n+1;i++){
		ans+=i*(n-i+1+n)/2-i*(i-1)/2+1;
	}
	cout<<ans%1000000007;
	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 ll long long
#define ford(i,a,b) for(int i=(a);i>=b;i--)
#define rep1(i,a,b) for(long long i=(a);(i)<=(b);(i)++)
#define rep(i,a,b) for(int i=(a);(i)<(b);(i)++)
#define mpi map<int,int>
#define N 200005
#define pql priority_queue<ll>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
using namespace std;
ll n,k,ans;
int main() {
	cin>>n>>k;
	for(ll i=k;i<=n+1;i++){
		ans+=i*(n-i+1+n)/2-i*(i-1)/2+1;
	}
	cout<<ans%1000000007;
	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>
#define ll long long
#define ford(i,a,b) for(int i=(a);i>=b;i--)
#define rep1(i,a,b) for(ll i=(a);(i)<=(b);(i)++)
#define rep(i,a,b) for(int i=(a);(i)<(b);(i)++)
#define mpi map<int,int>
#define N 200005
#define pql priority_queue<ll>
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
using namespace std;
ll n,k,ans;
int main() {
	cin>>n>>k;
	rep1(i,k,n+1){
		ans+=i*(n-i+1+n)/2-i*(i-1)/2+1;
	}
	cout<<ans%1000000007;
	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 ll long long int
const int mod = 1e9+7;
int main()
{
    ll n,k;
    cin >> n >> k;

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


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

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

const int MOD = 1000000007;

int main(){
	int n, k;
	scanf("%d%d", &n, &k);
	long m = n　+　1, l = k - 1;
	long ans = m*(m*m+5)/6 + l*(2*l*l+3*l-5-3*m*(l+1))/6;
	printf("%ld\n", ans % MOD);
}

Compiler output:
a.cc:9:18: error: extended character 　 is not valid in an identifier
    9 |         long m = n　+　1, l = k - 1;
      |                  ^
a.cc:9:22: error: extended character 　 is not valid in an identifier
    9 |         long m = n　+　1, l = k - 1;
      |                      ^
a.cc: In function 'int main()':
a.cc:9:18: error: 'n\U00003000' was not declared in this scope
    9 |         long m = n　+　1, l = k - 1;
      |                  ^~~
a.cc:9:22: error: '\U000030001' was not declared in this scope
    9 |         long m = n　+　1, l = k - 1;
      |                      ^~~
a.cc:10:34: error: 'l' was not declared in this scope
   10 |         long ans = m*(m*m+5)/6 + l*(2*l*l+3*l-5-3*m*(l+1))/6;
      |                                  ^
Language: C

#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;

ll MOD = 1e+9 + 7;

ll sum(ll a, ll b) {
    return (a + b) * (b - a + 1) / 2;
}

int main() {
    ll n, k, l, r, ans = 0;
    cin >> n >> k;

    for (ll i = k; i <= n + 1; i++) {
        l = sum(0, i - 1);
        r = sum(n - i + 1, n);
        ans += (r - l + 1) % MOD;
    }
    cout << ans % MOD << 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>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <deque>
using namespace std;

#define next '\n'
#define sp " "
#define print(x) cout << (x)
#define println(x) cout << (x) << next
#define stop return(0)
#define rep(i, n) for(int (i) = (0); (i) < (n); (++i))
#define FOR(i, start, end) for(int (i) = (start); (i) < (end); (++i))
#define foreach(elem, _list) for(auto& (elem) : (_list))
#define debug(_list) foreach(e, _list){ cout << e << sp; } cout << next
#define FAST ios::sync_with_stdio(false); cin.tie(nullptr)
#define size(s) (s).size()
#define ALL(vec) (vec).begin(), (vec).end()
#define pb(e) push_back(e);
#define INF 1e+8
#define PI acos(-1)
#define TAU PI * 2
using ll = long long;
using ull = unsigned long long;
const ll MOD = 1000000007;

int main(){
    ll n, k;
    cin >> n >> k;

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

    println(ans);
}

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>
#include <algorithm>
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
using namespace std;

int count(int c1, int c2){
  int Cans = 1;
  for(int i=1; i<c1; c1++){
    Cans *= i;
  }
  for(int i=1; i<c2; c2++){
    Cans /= c2;
  }
  return Cans;
}

int main(){
  int n, k; //n: 加算回数 k:最低限選ぶ数
  int ans=1;
  cin >> n >> k;
  int ac = 0;
  if(n>=k){
    //Cの組み合わせ合計
    for(int i=k; i<n+1; i++){
      ac += count(n+1, i);
      cout << ac;
//    a.push_back(ac);
    }   
  }else{ //1通りしかない
    ans = 1;
  }
  cout << ans;

}

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;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
typedef vector<string> vstring;
#define _GLIBCXX_DEBUG
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
const int INF = 1 << 30;
const int mod=1000000007;
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
#define stp(x)  setprecision(x)
int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n,k;
  cin>>n>>k;
  ll count=0;
  vlong sum(n+1,0);
  REP(i,1,n+1){
    sum[i]=sum[i-1]+i;
  }
  REP(i,k,n+1){
    count+=(sum[n]-sum[n-i])-sum[i-1]+1;
    count=count%mod;
  }
  cout<<count+1<<'\n';
  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 <cmath>
using namespace std;

int main(){
  int n,k;
  cin >> n >> k;
  long long int cnt = 0;
  for(int i=k;i<=n+1;i++){
    cnt += 3*n-6;
    cnt %= pow(10,9)+7;
  }
  cout << cnt << endl;
  return 0;
}

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

n,k=map(int,input().split())
sum=0
MOD=1000000007
for i in range(k,n+2):
    sum=sum+(i*(n-i+1))+1
    sum%=MOD
print(sum)

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

#include <bits/stdc++.h>
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n,s) for(int i=(s);i<(n);i++)
#define rrep(i,n) for(int i=(n-1);i>=0;i--)
#define rreps(i,n,s) for(int i=s;i>=n;i--)
#define MOD 1000000007
using ll = long long;
using namespace std;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll n, k;
cin >> n >> k;
vector<ll> cum(int(2*1e5)+1,0);
reps(i,2*1e5+1,1){
    cum[i] =cum[i-1]+ i-1;
}

//選ぶ数字の数毎に組合せは重複しない
ll ans = 0;
reps(i,n+2,k){
    ll _min = cum[i];
    ll _max = cum[n+1]-cum[n+1-i];
    ans = (ans + _max - _min + 1)%MOD;
}

cout << ans << endl;

//system("pause");
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;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 4050
#define INF 1000000000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define IN(a) cin>>(a)
#define OUT(a) cout<<(a)<<endl
typedef pair<int,int> P;
const int MAX = 1000005;
const int MOD = 1000000007;
int main(){
    int n,k;
    cin>>n>>k;
    ll ans=0;
    for(int i=k;i<=n+1;i++){
        ll a=(ll)i*(i-1)/2;
        ll b=(ll)i*(2*n+1-i)/2;
        ans+=(ll)(b-a+1);
        ans%=MOD;
    }
    OUT(ans);
    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;

const int mod=1e9+7;

int main(){
    long long N,K; cin >> N >> K;
    long long sum[N+1]={};
    for(int i=0;i<N;i++){
        sum[i+1]=sum[i]+(i+1);
    }
    long long ans=0;
    for(long long i=K;i<=N;i++){
        ans+=sum[N]-sum[N-i]-sum[i-1]+1;
        ans%=mod;
    }
    cout << ans+1 << endl;
}

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;

typedef long long ll;
const ll mod = 1e9+7;
void solve(){
    ll n, k;
    cin >> n >> k;
    ll p = 0, s = 0, ans = 0;
    for(ll i =1; i<=n+1; i++){
        s += i;
        p += n+2-i;
        s%=mod;
        p%=mod;
        if(i>=k){
            ans += p-s+mod+1;
            ans %mod;
        }
    }
    cout << ans%mod;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t =1, i = 1;
    //cin >> t;
    while(t--){
        solve();
        ++i;
    }
    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>
#define mod 1000000007
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
ll n,k,ans,smin,smax;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>k;
    for(ll i=k;i<=n+1;i++)
    {
        smin=i*(i-1)/2LL;
        smax=(n+n-(i-1))*i/2LL;
        ans=(ans+(smax-smin+1))%mod;
    }
    cout<<ans;
    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;
#define ll long long
const ll maxn=3e5;
const ll mod=1e9+7;
map<ll,ll> m;
ll f[maxn], a[maxn];
ll n, k, i, ans=0;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n >> k;
    for ( i=1; i<=n; i++)
    {
        cin >>a[i];
        a[i] = a[i]-1+k;
        a[i]% = k;
    }
    f[0]=0;
    for ( i=1; i<=n; i++)
        f[i] = (f[i-1]+a[i])%k;
    for ( i=1; i<=n; i++)
    {
        ll x=i-k;
        if (x>0)
            m[f[x]]--;
        if (f[i]==0)
        {
            ans = ans+m[0];
            if (i<k) ans++;
        }
        else
            ans = ans+m[f[i]];
        m[f[i]]++;
    }
    cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: expected primary-expression before '=' token
   18 |         a[i]% = k;
      |               ^
Language: C

#include<bits/stdc++.h>
using namespace std;
#define ll long long 
// memo  fixed  setprecision(20);
using vvll = vector<vector<ll>>;
ll mod =1e9+7;
/*"itob" int to "N"base */           template<typename TypeInt> string itob(const TypeInt v, int base){static const char table[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";string ret;static numeric_limits<TypeInt> t;TypeInt n = v;if (t.is_signed) {if (v < 0) n *= -1;}while (n >= base) {ret += table[n%base];n /= base;}ret += table[n];if (t.is_signed) {if (v < 0 && base == 10) ret += '-';}reverse(ret.begin(), ret.end());return ret;}
/*"chmin" a = MAX*/                  template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
/*"chmax" a = MIN*/                  template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
/*"ctoi"  char to int*/              int ctoi(char c) {return c-'0';}
/*"gcd"   MAX Euclidean */           ll gcd(ll a,ll b){if(b==0)return a; return gcd(b,a%b);}
/*"lcm"   MIN*/                      ll lcm(ll a,ll b){ll g = gcd(a,b);return a/g*b;}
/*"primecheck"If prime,return true.*/bool primecheck(ll n){if(n < 2) return false;else{for(int i = 2; i * i <= n; i++){if(n % i == 0) return false;}return true;}}
string  reverserange(string s,ll a,ll b){reverse(s.begin()+a-1,s.begin()+b); return s;}
int main(){
   ll n,k;
   cin >> n >> k;
   vector<ll>a(n+1);
   for(int i=0;i<=n;i++){
      a.at(i)=i;
   }
   vector<ll>b(n+2);
   for(int i=1;i<=n+1;i++){
      b.at(i)+=a.at(i-1)+b.at(i-1);
   }
   ll ans = 0;
   for(int i=k;i<=n+1;i++){
      ll l  =b.at(i);
      ll r= b.at(n+1)-b.at(n+1-i);
      ll che = r-l +1;
      ans+=che;
      ans%=mod;
   }
   cout << ans << endl;
}
    



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 <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <map>
const int MOD = 1e9+7;
typedef long long ll;
using namespace std;


int main(){
	ll n, k;
	cin >> n >> k;
	ll ans = 0;

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

	if((ans+1)%MOD < 0) cout << (ans+1)%MOD+MOD << endl;
	else cout << (ans+1)%MOD  << endl;
	return 0;
}


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

ll nhan(ll x,ll y)
{
    if (y == 0)
        return 0;
    ll t;
    t = nhan(x, y/2) % mod;
    t = t % mod + t % mod;
    if (y % 2 == 0)
        return t % mod;
    else
        return (t % mod + x % mod) % mod;
}

ll mu(ll x, ll y)
{
    if (y == 0)
        return 1;
    ll t;
    t = mu(x, y/2) % mod;
    t = nhan(t, t) % mod;
    if (y % 2 == 0)
        return t % mod;
    else
        return nhan(t,x) % mod;
}

int main()
{
    cin >> n >> k;
    for(i=k; i<=n + 1; i++)
		ans = (ans + nhan(i, n-i+1) + 1) % mod;
		cout << ans % mod;
}

Compiler output:
a.cc:1:1: error: 'll' does not name a type
    1 | ll nhan(ll x,ll y)
      | ^~
a.cc:14:1: error: 'll' does not name a type
   14 | ll mu(ll x, ll y)
      | ^~
a.cc: In function 'int main()':
a.cc:29:5: error: 'cin' was not declared in this scope
   29 |     cin >> n >> k;
      |     ^~~
a.cc:29:12: error: 'n' was not declared in this scope
   29 |     cin >> n >> k;
      |            ^
a.cc:29:17: error: 'k' was not declared in this scope
   29 |     cin >> n >> k;
      |                 ^
a.cc:30:9: error: 'i' was not declared in this scope
   30 |     for(i=k; i<=n + 1; i++)
      |         ^
a.cc:31:17: error: 'ans' was not declared in this scope
   31 |                 ans = (ans + nhan(i, n-i+1) + 1) % mod;
      |                 ^~~
a.cc:31:30: error: 'nhan' was not declared in this scope
   31 |                 ans = (ans + nhan(i, n-i+1) + 1) % mod;
      |                              ^~~~
a.cc:31:52: error: 'mod' was not declared in this scope
   31 |                 ans = (ans + nhan(i, n-i+1) + 1) % mod;
      |                                                    ^~~
a.cc:32:17: error: 'cout' was not declared in this scope
   32 |                 cout << ans % mod;
      |                 ^~~~
a.cc:32:25: error: 'ans' was not declared in this scope
   32 |                 cout << ans % mod;
      |                         ^~~
a.cc:32:31: error: 'mod' was not declared in this scope
   32 |                 cout << ans % mod;
      |                               ^~~
Language: C

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	
	
	unsigned long long int n,k;
	cin >> n >>k;
	
	
	unsigned long long int minSum, maxSum; 
	unsigned long long ans = 0;
	for(unsigned long long int i = k; i <= n + 1; i++)
	{
		minSum = (i - 1) * i / 2;
		maxSum = ((n * (n + 1)) /2) - (((n - i) * (n - i + 1)) / 2);
		ans += ((((maxSum - minSum)%1000000007) + 1) % 1000000007);
		ans =ans % 1000000007;		
	}
	
	cout << ans;
	
	return 0;
}

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

// cpp219 - the 712534
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define fs first
#define sc second
#define mp make_pair
using namespace std;
const ll base = 7;
const ll N = 2e5 + 9;
const ll mod = 1e9 + 7;
typedef pair<ll,ll> LL;

ll n,k;
ll sum[N],i;

int main(){
    ios_base::sync_with_stdio(false);
   	cin.tie(0); cout.tie(0);
    //freopen("test.inp", "r", stdin);
    cin>>n>>k;
    //fac[1] = fac[0] = 1;
    for (i=1;i<N;i++) sum[i] = sum[i - 1] + i;
    ll ans = 0;
    for (i = k;i <= n + 1;i++){
        ll minsum = sum[i - 1];
        ll maxsum = sum[n] - sum[n - i];
        ans = ans + (maxsum - minsum + 1);
        ans %= mod;
    }
    cout<<ans%mod;
}


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

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

Compiler output:
a.cc:5:1: error: 'LL' does not name a type; did you mean 'll'?
    5 | LL ans,a,b,n,k;
      | ^~
      | ll
a.cc: In function 'int main()':
a.cc:7:14: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         cin>>n>>k;
      |              ^
      |              yn
a.cc:7:17: error: 'k' was not declared in this scope
    7 |         cin>>n>>k;
      |                 ^
a.cc:10:17: error: 'a' was not declared in this scope
   10 |                 a=(i-1)*((i-1)+1)/2;
      |                 ^
a.cc:11:17: error: 'b' was not declared in this scope
   11 |                 b=(n+n-i+1)*i/2;
      |                 ^
a.cc:12:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |                 ans=(ans+a-b+1)%mod;
      |                 ^~~
      |                 abs
a.cc:14:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         cout<<ans;
      |               ^~~
      |               abs
Language: C++

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

Compiler output:
a.cc:5:1: error: 'LL' does not name a type; did you mean 'll'?
    5 | LL ans,a,b,n,k;
      | ^~
      | ll
a.cc: In function 'int main()':
a.cc:7:14: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         cin>>n>>k;
      |              ^
      |              yn
a.cc:7:17: error: 'k' was not declared in this scope
    7 |         cin>>n>>k;
      |                 ^
a.cc:10:17: error: 'a' was not declared in this scope
   10 |                 a=(i-1)*((i-1)+1)/2;
      |                 ^
a.cc:11:17: error: 'b' was not declared in this scope
   11 |                 b=(n+n-i+1)*i/2;
      |                 ^
a.cc:12:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |                 ans=(sum+a-b+1)%mod;
      |                 ^~~
      |                 abs
a.cc:12:22: error: 'sum' was not declared in this scope
   12 |                 ans=(sum+a-b+1)%mod;
      |                      ^~~
a.cc:14:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         cout<<ans;
      |               ^~~
      |               abs
Language: C++

//#include <bits/stdc++.h>
#include "/Users/koshiro/CLionProjects/ProgrammingContest/Atcoder/include/bits/stdc++.h"

using namespace std;

int min(int k);
int max(int n, int k);

int main() {
    int n, k, ans = 0;
    double m = pow(10, 9) + 7;

    cin >> n >> k;

    for (int i=k;i<n+2;i++) {
        ans += max(n,i) - min(i) + 1;
    }

    cout << fmod(ans, m) << endl;
}

int min(int k) {
    int min = 0;

    for(int i=0; i<k; i++) {
        min += i;
    }

    return min;
}

int max(int n, int k) {
    int max = 0;

    for (int i=n; i> n - k; i--) {
        max += i;
    }

    return max;
}

Compiler output:
a.cc:2:10: fatal error: /Users/koshiro/CLionProjects/ProgrammingContest/Atcoder/include/bits/stdc++.h: No such file or directory
    2 | #include "/Users/koshiro/CLionProjects/ProgrammingContest/Atcoder/include/bits/stdc++.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.