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

#include <iostream>
using namespace std;

int main() {
    string S;
    cin >> S;
    for (int i = 0; i < S.length() - 1; i++) {
        if (S[i] == S[i + 1]) {
            cout << i << ' ' << i + 1 << endl;
            return 0;
        }
        if (i > 0) {
            if (S[i - 1:] == S[i + 1]) {
            cout << i - 1 << ' ' << i + 1 << endl;
            return 0;
            }
        }
    }
    cout << -1 << ' ' << -1 << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: expected ']' before ':' token
   13 |             if (S[i - 1:] == S[i + 1]) {
      |                        ^
      |                        ]
a.cc:13:24: error: expected ')' before ':' token
   13 |             if (S[i - 1:] == S[i + 1]) {
      |                ~       ^
      |                        )
a.cc:13:25: error: expected primary-expression before ']' token
   13 |             if (S[i - 1:] == S[i + 1]) {
      |                         ^
Language: C++

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

int descending_compare(const void *a, const void *b){
    if (*(int*)a > *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}

int ascending_compare(const void *a, const void *b){
    if (*(int*)a < *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}

// array pointer = *a, num of element = n, key key
int lower_bound(int *a, int n, int key){
    int ng, mid, ok;
    ng = -1, ok = n-1;
    while (abs(ok - ng) > 1){
        mid = (ok + ng) / 2;
        if (key <= a[mid]){
            ok = mid;
        }else{
            ng = mid;
        }
    }
    if (a[ok] >= key)return ok;
    return n;
}

//greatest common divisor
unsigned long gcd(unsigned long x, unsigned long y){
    if (y == 0){ 
        return x;
    }else if (x > y){
        return gcd(y, x % y);
    }else{
        return gcd(x, y % x);
    }
}

unsigned long lcm(unsigned long x, unsigned long y){
    unsigned long g = gcd(x, y);
    return x*y/g;

}



long long factorial(int x){
    long long rtn = 1;
    int i;
    for (i = x; i > 1; i--){
        rtn = (rtn*i);
    }
    return rtn;
}

/*
int struct_ascending_compare(const void *p, const void *q) {
return ((struct_name*)p)->member_name - ((struct_name*)q)->member_name;
}*/

/*unsigned long long pascal[100][100] = {0};
void make_pascal(void){
    for (int i = 0; i < 100; i++){
        pascal[i][0] = 1;
    }
    pascal[1][1] = 1;
    for (int i = 2; i < 100; i++){
        for (int j = 1; j < 100; j++){
           pascal[i][j] = (pascal[i-1][j-1]+pascal[i-1][j]) % mod;
        }
    }
}*/
long long mod = 1000000007;

//x ^ n
long long mod_pow(long long x, long long n){
    long long res = 1;
    for(int i = 0;i < 60; i++){
        if(n >> i & 1) res = res * x % mod;
        x = x * x % mod;
    }
    return res;
}

char s[100005];

int main(void){
    scanf("%s", s);
    int len = strlen(s);
    for (int i = 1; i < len-1; i++){
        for (int j = i-1; j <= i+1; j++){
            if ((i != j && s[i] == s[j]) || s[i-1] == s[i+1])) {
                printf("%d %d\n", i, i+2);
                return 0;
            }
        }
    }

    printf("-1 -1\n");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:106:62: error: expected primary-expression before ')' token
  106 |             if ((i != j && s[i] == s[j]) || s[i-1] == s[i+1])) {
      |                                                              ^
Language: C++

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

using ll = long long;
//typedef long long ll;

#define INF (1LL << 31 - 1)
#define INFLL ((1LL << 62) - 1)
#define MOD int(1e9+7)
#define repi(i,j,n) for(int i = (j); i < (n); ++i)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) for (int i = n; i >= 0; --i)
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()

int vx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, vy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};

inline bool check(int ux, int uy, int x, int y) {
  return (0 <= x and x < ux and 0 <= y and y < uy);
}

inline void init() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

string s;

int main() {
  cin >> s;

  int n = s.size(), l, r;
  l = 0, r = 1; // [l, r]
  map<char, int> mp;

  mp[s[0]]++, mp[s[1]]++;
d  
  while(true) {
    if (l == r and r == n - 1) break;
    
    if (l == r) {
      r++;
      mp[r]++;
    }
    else {
      int len = r - l + 1;

      if (len >= 2) {
        for (char c = 'a'; c <= 'z'; ++c) {
          if (mp[c] > (len / 2)) {
            cout << l + 1 << " " << r + 1 << endl;
            return 0;
          }
        }
      }

      if (r < n - 1 and mp[s[r + 1]] > 0) {
        r++;
        mp[s[r]]++;
      }
      else {
        mp[s[l]]--;
        l++;
      }
    }
  }

  cout << -1 << " " << -1 << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:1: error: 'd' was not declared in this scope
   38 | d
      | ^
Language: C++

void solve(){
    string s; cin >> s;
    for( int i = 0; i + 1 < s.size(); ++i )
        if( s[ i ] == s[ i + 1 ] ){
            cout << i + 1 << " " << i + 2 << "\n";
            return;
        }
    for( int i = 0; i + 2 < s.size(); ++i )
        if( s[ i ] == s[ i + 2 ] ){
            cout << i + 1 << " " << i + 3 << "\n";
            return;
        }
    cout << -1 << " " << -1 << "\n";
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:2:5: error: 'string' was not declared in this scope
    2 |     string s; cin >> s;
      |     ^~~~~~
a.cc:2:15: error: 'cin' was not declared in this scope
    2 |     string s; cin >> s;
      |               ^~~
a.cc:2:22: error: 's' was not declared in this scope
    2 |     string s; cin >> s;
      |                      ^
a.cc:5:13: error: 'cout' was not declared in this scope
    5 |             cout << i + 1 << " " << i + 2 << "\n";
      |             ^~~~
a.cc:10:13: error: 'cout' was not declared in this scope
   10 |             cout << i + 1 << " " << i + 3 << "\n";
      |             ^~~~
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout << -1 << " " << -1 << "\n";
      |     ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define allsort(v) sort(v.begin(),v.end())
#define allsortg(v)sort(v.begin(),v.end(),greater<int>());
const ll mod = 1e9 + 7;
const int INF = 1e9;

int main() {
	cin.sync_with_stdio(false);
	string s;
	cin >> s;
	int c[26] = {};
	int maxc = 0;
	vector<int>imos(s.size() + 1);
	rep(i, s.size()) {
		c[s[i] - '0']++;
		maxc = max(maxc, c[s[i] - '0']);
		imos[i] += maxc;
	}
	rep(i, s.size()) {
		if (imos[i] == 2) {
			cout << i - 1 << " "<<i << "\n";
			return 0;
		}
	}
	else cout << -1 << " " << -1 << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'else' without a previous 'if'
   31 |         else cout << -1 << " " << -1 << "\n";
      |         ^~~~
Language: Java

public class Main {
	 
	static final Scanner sc = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);
	static boolean debug = false;
 
	static void solve() {
		String str = sc.next();
		List<List<Integer>> pos = new ArrayList<List<Integer>>();
		for(int i=0; i<26; i++) {
			pos.add(new ArrayList<Integer>());
		}
		for(int i=0; i<str.length(); i++) {
			int c = str.charAt(i) - 'a';
			for(int j=pos.get(c).size()-1; j>=0; j--) {
				int range = i - pos.get(c).get(j) + 1;
				int count = pos.get(c).size() - j + 1;
				if(count>(range/2)) {
					out.println((pos.get(c).get(j)+1) + " " + (i+1));
					return;
				}
			}
			pos.get(c).add(i);
		}
		out.println("-1 -1");
	}
 
	public static void main(String[] args) {
		solve();

		out.flush();
		out.close();
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
	static final Scanner sc = new Scanner(System.in);
	             ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
	static final PrintWriter out = new PrintWriter(System.out,false);
	             ^
  symbol:   class PrintWriter
  location: class Main
Main.java:3: error: cannot find symbol
	static final Scanner sc = new Scanner(System.in);
	                              ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
	static final PrintWriter out = new PrintWriter(System.out,false);
	                                   ^
  symbol:   class PrintWriter
  location: class Main
Main.java:9: error: cannot find symbol
		List<List<Integer>> pos = new ArrayList<List<Integer>>();
		^
  symbol:   class List
  location: class Main
Main.java:9: error: cannot find symbol
		List<List<Integer>> pos = new ArrayList<List<Integer>>();
		     ^
  symbol:   class List
  location: class Main
Main.java:9: error: cannot find symbol
		List<List<Integer>> pos = new ArrayList<List<Integer>>();
		                              ^
  symbol:   class ArrayList
  location: class Main
Main.java:9: error: cannot find symbol
		List<List<Integer>> pos = new ArrayList<List<Integer>>();
		                                        ^
  symbol:   class List
  location: class Main
Main.java:11: error: cannot find symbol
			pos.add(new ArrayList<Integer>());
			            ^
  symbol:   class ArrayList
  location: class Main
9 errors
Language: C++

#include <iostream>
#include <set>
#include <string>

int main()
{
    using namespace std;
    string s;
    cin >> s;
    set<char> st;
    set<unsigned long long> counts;
    multiset<char> mset;
    for( auto c: s){
	st.insert( c);
	mset.insert( c);
    }
    for( auto c: st){
	counts.insert( mset.count( c));
    }
    if( counts.crbegin() / s.size()){
	cout << -1 << ' ' << -1;
    }
    else{
	cout << 1 << ' ' << s.size();
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:26: error: no match for 'operator/' (operand types are 'std::set<long long unsigned int>::reverse_iterator' {aka 'std::reverse_iterator<std::_Rb_tree_const_iterator<long long unsigned int> >'} and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   20 |     if( counts.crbegin() / s.size()){
      |         ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~
      |                       |          |
      |                       |          std::__cxx11::basic_string<char>::size_type {aka long unsigned int}
      |                       std::set<long long unsigned int>::reverse_iterator {aka std::reverse_iterator<std::_Rb_tree_const_iterator<long long unsigned int> >}
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

int main() {
    string s;
    cin >> s;
    char prepre = s[0];
    char pre = s[1];
    if (s.size()==2){
     if (s[0] == s[1]) printf("1 2\n");
     else printf("-1 -1\n");
     return 0;
    }
    for (int i = 2; i < s.size(); i++){
        if (prepre == s[i]) {
            printf("%d %d\n", i-1,i+1);
            return 0;
        }
        else if (pre == s[i]) {
            printf("%d %d\n", i,i+1);
            return 0;
        }
        else{
            prepre = pre;
            pre = s[i];
            printf("%c\n",s[i]);
        }
    }
    printf("-1 -1\n");
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:48:14: error: expected '}' at end of input
   48 |     return 0;
      |              ^
a.cc:22:12: note: to match this '{'
   22 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>

using namespace std;
typedef unsigned int uint;
typedef long long int ll;
typedef unsigned long long int ull;

#define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout<<e<<" ";}cout<<endl;
#define debugm(m) printf("L%d %s is..\n",__LINE__,#m);for(auto v:m){for(auto e:v){cout<<e<<" ";}cout<<endl;}
#define debuga(m,w) printf("L%d %s is => ",__LINE__,#m);for(int x=0;x<(w);x++){cout<<(m)[x]<<" ";}cout<<endl;
#define debugaa(m,w,h) printf("L%d %s is..\n",__LINE__,#m);for(int y=0;y<(h);y++){for(int x=0;x<(w);x++){cout<<(m)[x][y]<<" ";}cout<<endl;}
#define ALL(v) (v).begin(),(v).end()
#define BIGINT 0x7FFFFFFF
#define E107 1000000007

#define TIME chrono::system_clock::now
#define MILLISEC(t) (chrono::duration_cast<chrono::milliseconds>(t).count())

template<typename T1,typename T2>
ostream& operator <<(ostream &o,const pair<T1,T2> p){o<<"("<<p.first<<":"<<p.second<<")";return o;}

char str[100005];
int dp[100005][30];
int strsize;

int main(){
    int i,j,k,l;
    int a[30];
    
    gets(str);
    
    for (i=0;'a'<=str[i] && str[i]<='z';i++){
        for (j=i+1;'a'<=str[j] && str[j]<='z';j++){
            fill(a,a+30,0);
            for (k=i;k<=j;k++){
                a[str[k]-'a']++;
            }
            for (k=0;k<30;k++){
                if (a[k]>(j-i+1)/2){
                    printf("%d %d",i,j);
                    return 0;
                }
            }
        }
    }
    cout<<"-1 -1"<<endl;

// 部分点

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   30 |     gets(str);
      |     ^~~~
      |     getw
Language: C++

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init))
#define mp(a,b) make_pair(a,b)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const int mod = 1000000007;
constexpr int inf = ((1<<30)-1)*2+1 ;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}
template<typename T,typename U>
ll FindErase(T &v,U tar){
  ll cnt = 0;
  for(auto it = v.begin(); it != v.end();){
    if(*it == tar){
      it = v.erase(it);
      ++cnt;
    }
    else{
      ++it;
    }
  }
  return cnt;
}

template<typename T>
bool SuffixErase(T &v,size_t suf){
  if(suf > v.size()) return false;
  for(auto it = v.begin(); it != v.end();){
    if(distance(v.begin(),it) == suf){
      v.erase(it);
      return true;
    }
    else{
      ++it;
    }
  }
  return false;
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  if(s.size() > 100) return ;
  map<char,int> m;
  int l = 0,w = 3,r = w;
  bool f = false;
  rep(i,3){
    m[s[i]]++;
  }
  while(w < 100){
    l = 0,r = w;
    while(r <= s.size()){
      rep(i,26){
        if(m['a'+i] > w/2){
          f = true;
          cout << l+1 << ' ' << r+1 << endl;
          break;
        }
      }
      m[s[l]]--;
      l++;
      r++;
      m[s[r]]++;
    }
    ++w;
  }
  if(!f) cout << -1 << ' '  << -1 << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:85:22: error: return-statement with no value, in function returning 'int' [-fpermissive]
   85 |   if(s.size() > 100) return ;
      |                      ^~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <queue>

using namespace std;

#define pb push_back
#define pbk pop_back
#define fs first
#define sc second
#define sz(s) ((int) (s).size())
#define all(x) (x).begin(), (x).end()
#define mt make_tuple
#define mp make_pair
#define next hunext
#define prev huprev

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long double ld;

const int inf = 1e9;
const double pi = 4 * atan(1.0);
const double eps = 1e-9;
const int N = int(1e5) + 100;

char s[N];
vi pos[30];

int main() {
#ifdef LOCAL42
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    scanf("%s", s);
    int n = strlen(s);
    for (int i = 0; i < n; ++i) {
        pos[s[i] - 'a'].pb(i);
    }
    for (int i = 0; i < 26; ++i) {
        pii best(inf, -1);
        for (int j = 0; j < sz(pos[i]); ++j) {
            if (best.fs < 2 * j - pos[i][j] + 1) {
                cout << best.sc + 1 << " " << pos[i][j] + 1 << endl;
                return 0;
            }
            best = min(best, mp(2 * j - pos[i][j], pos[i][j]));
        }
    }
    cout << "-1 -1" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:13: error: 'strlen' was not declared in this scope
   51 |     int n = strlen(s);
      |             ^~~~~~
a.cc:16:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   15 | #include <queue>
  +++ |+#include <cstring>
   16 |
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;
const int MAX = 100000 + 10;
char str[MAX];
int main(){
  gets(str);
  int len = strlen(str);
  int ansl = -1, ansr = -1;
  for(int i = 0 ; i < len-1 ; i++){
    if(str[i] == str[i+1]){
      ansl = i+1, ansr = i+2;
    }
  }
  for(int i = 0 ; i < len-2 ; i++){
    if(str[i] == str[i+2]){
      ansl = i+1, ansr = i+3;
    }
  }
  printf("%d %d\n", ansl, ansr);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |   gets(str);
      |   ^~~~
      |   getw
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;


class Solution{

private:
    const int MOD = 1e9 + 7;
public:
    int sum(int N, int C, const vector<int>& X){

        int max_num = *max_element(X.begin(), X.end());
        vector<vector<long long>> mypow(max_num + 1, vector<long long>(C + 1, 1ll));
        for(int i = 2; i <= max_num; i ++)
            for(int j = 1; j <= C; j ++)
                mypow[i][j] = mypow[i][j - 1] * i % MOD;

        vector<vector<long long>> res(C + 1, vector<long long>(N, 1ll));
        for(int c = 1; c <= C; c ++){
            res[c][0] = mypow[X[0]][c];
            for(int i = 1; i < N; i ++){
                res[c][i] = 0;
                for(int x = 0; x <= c; x ++)
                    res[c][i] += mypow[X[i]][x] * res[c - x][i - 1], res[c][i] %= MOD;
            }
        }
        return res[C][N - 1];
    }

private:
    vector<vector<long long>> get_dis(int C, int N){

        vector<vector<long long>> res(C + 1, vector<long long>(N, 1ll));
        for(int c = 1; c <= C; c ++)
            for(int n = 2; n <= N; n ++){
                res[c][n] = 0;
                for(int x = 0; x <= c; x ++)
                    res[c][n] += res[c - x][n - 1], res[c][n] %= MOD;
            }
        return res;
    }

    vector<vector<long long>> get_mypow(const vector<int>& A, const vector<int>& B, int C){

        int max_num = max(*max_element(A.begin(), A.end()), *max_element(B.begin(), B.end()));
        vector<vector<long long>> res(max_num + 1, vector<long long>(C + 1, 1ll));

        for(int i = 2; i <= max_num; i ++)
            for(int j = 1; j <= C; j ++)
                res[i][j] = res[i][j - 1] * i % MOD;
        return res;
    }
};

int main() {

    int N, C;
    scanf("%d%d", &N, &C);

    vector<int> A(N), B(N);
    for(int i = 0 ; i < N; i ++) scanf("%d", &A[i]);
    for(int i = 0 ; i < N; i ++){
        scanf("%d", &B[i]);
        assert(B[i] == A[i]);
    }
    printf("%d\n", Solution().sum(N, C, A));

    return 0;
}


Compiler output:
a.cc: In member function 'int Solution::sum(int, int, const std::vector<int>&)':
a.cc:15:24: error: 'max_element' was not declared in this scope
   15 |         int max_num = *max_element(X.begin(), X.end());
      |                        ^~~~~~~~~~~
a.cc: In member function 'std::vector<std::vector<long long int> > Solution::get_mypow(const std::vector<int>&, const std::vector<int>&, int)':
a.cc:48:28: error: 'max_element' was not declared in this scope
   48 |         int max_num = max(*max_element(A.begin(), A.end()), *max_element(B.begin(), B.end()));
      |                            ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:67:9: error: 'assert' was not declared in this scope
   67 |         assert(B[i] == A[i]);
      |         ^~~~~~
a.cc:4:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    3 | #include <vector>
  +++ |+#include <cassert>
    4 |
Language: C

#include<bits/stdc++.h>
#define M 1000000007
#define N 505
#define ll long long
#define ri register int
using namespace std;

inline int read()
{
	int f=1,x=0;
	char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-'0';ch=getchar();}
	return f*x;
}

int n,c,l,sum[505][505],a[505],b[505],f[505][505];

inline int power(int a,int b)
{
	ll ans=1;
	while(b)
	{
		if(b&1)ans=ans*a%M;
		b>>=1;
		a=a*a%M;
	}
	return ans%M;
}

int main()
{
	n=read(),c=read();
	for(ri i=1;i<=n;i++)
		a[i]=read();
	for(ri i=1;i<=n;i++)
		b[i]=read();
	for(ri i=1;i<=n;i++)
		sum[i][0]=b[i]-a[i]+1;
	f[0][0]=1;
	for(ri i=1;i<=n;i++)
	for(ri j=1;j<=c;j++)
	for(ri k=a[i];k<=b[i];k++)
		sum[i][j]=(sum[i][j]+power(k,j))%M;
	for(ri i=1;i<=n;i++)
		f[i][0]=(f[i-1][0]*sum[i][0])%M;
	for(ri i=1;i<=n;i++)
	for(ri j=1;j<=c;j++)
	for(ri k=0;k<=j;k++)
		f[i][j]=(f[i][j]+f[i-1][j-k]*sum[i][k])%M;
	cout<<f[n][c];
	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: Java

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

public class arc59e 
{
	public static void main(String[] args) { new arc59e(); }
	FS in = new FS();
	PrintWriter out = new PrintWriter(System.out);
	
	int n, c;
	long mod = (long)1e9 + 7;
       	int[] a, b;
	long[][] pre, dp;
	
	arc59e() {
		n = in.nextInt();
		c = in.nextInt();
		a = new int[n]; b = new int[n];
		for (int i = 0; i < n; a[i++] = in.nextInt());
		for (int i = 0; i < n; b[i++] = in.nextInt());

		pre = new long[n][c + 1];
		for (int i = 0; i < n; i++)
			for (int j = 0; j <= c; j++)
				for (int k = a[i]; k <= b[i]; k++) {
					pre[i][j] += pow(k, j);
					pre[i][j] %= mod;
				}

		dp = new long[n][c + 1];
		for (int i = 0; i < n; i++)
			Arrays.fill(dp[i], -1L);
		out.println(dp(0, c));
		out.close();
	}
	
	long dp(int idx, int left) {
		if (left == 0)
			return 1;
		if (idx == n)
			return 0;
		if (dp[idx][left] != -1)
			return dp[idx][left];

		long ans = 0;
		for (int i = 0; i <= left; i++) {
			ans += mult(pre[idx][i], dp(idx + 1, left - i));
			ans %= mod;
		}
		return dp[idx][left] = ans;
	}

	long mult(long a, long b) {
		return (a % mod)*(b % mod) % mod;
	}

	long pow(int a, long b) {
		if (b == 0) 
			return 1;
		if (b == 1)
			return a % mod;
		long mid = pow(a, b / 2);
		mid *= mid; mid %= mod;
		if ((b & 1) == 0)
			return mid;
		return (a * mid) % mod;
	}
	
	class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
	}
}


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


#include<iostream>
#include <cstdio>
#include<algorithm>
#define LL long long
#define INF 0x3f3f3f3f
//#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int MAXN = 405;
const LL mod = 1e9+7;
LL sum[MAXN];
LL A[MAXN],B[MAXN];
LL dp[MAXN][MAXN];
LL N,C;
using namespace std;

void calc(int a, int b) {
	memset(sum,0,sizeof(sum));
	for(int i = a; i <= b; ++i)
	{
		LL t = 1;
		for(int j = 0; j <= C; ++j)
		{
			sum[j] = sum[j]+t;
			sum[j] %= mod;
			t = t*i%mod;
		}
	}
}

int main()
{
	//io;
	cin>>N>>C;
	for(int i = 1; i <= N; ++i)
		cin>>A[i];
	for(int i = 1; i <= N; ++i)
		cin>>B[i];
	dp[0][0] = 1;
	for(int i = 1; i <= N; ++i)
	{
		calc(A[i],B[i]);//计算A[i]^m + (A[i]+1)^m + ... + B[i]^m
		for(int j = 0; j <= C; ++j)
			for(int k = 0; k <= j; ++k)
				dp[i][j] = (dp[i][j] + dp[i-1][j-k]*sum[k])%mod;
	}
	cout << dp[N][C] << endl;
	return 0;
}


Compiler output:
a.cc: In function 'void calc(int, int)':
a.cc:17:9: error: 'memset' was not declared in this scope
   17 |         memset(sum,0,sizeof(sum));
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<algorithm>
  +++ |+#include <cstring>
    5 | #define LL long long
Language: C++


#include<bits/stdc++.h>
#include<algorithm>
#define LL long long
#define INF 0x3f3f3f3f
//#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int MAXN = 405;
const LL mod = 1e9+7;
LL sum[MAXN];
LL A[MAXN],B[MAXN];
LL dp[MAXN][MAXN];
LL N,C;
 
LL calc(int a, int b)
{
    memset(sum,0,sizeof(sum));
    for(int i = a; i <= b; ++i)
    {
        LL t = 1;
        for(int j = 0; j <= C; ++j)
        {
            sum[j] = sum[j]+t;
            sum[j] %= mod;
            t = t*i%mod;
        }
    }
}
 
int main()
{
    //io;
    cin >> N >> C;
    for(int i = 1; i <= N; ++i)
        cin >> A[i];
    for(int i = 1; i <= N; ++i)
        cin >> B[i];
    dp[0][0] = 1;
    for(int i = 1; i <= N; ++i)
    {
        calc(A[i],B[i]);//计算A[i]^m + (A[i]+1)^m + ... + B[i]^m
        for(int j = 0; j <= C; ++j)
            for(int k = 0; k <= j; ++k)
                dp[i][j] = (dp[i][j] + dp[i-1][j-k]*sum[k])%mod;
    }
    cout << dp[N][C] << endl;
    return 0;
}


Compiler output:
a.cc: In function 'long long int calc(int, int)':
a.cc:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
   27 | }
      | ^
a.cc: In function 'int main()':
a.cc:32:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   32 |     cin >> N >> C;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:45:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   45 |     cout << dp[N][C] << 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:45:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   45 |     cout << dp[N][C] << 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>
#include<algorithm>
#define LL long long
#define INF 0x3f3f3f3f
#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int MAXN = 405;
const LL mod = 1e9+7;
LL sum[MAXN];
LL A[MAXN],B[MAXN];
LL dp[MAXN][MAXN];
LL N,C;
 
LL calc(int a, int b)
{
    memset(sum,0,sizeof(sum));
    for(int i = a; i <= b; ++i)
    {
        LL t = 1;
        for(int j = 0; j <= C; ++j)
        {
            sum[j] = sum[j]+t;
            sum[j] %= mod;
            t = t*i%mod;
        }
    }
}
 
int main()
{
    io;
    cin >> N >> C;
    for(int i = 1; i <= N; ++i)
        cin >> A[i];
    for(int i = 1; i <= N; ++i)
        cin >> B[i];
    dp[0][0] = 1;
    for(int i = 1; i <= N; ++i)
    {
        calc(A[i],B[i]);//计算A[i]^m + (A[i]+1)^m + ... + B[i]^m
        for(int j = 0; j <= C; ++j)
            for(int k = 0; k <= j; ++k)
                dp[i][j] = (dp[i][j] + dp[i-1][j-k]*sum[k])%mod;
    }
    cout << dp[N][C] << endl;
    return 0;
}



Compiler output:
a.cc: In function 'long long int calc(int, int)':
a.cc:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
   27 | }
      | ^
a.cc: In function 'int main()':
a.cc:6:12: error: 'ios' has not been declared
    6 | #define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
      |            ^~~
a.cc:31:5: note: in expansion of macro 'io'
   31 |     io;
      |     ^~
a.cc:6:36: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | #define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
      |                                    ^~~
a.cc:31:5: note: in expansion of macro 'io'
   31 |     io;
      |     ^~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:47: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 | #define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
      |                                               ^~~~
a.cc:31:5: note: in expansion of macro 'io'
   31 |     io;
      |     ^~
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:45:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   45 |     cout << dp[N][C] << 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>
#include<algorithm>
#include<iostream>
#define LL long long
#define INF 0x3f3f3f3f
#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int MAXN = 405;
const LL mod = 1e9+7;
LL sum[MAXN];
LL A[MAXN],B[MAXN];
LL dp[MAXN][MAXN];
LL N,C;
 
LL calc(int a, int b)
{
    memset(sum,0,sizeof(sum));
    for(int i = a; i <= b; ++i)
    {
        LL t = 1;
        for(int j = 0; j <= C; ++j)
        {
            sum[j] = sum[j]+t;
            sum[j] %= mod;
            t = t*i%mod;
        }
    }
}
 
int main()
{
    io;
    cin >> N >> C;
    for(int i = 1; i <= N; ++i)
        cin >> A[i];
    for(int i = 1; i <= N; ++i)
        cin >> B[i];
    dp[0][0] = 1;
    for(int i = 1; i <= N; ++i)
    {
        calc(A[i],B[i]);//计算A[i]^m + (A[i]+1)^m + ... + B[i]^m
        for(int j = 0; j <= C; ++j)
            for(int k = 0; k <= j; ++k)
                dp[i][j] = (dp[i][j] + dp[i-1][j-k]*sum[k])%mod;
    }
    cout << dp[N][C] << endl;
    return 0;
}



Compiler output:
a.cc: In function 'long long int calc(int, int)':
a.cc:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
   28 | }
      | ^
a.cc: In function 'int main()':
a.cc:7:12: error: 'ios' has not been declared
    7 | #define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
      |            ^~~
a.cc:32:5: note: in expansion of macro 'io'
   32 |     io;
      |     ^~
a.cc:7:36: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | #define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
      |                                    ^~~
a.cc:32:5: note: in expansion of macro 'io'
   32 |     io;
      |     ^~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:47: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 | #define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
      |                                               ^~~~
a.cc:32:5: note: in expansion of macro 'io'
   32 |     io;
      |     ^~
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:46:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   46 |     cout << dp[N][C] << 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>
#include<iostream>
#define LL long long
#define INF 0x3f3f3f3f
#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int MAXN = 405;
const LL mod = 1e9+7;
LL sum[MAXN];
LL A[MAXN],B[MAXN];
LL dp[MAXN][MAXN];
LL N,C;
 
LL calc(int a, int b)
{
    memset(sum,0,sizeof(sum));
    for(int i = a; i <= b; ++i)
    {
        LL t = 1;
        for(int j = 0; j <= C; ++j)
        {
            sum[j] = sum[j]+t;
            sum[j] %= mod;
            t = t*i%mod;
        }
    }
}
 
int main()
{
    io;
    cin >> N >> C;
    for(int i = 1; i <= N; ++i)
        cin >> A[i];
    for(int i = 1; i <= N; ++i)
        cin >> B[i];
    dp[0][0] = 1;
    for(int i = 1; i <= N; ++i)
    {
        calc(A[i],B[i]);//计算A[i]^m + (A[i]+1)^m + ... + B[i]^m
        for(int j = 0; j <= C; ++j)
            for(int k = 0; k <= j; ++k)
                dp[i][j] = (dp[i][j] + dp[i-1][j-k]*sum[k])%mod;
    }
    cout << dp[N][C] << endl;
    return 0;
}



Compiler output:
a.cc: In function 'long long int calc(int, int)':
a.cc:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
   27 | }
      | ^
a.cc: In function 'int main()':
a.cc:6:12: error: 'ios' has not been declared
    6 | #define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
      |            ^~~
a.cc:31:5: note: in expansion of macro 'io'
   31 |     io;
      |     ^~
a.cc:6:36: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | #define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
      |                                    ^~~
a.cc:31:5: note: in expansion of macro 'io'
   31 |     io;
      |     ^~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:47: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 | #define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
      |                                               ^~~~
a.cc:31:5: note: in expansion of macro 'io'
   31 |     io;
      |     ^~
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:45:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   45 |     cout << dp[N][C] << 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++

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.TreeMap;




public class Main {
	  static int MOD=1000000007;
	  static long p[][]=new long[405][405];
	  static long sum[][]=new long[405][405];
	  static long dp[][]=new long[405][405];
	  static long a[]=new long[405];
	  static long b[]=new long[405];
      public static void main(String[] args) {
    	  Scanner in=new Scanner( new BufferedReader(new InputStreamReader(System.in)))	;
    
    	  
    	  for(int i=1;i<=404;i++)//p[i][j]=i^j
    	  {
    		  p[i]= new long[405];
    		  p[i][0]=1;
    		  for(int j=1;j<=404;j++)
    		  {
    			  p[i][j]=(p[i][j-1]*i)%MOD;
    		  }
    	  }
    	 
    	  for(int i=1;i<=404;i++)//sum[i][j] 1^j+...+i^j
    	  {
    		  sum[i]=new long[405];
    		 
    		  for(int j=0;j<=404;j++)
    		  {
    			  sum[0][j]=0;
    			  sum[i][j]=(sum[i-1][j]%MOD+p[i][j]%MOD)%MOD;
    		  }
    	  }
    	  int n=in.nextInt();
    	  int m=in.nextInt();
    	  
    	  for(int i=1;i<=n;i++)
    	  {
    		  a[i]=in.nextLong();
    	  }
    	  for(int i=1;i<=n;i++)
    	  {
    		  b[i]=in.nextLong();
    	  }
    	  
    	  dp[0][0]=1;
    	  for(int i=1;i<=n;i++)
    	  {
    		  for(int j=0;j<=m;j++)
    		  {
    			  for(int k=0;k<=j;k++)
    			  {
    				  long temp=(sum[(int) b[i]][k]%MOD-sum[(int) (a[i]-1)][k]%MOD+MOD)%MOD;
    				  dp[i][j]=(dp[i][j]%MOD+dp[i-1][j-k]*temp%MOD)%MOD;
    			  }
    		  }
    	  }
    	  System.out.println(dp[n][m]);
    	  return;
      }
}


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

#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll mod=1e9+7;
ll p[406][406];
ll pre[406][406];
ll dp[406][406]={};
ll a[406],b[406];
int main()
{
    p[0][0]=1;
    for(ll i=1;i<=400;i++)
    {
        p[i][0]=1;
        pre[i][0]=1;
        for(ll j=1;j<=400;j++)
        {
            p[i][j]=(p[i][j-1]*i)%mod;
        }
    }
    pre[0][0]=1;
    for(ll i=1;i<=400;i++)
        for(ll j=0;j<=400;j++)
    {
        pre[i][j]=(pre[i-1][j]+p[i][j])%mod;
    }



    ll n,c;
    cin>>n>>c;
    for(ll i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    for(ll i=1;i<=n;i++)
    {
        cin>>b[i];
    }

    dp[0][0]=1;
    for(ll i=1;i<=n;i++)
    {
        for(ll j=0;j<=c;j++)
        {
            for(ll k=0;k<=j;k++)
            {
                ll y=(pre[b[i]][j-k]-pre[a[i]-1][j-k])%mod;
                dp[i][j]+=dp[i-1][k]*y;
                dp[i][j]%mod;
            }
        }
    }
    cout<<dp[n][c]&mod<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:23: error: invalid operands of types 'const long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   54 |     cout<<dp[n][c]&mod<<endl;
      |                    ~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
#define fr(i, n, m) for(int i = (n); i < (m); i ++)
#define pb push_back
#define st first
#define nd second

using namespace std;
typedef long long ll;
ll mod = 1e9 + 7;
ll f[400][400];


ll modpow(ll x, int k){
    if(f[x][k] != -1) return f[x][k];
    if(k == 0){
        return 1;
    }
    ll p = modpow(x, k / 2);
    p *= p;
    p %= mod;
    if(k % 2){
        p *= x;
        p %= mod;
    }
    
    f[x][k] = p;
    return p;

}


int main()
{
    memset(f, -1, sizeof(dp));
    int n, c;
    cin >> n >> c;
    int a[n], b[n];
    fr(i, 0, n){
        cin >> a[i];
    }
    fr(i, 0, n){
        cin >> b[i];
    }

    ll dp[n][c + 1];
    memset(dp, 0, sizeof(dp));

    fr(i, 0, c + 1){
        dp[0][i] = pow(a[0], i);
    }
    fr(i, 1, n){
        fr(ctot, 0, c + 1){
            fr(cbef, 0, ctot + 1){
                dp[i][ctot] += (dp[i - 1][cbef] * modpow(a[i], ctot - cbef))%mod;
                dp[i][ctot] %= mod;

            }
        }
    }

    cout << dp[n - 1][c] << endl;





    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:26: error: 'dp' was not declared in this scope; did you mean 'dup'?
   34 |     memset(f, -1, sizeof(dp));
      |                          ^~
      |                          dup
Language: C++

#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)1e18;
const double PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

//////////////////
void solve(){
	int N,C;
	cin >> N >> C;
	vector<LL> A(N),B(N);
	for(int i=0;i<N;++i){
		cin >> A[i];
	}
	for(int i=0;i<N;++i){
		cin >> B[i];
	}
	vector<vector<LL> > G(N,vector<LL>(C+1,0));
	for(int i=0;i<N;++i){
		for(int c=0;c<=C;++c){
			LL temp = 0;
			for(int x=A[i];x<=B[i];++x){
				temp += powMod(x,c);
				if(temp >= MOD ){
					temp -= MOD;
				}
			}
			G[i][c] = temp;
		}
	}

	vector< vector<LL> > dp(N,vector<LL>(C+1,0));
	dp[0] = G[0];
	
	for(int i=1;i<N;++i){
		for(int now=0;now<=C;++now){
			//dp[i][now]
			for(int k=C-now;k>=0;--k){
				dp[i][now+k] = (dp[i][now+k] + dp[i-1][now] * G[i][k])%MOD;
			}
		}
	}
	cout << dp[N-1][C] << endl;
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	
	
	solve();
}
#pragma endregion //main()


Compiler output:
a.cc: In function 'void solve()':
a.cc:63:41: error: 'powMod' was not declared in this scope
   63 |                                 temp += powMod(x,c);
      |                                         ^~~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#define INF_LL 1e18
#define INF 1e9

#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()

using namespace std;

using ll = long long;
using PII = pair<int, int>;

class Union_find{
private:
	vector<int> par;
	vector<int> rank;
	int n;

public:
	Union_find(int a){
		n = a;
		for(int i = 0;i < n;i++){
			par.push_back(i);
			rank.push_back(0);
		}
	}

	int find(int x){
		if(par[x] == x){
			return x;
		}else{
			return par[x] = find(par[x]);
		}
	}

	void unite(int x, int y){
		x = find(x);
		y = find(y);
		if(x == y) return;

		if(rank[x] < rank[y]){
			par[x] = y;
		}else{
			par[y] = x;
			if(rank[x] == rank[y]) rank[x]++;
		}
	}

	bool same(int x, int y){
		return find(x) == find(y);
	}
};

ll mod = 1e9+7;

ll powm(ll x, ll a){
	ll res = 1;
	REP(i, a){
		res = (res * x) % mod;
	}
	return res;
}

int main(void){
	int N, C;
	ll A[401], B[401];
	ll dp[401][401] = {};
	cin >> N >> C;
	REP(i, N){
		cin >> A[i];
	}
	REP(i, N){
		cin >> B[i];
	}
	ll mul[401][401] = {};
	REP(i, N){
		REP(j, C+1){
			mul[i][j] = powm(i, j);
		}
	}
	FOR(i, 1, N){
		REP(j, C+1){
			mul[i][j] = (mul[i-1][j] + mul[i][j]) % mod;
		}
	}
	dp[0][0] = 1;
	REP(i, N){
		REP(j, C+1){
			ll sum = 0;
			REP(k, j+1){
				sum = (sum + (dp[i][j-k] * (mul[B[i]][k] - mul[A[i]-1][k] + mod)%mod) % mod;
			}
			dp[i+1][j] += sum;
			dp[i+1][j] %= mod;
		}
	}
	cout << dp[N][C] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:106:108: error: expected ')' before ';' token
  106 |                                 sum = (sum + (dp[i][j-k] * (mul[B[i]][k] - mul[A[i]-1][k] + mod)%mod) % mod;
      |                                       ~                                                                    ^
      |                                                                                                            )
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

long long mod=1000000007;

long long  calc(long long  p,int q){
	long long ans =1;
	for(int i=0;i<q;i++){
		ans = (ans*p)%mod;
	}
	return ans;
}

int main(){
	long long  ruijo[401][401]={};
	for(int t=0;t<401;t++){
		ruijo[0][t]=t;
	}
	for(int k=1;k<401;k++){
		for(int l=1;l<401;l++){
			ruijo[k][l] = (ruijo[k][l-1] + calc(l,k))%mod;
		}
	}
	long long  n,c,tmp,g;
	long long dp[401][401]={};
	dp[0][0]=1;
	vector <long long> a,b;
	cin >> n >>c;
	for(int i=0;i<n;i++){
		cin >> tmp;
		a.push_back(tmp);
	}
	for(int j=0;j<n;j++){
		cin >> tmp;
		b.push_back(tmp);
	}
	for(int x=1;x<=n;x++){
		for(int y=0;y<=c;y++){
			for(int z=0;z<=y;z++){
				g = (ruijo[z][b[x-1]]-ruijo[z][a[x-1]-1] + 10*mod)%mod;
				dp[x][y]=(dp[x][y]+g)%mod;
			}
		}
	}
	cout << dp[n][c] <<endl;
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:51:18: error: expected '}' at end of input
   51 |         return 0;
      |                  ^
a.cc:19:11: note: to match this '{'
   19 | int main(){
      |           ^