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

#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { 
  INIT(){cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


signed main() {
  int N; 
  cin >> N;

  vector<int> A(N, 0);

  REP(i, N-1){
    int a;
    cin >> a;
    A[a-1]++;
  }

  REP(i, N){
    cout << A[i] << "\n";
  }


  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>

using namespace std;
#define N 200100
#define SIGMA 26
int v[N];
int x, i, n;
int main()
{
    cin >> n;
    for (i = 1; i < n; ++i){
        cin >> x;
        --x;
        ++v[x];
    }
    for (i = 0; i < n; ++i)
        cout << v[i] << '\n';
    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>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long int
// #define ll int128_t
#define ld long double
#define ff first
#define ss second
#define mp make_pair
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define eb emplace_back
#define pii pair<int, int>
#define endl '\n'
#define all(x) x.begin(),x.end()
#define f(i,j,l) for(i=j;i<l;i++)
#define smax(a,b) a=max(a,b)
// #if !defined(ONLINE_JUDGE)
// #include "debugging.h"
// #endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;
// erase,insert same as normal set

// int const mod = 7340033;
int const mod = 998244353;
int power(int a,int b,int m){
    int res = 1;
    while(b){
        if(b&1){
            res = res*a;
            res %= m;
        }
        a=a*a;
        a%=m;
        b=b/2;
    }
    return res;
}

int inverse(int x){
    return power(x,mod-2,mod);
}

int const N = 5e5+5;
int const inf = 2e16;

void solve(){  
    int i,j;
    int n; cin>>n;
    int cnt[n+1]={0};
    for(i=2;i<=n;i++){
        int x; cin>>x;
        cnt[x]++;
    }
    for(i=1;i<=n;i++){
        cout<<cnt[i]<<endl;
    }
}             


int32_t main(){
    IOS;
    int t;
    t = 1;
    // precompute();
    // cin>>t;
    for(int tt=1;tt<=t;tt++){
        solve();
    }
    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

// #pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline")
// #pragma GCC option("arch=native", "tune=native", "no-zero-upper")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("tree-vectorize","openmp","predictive-commoning")
// #pragma GCC option("D_GLIBCXX_PARALLEL","openmp")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
// #define int long long
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000               // 2e9
#define LLINF 2000000000000000000ll  // 2e18 (llmax:9e18)
#define fi first
#define sec second
#define all(x) (x).begin(), (x).end()
#define sq(x) ((x) * (x))
#define dmp(x) cerr << #x << ": " << x << endl;

template <class T>
void chmin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T &a, const T &b) {
  if (a < b) a = b;
}

template <class T>
using MaxHeap = priority_queue<T>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template <class T>
vector<T> vect(int len, T elem) {
  return vector<T>(len, elem);
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << p.fi << ',' << p.sec;
  return os;
}
template <class T, class U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.fi >> p.sec;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i];
    if (i + 1 < vec.size()) os << ' ';
  }
  return os;
}
template <class T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) is >> vec[i];
  return is;
}
void fastio() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
}

#define endl "\n"

void solve() {
  int N;
  cin >> N;
  vector<int> ans(N, 0);
  for (int i = 1; i < N; i++) {
    int v;
    cin >> v;
    v--;
    ans[v]++;
  }
  for (int i = 0; i < N; i++) { cout << ans[i] << endl; }
  return;
}

signed main() {
  fastio();
  solve();
  // int t; cin >> t; while(t--)solve();

  // int t; cin >> t;
  // for(int i=1;i<=t;i++){
  //   cout << "Case #" << i << ": ";
  //   solve();
  // }
  return 0;
}


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

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

int main() {
    int N;
    cin >> N;
    vector<int> A(N+1, 0);
    for (int i = 0; i < N-1; i++) {
        int B;
        cin >> B;
        A[B]++;
    }
    for (int i = 1; i <= N; i++) cout << A[i] << 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>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

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

    int a[n+1] = {};
    rep(i,n){
        int b;
        cin >> b;
        a[b]++;
    }

srep(i,1,n+1)cout << a[i] << endl; int ans = 0;

   // 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

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

public class Main {

    private static FastReader in = new FastReader(System.in);
    private static PrintWriter out = new PrintWriter(System.out);

    private static final long MOD = (long) 1e9 + 7;

    public static void main(String[] args) {
        solve();
        out.flush();
    }

    private static void solve() {
        int n = in.nextInt();
        int[] ans = new int[n];
        for (int i = 0; i < n - 1; i++) {
            int aa = in.nextInt();
            ans[aa - 1]++;
        }
        for (int an : ans) {
            out.println(an);
        }
    }

    // https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader(InputStream inputStream) {
            br = new BufferedReader(new
                    InputStreamReader(inputStream));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        // https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb
        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.io.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.io.*;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.*;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.*;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
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 (b<a) { a=b; return 1; } return 0; }

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

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

void solve() {
    int n;
    cin >> n;
    VLL a(n);
    REP(i,0,n) cin >> a[i];
    VI cnt(n+1);
    REP(i,0,n) cnt[a[i]]++;
    REP(i,0,n) cout<< cnt[i+1] << endl;
}

signed main() {
    solve();
    
    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>
#include <unistd.h>
#include <sys/time.h>
#include <stdlib.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P, ll> T;
 
long long int INF = 2e18;
const ll fact_table = 1200008;
double Pi = 3.1415926535897932384626;

priority_queue <ll> pql;
priority_queue <P> pqp;
priority_queue <P> bag;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
ll dx[8]={1,0,-1,0,1,1,-1,-1};
ll dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//↓,→,↑,←

#define endl "\n"
#ifdef ENJAPMA
    #undef endl
#endif
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define CLEAR(a) a = decltype(a)(); 
#define pc(x) cout << x << ",";
 
// const ll mod = 998244353ll;
const ll mod = 1000000007ll;
  
ll mypow(ll number1,ll number2, ll mod){
    if(number2 == 0){
        return 1ll;
    }else{
        ll number3 = mypow(number1,number2 / 2, mod);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
void YES(bool condition){
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}
 
/*
ll fact[fact_table + 5],rfact[fact_table + 5]; 
 
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=fact_table; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[fact_table] = mypow(fact[fact_table],mod - 2, mod);
    for(ll i=fact_table; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod ) * rfact[n-r]) % mod;}
*/

bool multicase = false;

ll n,m,num,a,b,c,d,e,h,q;
ll w, k;
ll x[500005], y[500005], z[500005];
string s;

void solve(){
    cin >> n;
    for(ll i=0;i<n-1;i++){
        cin >> a;
        x[a] ++;
    }
    for(ll i=1;i<=n;i++){
        p(x[i]);
    }

    return;
}

int main(){
    // init();
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll q, testcase = 1;
 
    if(multicase){
        cin >> q;
    }else{
        q = 1;
    }
    while(q--){
        // pu("Case ");pu("#");pu(testcase);pu(": ");
        solve();
        testcase++;
    }
    
    // solve();
    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

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long k = sc.nextLong();
        long WARI = 1000000007L;
        long result = 0L;

        for (long i = k; i <= n + 1; i++) {
            long l = sumN(0, i - 1);
            long r = sumN(n - i + 1, n);
            result = (result + r - l + 1) % WARI;
        }
        System.out.println(result);
    }

    private static long sumN(long l, long r) {
        return (l + r) * (r - l + 1) / 2;
    }
}

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

#include <bits/stdc++.h>

// #include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000000000000ll
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
//#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<")" << "\n";
#define DEBUG(x) cout<<#x<<":"<<x<<"\n"
#define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n"
#endif
#ifndef __DEBUG__
#define CH_P(a) 
#define DEBUG(x) 
#define DEBUGS(v) 
#endif
/* clang-format on */
// using mint = modint1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n, k;
  cin >> n >> k;
  ll ans = 0;
  ans = (-(n + 1) * (n + 2) * (2 * n + 3) / 6+MOD) % MOD +
        k * (k - 1) * (2 * k - 1) / 6 % MOD +
        ((n + 1) * ((n + 1) * (n + 2) / 2 - k * (k - 1) / 2)) % MOD + n - k + 2;
  cout << ans%MOD << endl;
  return 0;
}


Compiler output:
a.cc:5:17: error: 'atcoder' is not a namespace-name
    5 | using namespace atcoder;
      |                 ^~~~~~~
Language: C++

#include <bits/stdc++.h>

#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000000000000ll
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
//#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<")" << "\n";
#define DEBUG(x) cout<<#x<<":"<<x<<"\n"
#define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n"
#endif
#ifndef __DEBUG__
#define CH_P(a) 
#define DEBUG(x) 
#define DEBUGS(v) 
#endif
/* clang-format on */
// using mint = modint1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n, k;
  cin >> n >> k;
  ll ans = 0;
  ans = (-(n + 1) * (n + 2) * (2 * n + 3) / 6+MOD) % MOD +
        k * (k - 1) * (2 * k - 1) / 6 % MOD +
        ((n + 1) * ((n + 1) * (n + 2) / 2 - k * (k - 1) / 2)) % MOD + n - k + 2;
  cout << ans%MOD << endl;
  return 0;
}


Compiler output:
a.cc:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

typedef long double ld;
#define rep(i,n) for(int i=0;i<(n);i++)
#define init(a,i) for(int k=0;k<(i);k++)(a)[k]=0
#define in(a,i) for(int k=0;k<(i);k++)cin>>(a)[k]
#define all(a)  (a).begin(),(a).end()
#define el(a) (a).end()-(a).begin()
#define mod 1000000007
int main(){
	ll n,k,sum=0;
	cin>>n>>k;
	for(ll i=k;i<=n+1;i++){
		sum=((sum+(i*((n-i+1)%mod))+1)%mod)%mod;
	}
	cout << sum;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'll' was not declared in this scope; did you mean 'ld'?
    9 |         ll n,k,sum=0;
      |         ^~
      |         ld
a.cc:10:9: error: 'cin' was not declared in this scope; did you mean 'in'?
   10 |         cin>>n>>k;
      |         ^~~
      |         in
a.cc:10:14: error: 'n' was not declared in this scope; did you mean 'in'?
   10 |         cin>>n>>k;
      |              ^
      |              in
a.cc:10:17: error: 'k' was not declared in this scope
   10 |         cin>>n>>k;
      |                 ^
a.cc:11:15: error: expected ';' before 'i'
   11 |         for(ll i=k;i<=n+1;i++){
      |               ^~
      |               ;
a.cc:11:20: error: 'i' was not declared in this scope; did you mean 'in'?
   11 |         for(ll i=k;i<=n+1;i++){
      |                    ^
      |                    in
a.cc:12:17: error: 'sum' was not declared in this scope
   12 |                 sum=((sum+(i*((n-i+1)%mod))+1)%mod)%mod;
      |                 ^~~
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << sum;
      |         ^~~~
a.cc:14:17: error: 'sum' was not declared in this scope
   14 |         cout << sum;
      |                 ^~~
Language: C++



#include <bits/stdc++.h>
//#include "bits/stdc++.h"
#include <atcoder/all>

using namespace std;
using namespace atcoder;
typedef long long ll;


#include "boost/multiprecision/cpp_int.hpp"
#include "boost/multiprecision/cpp_dec_float.hpp"
namespace mp = boost::multiprecision;
typedef mp::cpp_int LL;
typedef mp::number<mp::cpp_dec_float<1024>> DD;// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)

 
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define rrep(i,r,l) for(ll i=r;i>=l;i--)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-12;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
//#define endl "\n"  //インタラクティブで消す！！！！！！！！！！！！！！！！！！！！！
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
template<class T,class S>
inline bool chmax(T &a, S b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T,class S>
inline bool chmin(T &a, S b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

void mod_print(ll k){
    ll P=50000;
    rep(y,1,P){
        ll x=mod(y*k);
        
        if(abs(x)<=P||x+P>=i_7){
            if(x+P>=i_7){
                x-=i_7;
            }
            cout<<x<<"/"<<y<<endl;
            //cout<<setprecision(5)<<(dd)x/(dd)y;
            return;
        }
    }
    cout<<"nun"<<endl;
}
#define all(c) c.begin(),c.end()
typedef vector<ll> vl;

//using mint = modint998244353;
using mint = modint1000000007;

//////////////////////////

mint sum(ll sta,ll end,ll kou){
    mint res=(sta+end)*kou;
    return res/2;
}

int main(){fastio
    ll n,k;cin>>n>>k;
    mint ans=0;
    rep(i,k,n+1){
        mint mn=sum(0,i-1,i);
        mint mx=sum(n-i+1,n,i);
        ans+=mx-mn+1;
    }
    cout<<ans.val()<<endl;
    
    return 0;
}


Compiler output:
a.cc:5:10: fatal error: atcoder/all: No such file or directory
    5 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#define rep(i,n) for (int i= 0;i<(n);++i)
using namespace std;
typedef long long ll;
int main()
{
    ll N, K;
    cin >> N >> K;
    ll sum = 0;
 
    for (ll i = K; i <= N + 1; i++)
    {
        ll low = (i - 1) * i / 2;
        ll high = (2 * N + 1 - i) * i / 2;
        ll add = high - low + 1;
        sum = (sum + add) % MOD;
    }
 
    cout << sum << endl;

    return 0;
}

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

#include <map>
#include <string>
#include <vector>
#include <algorithm>

#define ll long long
#define mod 1000000007

int main()
{
    ll N, K;
    std::cin >> N >> K;

    ll fv = 1000;
    ll ans = 0;

    if(N+1 == K) {
        ans = 1;
        std::cout << ans << std::endl;
    }
    else {
        ll low_value = 0;
        ll high_value = 0;

        for(ll i=0; i < K; i++) {
            low_value += i;
            high_value += N-i;
        }

        for(ll i=0; i < (N+1-K); i++) {
            ll tmp = high_value - low_value;
            ans += tmp + 1;
            ans = ans % mod;

            low_value += K+i;
            high_value += N-i-K+1;
        }
        std::cout << ans << std::endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'cin' is not a member of 'std'
   12 |     std::cin >> N >> K;
      |          ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <algorithm>
  +++ |+#include <iostream>
    5 | 
a.cc:19:14: error: 'cout' is not a member of 'std'
   19 |         std::cout << ans << std::endl;
      |              ^~~~
a.cc:19:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:34: error: 'endl' is not a member of 'std'
   19 |         std::cout << ans << std::endl;
      |                                  ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include <algorithm>
  +++ |+#include <ostream>
    5 | 
a.cc:38:14: error: 'cout' is not a member of 'std'
   38 |         std::cout << ans << std::endl;
      |              ^~~~
a.cc:38:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:38:34: error: 'endl' is not a member of 'std'
   38 |         std::cout << ans << std::endl;
      |                                  ^~~~
a.cc:38:34: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: Java

import java.util.*;

public clss Main {
    public static void main(String[] args) {
        Scanner cs = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int count = 0;
        int small = 0;
        int smallCount = 0;
        int big = 0;
        int bigCount = 0;
        while(n >= k) {
            for(int i = 0; i < k; i++) {
                for(int j = 0; j < k; j++) {
                    small += j;
                    smallCount++;
                }
                for(int j = n; j < k; j--) {
                    big += j;
                    bigCount++;
                }
                count += big - small;
                small = 0; smallCount = 0;
                big = 0; bigCount = 0;
                k++;
            }
        }
    }
}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
public clss Main {
       ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
    public static void main(String[] args) {
                  ^
  (use --enable-preview to enable unnamed classes)
Main.java:30: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define SP << " " 
#define LLi long long int

using namespace std;

int imax=2147483647;
long long int llimax=9223372036854775807;
LLi mod=1000000007;
vector<LLi> fac(1), facin(1);

//int型vectorを出力
void PV(vector<int> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}

//LLi型vectorを出力
void PVL(vector<LLi> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}
 
LLi modpow(LLi a, LLi n) {
    LLi res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

LLi conb(LLi x, LLi y){
	if(x<y) cout<< "conb x<y" << x SP << y <<endl;
	return ((fac[x]*facin[y])%mod*facin[x-y])%mod;
}

int main(){

	LLi n, k;
	LLi tmp, ans, mi=0;

	cin>> n >> k;

	ans=modpow(2, n+1);

	fac[0]=1;
	facin[0]=1;
	for(int i=1;i<=n;i++){
		tmp=fac[i-1];
		tmp*=i;
		tmp=tmp%mod;
		fac.push_back(tmp);
		facin.push_back(modinv(tmp));
		//cout<< fac[i] << " " << facin[i] << " " << (fac[i]*facin[i])%mod <<endl;
	}

	rep(i, k) {
		mi+=conb(n, (LLi)i);
		mi=mi%mod;
	}

	cout<< (ans-mi+mod)%mod << endl;
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:33: error: 'modinv' was not declared in this scope
   58 |                 facin.push_back(modinv(tmp));
      |                                 ^~~~~~
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define SP << " " 
#define LLi long long int

using namespace std;

int imax=2147483647;
long long int llimax=9223372036854775807;
LLi mod=1000000007;
vector<LLi> fac(1), facin(1);

//int型vectorを出力
void PV(vector<int> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}

//LLi型vectorを出力
void PVL(vector<LLi> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}
 
LLi modpow(LLi a, LLi n) {
    LLi res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

LLi conb(LLi x, LLi y){
	if(x<y) cout<< "conb x<y" << x SP << y <<endl;
	return ((fac[x]*facin[y])%mod*facin[x-y])%mod;
}

int main(){

	LLi n, k;
	LLi ans, mi=0;

	cin>> n >> k;

	ans=modpow(2, n+1);

	fac[0]=1;
	facin[0]=1;
	for(int i=1;i<=n;i++){
		tmp=fac[i-1];
		tmp*=i;
		tmp=tmp%mod;
		fac.push_back(tmp);
		facin.push_back(modinv(tmp));
		//cout<< fac[i] << " " << facin[i] << " " << (fac[i]*facin[i])%mod <<endl;
	}

	rep(i, k) {
		mi+=conb(n, (LLi)i);
		mi=mi%mod;
	}

	cout<< (ans-mi+mod)%mod << endl;
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   54 |                 tmp=fac[i-1];
      |                 ^~~
      |                 tm
a.cc:58:33: error: 'modinv' was not declared in this scope
   58 |                 facin.push_back(modinv(tmp));
      |                                 ^~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int N, K;
    cin >> N >> K;
    int ans = 0;
    
    for(int i = 0; i < N + 2- K ; i++){
        ans += ((2*N*K + 2*K -3 K*K) + 1)/2;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:32: error: expected ')' before 'K'
   10 |         ans += ((2*N*K + 2*K -3 K*K) + 1)/2;
      |                 ~              ^~
      |                                )
a.cc:10:44: error: expected ')' before ';' token
   10 |         ans += ((2*N*K + 2*K -3 K*K) + 1)/2;
      |                ~                           ^
      |                                            )
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
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; }
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int main() {

    ll n, k;
    cin >> n >> k;
    
    ll ans = 0;
    for(int k = k; k <=n+1 ; k++) {
        ll low = k * (k-1) / 2;
        ll high = (n*2 - k+1) * k / 2;
        ll add = high - low + 1;
        ans = (ans + ad) % MOD;
    }

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: 'ad' was not declared in this scope; did you mean 'add'?
   26 |         ans = (ans + ad) % MOD;
      |                      ^~
      |                      add
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,k;
long long sum1[200002],sum2[200002];
int main(){
	cin>>n>>k;
	long long now=0;
	for(int i=0;i<n+2;i++){
		sum1[i]=now;
		now+=i;
		now%=1000000007;
	}
	now=0;
	for(int i=0;i<n+2;i++){
		sum2[i]=now;
		now+=(long long)(n-i);
		now%=1000000007;
	}
	long long ans=0;
	for(int i=k;i<=n+2;i++){
		if(sum2[i]<sum1[i])
		sum2[i]+=1000000007;
		ans+=sum2[i]-sum1[i]+1 long long;
		ans%=1000000007;
	}
	cout<<ans;
	return 0;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:39: error: expected ';' before 'long'
   23 |                 ans+=sum2[i]-sum1[i]+1 long long;
      |                                       ^~~~~
      |                                       ;
Language: C++

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

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


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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected ';' before 'for'
   14 |     b *= i
      |           ^
      |           ;
   15 |   for (int i = K; i <= N+1; i++) {
      |   ~~~      
a.cc:15:19: error: 'i' was not declared in this scope
   15 |   for (int i = K; i <= N+1; i++) {
      |                   ^
Language: Java


import java.io.*;
import java.util.*;
public class codeforces {

	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String[] cmd=br.readLine().split(" ");
		long x=Long.valueOf(cmd[0]);
		long k=Long.valueOf(cmd[1]);
		long[] sum1=new long[(int)x+2];
		for(long i=1;i<=x+1;i++)
		{
			sum1[(int)i]=sum1[(int)i-1]+i;
		}
		long[] sum2=new long[(int)x+2];
		for(long i=x+1;i>=1;i--)
		{
			sum2[(int)(x+2-i)]=sum2[(int)(x+1-i)]+i;
		}
		long ans=0;
		for(long i=k;i<=x+1;i++)
		{
			long diff=sum2[(int)i]-sum1[(int)i]+1;
			ans=(ans+diff)%1000000007;
		}
		System.out.println(ans);
	}

}


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

/*
Hey there stalker....

█▀▀▄░░░░░░░░░░░▄▀▀█
░█░░░▀▄░▄▄▄▄▄░▄▀░░░█
░░▀▄░░░▀░░░░░▀░░░▄▀
░░░░▌░▄▄░░░▄▄░▐▀▀
░░░▐░░█▄░░░▄█░░▌▄▄▀▀▀▀█
░░░▌▄▄▀▀░▄░▀▀▄▄▐░░░░░░█
▄▀▀▐▀▀░▄▄▄▄▄░▀▀▌▄▄▄░░░█
█░░░▀▄░█░░░█░▄▀░░░░█▀▀▀
░▀▄░░▀░░▀▀▀░░▀░░░▄█▀
░░░█░░░░░░░░░░░▄▀▄░▀▄
░░░█░░░░░░░░░▄▀█░░█░░█
░░░█░░░░░░░░░░░█▄█░░▄▀
░░░█░░░░░░░░░░░████▀
░░░▀▄▄▀▀▄▄▀▀▄▄▄█▀

Like what you see?
*/
#include <bits/stdc++.h>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pii         pair<ll ,ll>
#define vi          vector<ll>
#define present(container, element) (container.find(element) != container.end()) /* For set n maps */
#define cpresent(container, element) (find(all(container),element) != container.end()) /* For vectors */
#define all(a)      (a).begin(),(a).end()
#define invect(data,n,commands) for(int i = 0;i<n;i++){int tmp;cin>>tmp;data.pb(tmp);commands}
#define inset(data,n,commands) for(int i = 0;i<n;i++){int tmp;cin>>tmp;data.I(tmp);commands}
#define F           first
#define S           second
#define I           insert
#define sz(x)       (ll)x.size()
#define rep(i,a,b)    for(ll  i=a;i<b;i++)
#define repr(i,a,b) for(ll  i=a;i>b;i--)
#define trav(a, x) 	for(auto& a : x)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define lcase(a) (char)tolower(a)
#define ll long long int
#define lld long double
#define endl "\n"
#define PI 3.14159265358979323844
#define MOD 1000000007
#define max(a, b) (a < b ? b : a)
#define min(a, b) ((a > b) ? b : a)
//const int N = 1e5 + 5;
const int mod=1e9 + 7;
/*	For Debugging	*/
#define DEBUG 		cerr<<"\n>>>I'm Here<<<\n"<<endl;
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl;
#define what_is(x)  cerr << #x << " is " << x << endl;
/* we choose at least k numbers from (0,N), how
 * many sums possible ?
 * k<=n
 * nCr(n,k) + nCr(n,k+1) + ... nCr(n,n) sets,
 * but _not_ every set has distinct sum.
 * Sets of diff size have diff sums.
 * So, how much sets in one size have same sum?
 *
 * Example, k=2, n=4
 * 1+2=3
 * 1+3=4
 * 1+4=5
 * 2+3=5
 * 2+4=6
 * 3+4=7
 * We can build all sums between smallest and biggest.
 * Smallest is 1+2+...+k
 * Biggest is n+n-1+n-2+n-(k-1)
 * ...
 */
int main()
{
   IOS

    int TESTS=1;
    //cin >> TESTS;
    while (TESTS--)
    {
        ll n,k;
        cin >> n >> k;
        const int MOD=1e9+7;
    int ans=0;
    for(int i=k; i<=n+1; i++) { /* i=number of choosen numbers */
        int mi=((i-1)*i)/2; /* min sum of choosen numbers: 0+1+2.. */
        int ma=n*i - ((i-1)*i)/2; /* max sum of choosen numbers: n-0+n-1+n-2... */
        ans+=ma-mi+1;
        ans%=MOD;
    }
    cout<<ans<<endl;




    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:13: error: expected unqualified-id before numeric constant
   52 | #define MOD 1000000007
      |             ^~~~~~~~~~
a.cc:91:19: note: in expansion of macro 'MOD'
   91 |         const int MOD=1e9+7;
      |                   ^~~
Language: C++

#include <iostream>

using namespace std;
constexpr int mod=1e9+7;
int main(){
  long long N,K;
  cin>>N>>K;
  cout<<(K-N-2)(((2*K*K%mod-K*(N+2)%mod+mod)%mod-N*N%mod+mod)%mod-N-6+mod)%mod/6;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expression cannot be used as a function
    8 |   cout<<(K-N-2)(((2*K*K%mod-K*(N+2)%mod+mod)%mod-N*N%mod+mod)%mod-N-6+mod)%mod/6;
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;
constexpr mod=1e9+7;
int main(){
  long long N,K;
  cin>>N>>K;
  cout<<(K-N-2)(((2*K*K%mod-K*(N+2)%mod+mod)%mod-N*N%mod+mod)%mod-N-6+mod)%mod/6;
}


Compiler output:
a.cc:4:11: error: 'mod' does not name a type
    4 | constexpr mod=1e9+7;
      |           ^~~
a.cc: In function 'int main()':
a.cc:8:25: error: 'mod' was not declared in this scope
    8 |   cout<<(K-N-2)(((2*K*K%mod-K*(N+2)%mod+mod)%mod-N*N%mod+mod)%mod-N-6+mod)%mod/6;
      |                         ^~~
a.cc:8:74: error: expression cannot be used as a function
    8 |   cout<<(K-N-2)(((2*K*K%mod-K*(N+2)%mod+mod)%mod-N*N%mod+mod)%mod-N-6+mod)%mod/6;
      |                                                                          ^
Language: C++

int main() {
    int n,k;cin>>n>>k;
    int max = 0;
    int min = 0;
    ll count = 0;
    //選ぶ数を増やしていく
    for(int i =1;i<=n+1;++i){
        min += i-1;
        max += n-i+1;
        if(i>=k){
            count+=(max-min+1);
        }

    }
    cout<<count<<endl;



}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:13: error: 'cin' was not declared in this scope
    2 |     int n,k;cin>>n>>k;
      |             ^~~
a.cc:5:5: error: 'll' was not declared in this scope
    5 |     ll count = 0;
      |     ^~
a.cc:11:13: error: 'count' was not declared in this scope
   11 |             count+=(max-min+1);
      |             ^~~~~
a.cc:15:5: error: 'cout' was not declared in this scope
   15 |     cout<<count<<endl;
      |     ^~~~
a.cc:15:11: error: 'count' was not declared in this scope
   15 |     cout<<count<<endl;
      |           ^~~~~
a.cc:15:18: error: 'endl' was not declared in this scope
   15 |     cout<<count<<endl;
      |                  ^~~~
Language: C++

    n,k = map(int,input().split())
     
    mod = 10**9 + 7
     
    ans = 0
    for i in range(k,n+2):
        min = i*(i-1)//2
        max = (n+1)*n//2 - (n+1-i)*(n-i)//2
        ans += (max - min + 1)%mod
    print(ans%mod)

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

#include <iomanip>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const int64_t mod = 1e9 + 7;

int main(void) {
  ios::sync_with_stdio(false);
  int64_t N, K;
  cin >> N >> K;

  int64_t answer = 1;
  int64_t min_num = 0;
  int64_t max_num = 0;
  for (int i = 0; i < K; ++i) {
    min_num += i;
    max_num += (N - i);
  }
  for (int i = K; i <= N; ++i) {
    answer = (answer + max_num - min_num + 1) % mod;
    min_num += i;
    max_num += (N - i);
  }
  cout << answer << endl;
  return 0;
}


Compiler output:
main.c:1:10: fatal error: iomanip: No such file or directory
    1 | #include <iomanip>
      |          ^~~~~~~~~
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;
#define PI 3.14159265359

int main(){
    int n,k;
    cin >> n >> k;
    int ans = 0;
    for(int i=k; i<=n+1; i++){
        ll l = sum(0,i-1), r = sum(n-i+1, n);
        ans += r-l+1;
    }
    cout << ans << endl;
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'sum' was not declared in this scope
   12 |         ll l = sum(0,i-1), r = sum(n-i+1, n);
      |                ^~~
a.cc:13:16: error: 'r' was not declared in this scope
   13 |         ans += r-l+1;
      |                ^
Language: C

#include<stdio.h>
int main(void)
{
  long long int N,K,i,j,ans;
  scanf("%lld %lld",&N,&K);
  int min[N],max[N],sum[N];
  for(i=0;i<=N;i++){
    min[i]=0;
    max[i]=0;
    sum[i]=0;
  }
  for(j=K;j<=N;i++){
    for(i=0;i<=K;i++)
      min[j]+=i;
    for(i=0;i<=N;i++)
      max[j]+=i;
    sum[j]=max[j]-(min[j]-1);
  }
  for(j=K;j<=N;j++)
    ans+=sum[j];
  printf("%lld",ans%100000007);

Compiler output:
main.c: In function 'main':
main.c:21:3: error: expected declaration or statement at end of input
   21 |   printf("%lld",ans%100000007);
      |   ^~~~~~
Language: C

#include <stdio.h>
 
int main(void){
  int i, f;
  long int n, k, sum=0, max=0, min=0;
  
  scanf("%ld %ld", &n, &k);
  
  for(i = k; i <= n+1; i++){
    min=0;
    max=0;
    for(f = 0; f < k; f++){
      min += f;
    }
    for(f = 0; f < k; f++){
      max += (n-f);
    }
    sum = (sum + max-min+1)%1000000007
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:39: error: expected ';' before '}' token
   18 |     sum = (sum + max-min+1)%1000000007
      |                                       ^
      |                                       ;
   19 |   }
      |   ~
Language: C

#include <stdio.h>

int main(void){
  int i, f;
  long int n, k, sum=0, max=0, min=0;
  
  scanf("%ld %ld", &n, &k);
  
  for(i = k; i <= n+1; i++){
    min=0;
    max=0
    for(f = 0; f < k; f++){
      min += f;
    }
    for(f = 0; f < k; f++){
      max += (n-f);
    }
    sum = (sum + max-min+1)%1000000007
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:10: error: expected ';' before 'for'
   11 |     max=0
      |          ^
      |          ;
   12 |     for(f = 0; f < k; f++){
      |     ~~~
Language: C++

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

int main(){
    ll n,k;
    cin>>n>>k;
    ll s(n+1);
    s[0]=0;
    for(int i=1;i<=n;i++) {
        s[i]=s[i-1]+i;
    }
    ll ans = 0;
    for(int i=k;i<=n+1; i++) {
        if(i==n+1) {
            ans += 1;
        } else {
            ans += (s[n]-s[n-i])+1;
        }
        
    }
    cout << ans%1000000007 << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: invalid types 'long long int[int]' for array subscript
   10 |     s[0]=0;
      |      ^
a.cc:12:10: error: invalid types 'long long int[int]' for array subscript
   12 |         s[i]=s[i-1]+i;
      |          ^
a.cc:12:15: error: invalid types 'long long int[int]' for array subscript
   12 |         s[i]=s[i-1]+i;
      |               ^
a.cc:19:22: error: invalid types 'long long int[long long int]' for array subscript
   19 |             ans += (s[n]-s[n-i])+1;
      |                      ^
a.cc:19:27: error: invalid types 'long long int[long long int]' for array subscript
   19 |             ans += (s[n]-s[n-i])+1;
      |                           ^
Language: C++

#include"bits/stdc++.h"

#define rep(i, N) for(int i = 0;i < N;i++)

typedef long long ll;

const int mod = 1e9 + 7;

using namespace std;



class ModInt {
public:
	long long value;
	ModInt(ll init) :value(init) {}
	ModInt(long long init) {
		value = init % mod + (init < 0 ? mod : 0);
	}
	ModInt() { value = 0; }

	ModInt pow(long long n) {
		if (n == 1)return *this;
		ModInt temp = pow(n / 2);
		if (n % 2 != 0)return temp * temp * (*this);
		else return temp * temp;
	}

	ModInt operator*(ModInt other) {
		return ModInt(value * other.value);
	}
	ModInt operator+(ModInt other) {
		return ModInt(value + other.value);
	}
	ModInt operator-() {
		return ModInt(mod - value);
	}
	ModInt operator-(ModInt other) {
		return *this + (-other);
	}
	ModInt operator/(ModInt other) {
		return *this * other.pow(mod - 2);
	}
	ModInt operator+=(ModInt other) {
		*this = *this + other;
		return*this;
	}
};

ModInt comb(ModInt n, ModInt r) {
	if (r.value > n.value)return ModInt(0);
	ModInt X(1), Y(1);
	rep(i, r.value) {
		X = X * ModInt(n - i);
		Y = Y * ModInt(r - i);
	}
	return X / Y;
}


ll sum(ll from, ll to) {
	return (from + to) * (to - from + 1) / 2;
}

int main(void) {
	int N, K; cin >> N >> K;
	
	ModInt ans=0;

	for (ll i = K; i <= N + 1; i++) {
		ll l = sum(0, i-1), m = sum(N + 1 - i, N);
		ans += m - l + 1;
	}

	cout << ans.value << endl;

	return 0;
}

Compiler output:
a.cc:17:9: error: 'ModInt::ModInt(long long int)' cannot be overloaded with 'ModInt::ModInt(ll)'
   17 |         ModInt(long long init) {
      |         ^~~~~~
a.cc:16:9: note: previous declaration 'ModInt::ModInt(ll)'
   16 |         ModInt(ll init) :value(init) {}
      |         ^~~~~~
Language: C

#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI = 3.141592653589793238462643383279;
ll getDigit(ll x) {
  return x == 0 ? 1 : log10(x) + 1;
}

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

signed main() {
  ll N, K;
  cin >> N >> K;

  ll ans = 0;
  rep2(i, K, N + 2) {
    ll min = sum(0, i - 1);
    ll max = sum(N - i + 1, N);
    ans += (max - min + 1) % 1000000007;
    ans = ans % 1000000007;
  }
  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.