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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ss second
#define ff first
#define pb push_back
#define mp make_pair
ll n,m,p;
ll f[2600];
vector<int> v[2600],v2[2600];int o;
bool ok[2600][2600];
void st(int cr,ll sum)
{
    if(f[cr]>=sum)
    {
        return;
    }
    f[cr]=sum;

    if(cr==o&&sum>=1&&ok[cr][n]&&ok[1][cr])
    {
        cout<<-1;
        exit(0);
    }
    if(cr==o&&!ok[1][cr]||!ok[cr][n])
        return;
    if(!ok[cr][o])
        return;
    if(!ok[cr][n])
        return;
    for(int i=0;i<v[cr].size();i++)
    {
        st(v[cr][i],sum+v2[cr][i]-p);
    }
}
go(int cr,int rot)
{
    if(ok[rot][cr]==1)
        return 0;
    ok[rot][cr]=1;
    for(int i=0;i<v[cr].size();i++)
    {
        go(v[cr][i],rot);
    }
}
void gop(int cr,ll sum)
{
    if(!ok[cr][n])
        return;
    if(f[cr]>=sum)
        return;
    f[cr]=sum;
   // cout<<sum<<endl;
    for(int i=0;i<v[cr].size();i++){
        gop(v[cr][i],sum+v2[cr][i]-p);
    }
    return;

}
int main() {
    cin>>n>>m>>p;
    for(int i=0;i<m;i++){
        int a,b,c;cin>>a>>b>>c;
        v[a].pb(b);
        v2[a].pb(c);
    }
    for(int i=1;i<=n;i++)
    {
        go(i,i);
    }
    for(int i=1;i<=n;i++)
    {   for(int j=1;j<=n;j++)
            f[i]=-1e15;
            o=i;
        st(i,0);
    }
    for(int i=1;i<=n;i++)
        f[i]=-1e15;
    gop(1,0);
    cout<<max(f[n],0LL);
    return 0;
    }


Compiler output:
a.cc:36:1: error: ISO C++ forbids declaration of 'go' with no type [-fpermissive]
   36 | go(int cr,int rot)
      | ^~
a.cc: In function 'int go(int, int)':
a.cc:45:1: warning: control reaches end of non-void function [-Wreturn-type]
   45 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int N, M, P;
vector<pair<int,int64_t>> adj[3000];

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


	cin >> N >> M >> P;

	for (int i=0;i<M;++i) {
		int64_t u,v,w;
		cin>>u>>v>>w;
		--u;--v;
		adj[u].emplace_back(v,-w+P);
	}

	vector<int64_t> cost(N, 1e18);
	cost[0]=0;
	for (int i=0;i<M-1;++i) {
		for (int j=0;j<N;++j) {
			for (auto& e : adj[j]) {
				cost[e.first] = min(cost[e.first],e.second+cost[j]);
			}
		}
	}
	for (int i=0;i<M;++i) {
		for (int j=0;j<N;++j) {
			for (auto& e : adj[j]) {
				if (e.first == N-1 && cost[N-1]>e.second+cost[j]) {
					cout << -1 << endl;
					return 0;
				}
				cost[e.first] = min(cost[e.first],e.second+cost[j]);
			}
		}
	}
	cout << max(0,-cost[N-1]) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:20: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)'
   42 |         cout << max(0,-cost[N-1]) << endl;
      |                 ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:42:20: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type' {aka 'long int'})
   42 |         cout << max(0,-cost[N-1]) << endl;
      |                 ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:42:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   42 |         cout << max(0,-cost[N-1]) << endl;
      |                 ~~~^~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ss second
#define ff first
#define pb push_back
#define mp make_pair
ll n,m,p;
ll f[2600];
vector<int> v[2600],v2[2600];int o;
bool ok[2600][2600];
void st(int cr,ll sum)
{
    if(f[cr]>=sum)
    {
        return;
    }
    f[cr]=sum;

    if(cr==o&&sum>=1&&ok[cr][n]&&ok[1][cr])
    {
        cout<<-1;
        exit(0);
    }
    if(cr==o&&!ok[1][cr]||!ok[cr][n])
        return;
    if(!ok[cr][o])
        return;
    if(!ok[cr][n])
        return;
    for(int i=0;i<v[cr].size();i++)
    {
        st(v[cr][i],sum+v2[cr][i]-p);
    }
}
go(int cr,int rot)
{
    if(ok[rot][cr]==1)
        return 0;
    ok[rot][cr]=1;
    for(int i=0;i<v[cr].size();i++)
    {
        go(v[cr][i],rot);
    }
}
void gop(int cr,ll sum)
{
    if(!ok[cr][n])
        return;
    if(f[cr]>=sum)
        return;
    f[cr]=sum;
   // cout<<sum<<endl;
    for(int i=0;i<v[cr].size();i++){
        gop(v[cr][i],sum+v2[cr][i]-p);
    }
    return;

}
int main() {
    cin>>n>>m>>p;
    for(int i=0;i<m;i++){
        int a,b,c;
        scanf("%d%d%d",&a,&b,&c);
        v[a].pb(b);
        v2[a].pb(c);
    }
    for(int i=1;i<=n;i++)
    {
        go(i,i);
    }
    for(int i=1;i<=n;i++)
    {   for(int j=1;j<=n;j++)
            f[i]=-1e15;
            o=i;
        st(i,0);
    }
    for(int i=1;i<=n;i++)
        f[i]=-1e15;
    gop(1,0);
    cout<<max(f[n],0LL);
    return 0;
    }


Compiler output:
a.cc:36:1: error: ISO C++ forbids declaration of 'go' with no type [-fpermissive]
   36 | go(int cr,int rot)
      | ^~
a.cc: In function 'int go(int, int)':
a.cc:45:1: warning: control reaches end of non-void function [-Wreturn-type]
   45 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define inf (long long)1e18
using namespace std;

struct data {
  long long a, b, c;
};

long long n, m, p;
long long dist[2600] = {0};
vector<data> edge;
priority_queue<data> pq;

long long solve();
bool bell();

int main() {
  cin >> n >> m >> p;
  for(int i = 0; i < m; ++i) {
    int a, b, c;
    cin >> a >> b >> c;
    edge.push_back({--a, --b, p - c});
  }
  cout << solve() << endl;
  return 0;
}

long long solve() {
  for(int i = 0; i < n; ++i) dist[i] = inf;
  dist[0] = 0;
  for(int i = 0; i < n - 1; ++i) bell();
  if(bell())
    return -1;
  else if(dist[n - 1] == inf)
    return 0;
  else
    return max(-dist[n - 1], 0LL);
};

bool bell() {
  bool ch = 0;
  for(int i = 0; i < m; ++i) {
    data now = edge[i];
    if(dist[now.a] != inf &&
       dist[now.b] > dist[now.a] + now.c) {
      if(now.b == n - 1) ch = 1;
      dist[now.b] = dist[now.a] + now.c;
    }
  }
  return ch;
}

Compiler output:
a.cc:11:12: error: template argument 1 is invalid
   11 | vector<data> edge;
      |            ^
a.cc:11:12: error: template argument 2 is invalid
a.cc:12:20: error: template argument 1 is invalid
   12 | priority_queue<data> pq;
      |                    ^
a.cc:12:20: error: template argument 2 is invalid
a.cc:12:20: error: template argument 3 is invalid
a.cc: In function 'int main()':
a.cc:22:10: error: request for member 'push_back' in 'edge', which is of non-class type 'int'
   22 |     edge.push_back({--a, --b, p - c});
      |          ^~~~~~~~~
a.cc: In function 'bool bell()':
a.cc:43:5: error: reference to 'data' is ambiguous
   43 |     data now = edge[i];
      |     ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:5:8: note:                 'struct data'
    5 | struct data {
      |        ^~~~
a.cc:44:13: error: 'now' was not declared in this scope; did you mean 'pow'?
   44 |     if(dist[now.a] != inf &&
      |             ^~~
      |             pow
Language: C++

#include <bits/stdc++.h>

int main()
{
	int N, M, P;
	scanf("%d%d%d", &N, &M, &P);
	using vpi = std::vector<std::pair<int, int>>;
	using vvpi = std::vector<vpi>;

	vvpi edges(N);
	for (int i{}; i < M; i++)
	{
		int A, B, C;
		scanf("%d%d%d", &A, &B, &C);
		A--; B--;
		edges[A].push_back({B, C - P});
	}
	std::vector<int64_t> distance(N, -(1ll << 60));
	distance[0] = 0;
	for (int loop{}; loop < N; loop++)
		for (int from{}; from < N; from++)
			for (auto& e: edges[from])
				distance[e.first] = std::max(distance[e.first], distance[from] + e.second);
	
	int64_t ans{distance.back()};
	for (int loop{}; loop < N; loop++)
		for (int from{}; from < N; from++)
			for (auto& e: edges[from])
				distance[e.first] = std::max(distance[e.first], distance[from] + e.second);
	
	if (ans != distance.back()) puts("-1");
	else printf("%lld\n", std::max(0ll, ans));

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:39: error: no matching function for call to 'max(long long int, int64_t&)'
   32 |         else printf("%lld\n", std::max(0ll, ans));
      |                               ~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:32:39: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int64_t' {aka 'long int'})
   32 |         else printf("%lld\n", std::max(0ll, ans));
      |                               ~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:32:39: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   32 |         else printf("%lld\n", std::max(0ll, ans));
      |                               ~~~~~~~~^~~~~~~~~~
Language: C++

#include "competitive-template.hpp"
#include "misc/fastio.hpp"
#include "ntt/cooley-turkey-ntt.hpp"

#include "modint/arbitrary-modint.hpp"
#include "misc/timer.hpp"

void solve() {
  using mint = ArbitraryModInt;
  int p;
  rd(p);
  if (p == 2) {
    int a, b;
    rd(a, b);
    wt(a, ' ', (a - b + p) % p, '\n');
    return;
  }

  mint::set_mod(p);
  V<mint> a(p);
  for (int i = 0; i < p; i++) {
    int n;
    rd(n);
    a[i] = n;
  }
  ArbitraryLengthNTT<mint> ntt;

  V<mint> b(p - 1);
  for (int m = 0; m < p - 1; m++) b[m] = a[ntt.w[p - 1 - m].get()];
  ntt.ntt(b);

  for (auto &x : b) x = -x;
  b.pb(b[0]);
  b[p - 1] = (b[p - 1] + p - (b[0] = a[0]));
  for (int i = 0; i < p; i++) wt(b[i].get(), " \n"[i == p - 1]);
}

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

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl
#define COYE cout<<"YES"<<endl
#define COYe cout<<"Yes"<<endl
#define COye cout<<"yes"<<endl
#define CONO cout<<"NO"<<endl
#define CONo cout<<"No"<<endl
#define COno cout<<"no"<<endl
#define FORE(i,a) for(auto &i:a)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define PB push_back
#define MP make_pair
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define EACH(V,i) for(typeof((V).begin()) i=(V).begin();i!=(V).end();++i)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
using namespace std;
using Edge=pair<int,int>;
using Graph=vector<vector<Edge>>;
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T>inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
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;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
  ll P;
  cin>>P;
  COMinit();
  ll A[P],B[P];
  REP(i,P){
    cin>>A[i];
    B[i]=0;
  }
  
  REP(i,P){
    if(A[i]==1){
      ll SIGN=1;
      B[0]+=1;
      
      for(int j=P-1; j>=0; --j){
        B[j]-=SIGN;
        SIGN*=i;
        B[j]%=P;
        if(B[j]<0) B[j]+=P;
        SIGN%=P;
      }
    }
  }
  
  REP(i,P) cout<<B[i]<<" ";
  cout<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:3: error: 'COMinit' was not declared in this scope
   73 |   COMinit();
      |   ^~~~~~~
Language: C++

#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define fi first
#define se second
#define debug(x) cout << #x << ": " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> void Print(vector<T> v) {
  F0R(i, v.size()) {
    cout << v[i] << ' ';
  }
  cout << newl;
}

#if 1

#include "RuntimeModint.h"

// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  // b[0] + b[1]x + b[2]x^2 + ... + b[p-1]x^(p-1)

  int p;
  cin >> p;

  rmint::MOD = p;

  vector<rmint> as(p);
  F0R(i, p) {
    cin >> as[i];
  }

  vector<vector<rmint>> xs(p, vector<rmint>(p));
  F0R(i, p) {
    int x = 1;
    F0R(j, p) {
      xs[i][j] = x;
      x = (x * i) % p;
    }
  }

  auto print = [&](){
    F0R(i, p) {
      F0R(j, p) {
        cout << xs[i][j] << ' ';
      }
      cout << " = " << as[i];
      cout << newl;
    }
    cout << newl;
  };
  //print();
  
  // 掃き出し法
  F0R(i, p) {
    // i番目の要素が0じゃない式をi番目に持ってくる
    if (xs[i][i] == 0) {
      FOR(j, i + 1, p) {
        if (xs[j][i].val) {
          
          // swap i, j
          xs.insert(xs.begin() + i, *xs.erase(xs.begin() + j));
          as.insert(as.begin() + i, *as.erase(as.begin() + j));
          break;
        }
      }
    }
    assert(xs[i][i]);

    if (xs[i][i].val > 1) {
      auto q = xs[i][i];
      F0R(j, p) {
        xs[i][j] /= q;
      }
      as[i] /= q;
    }

    F0R(j, p) {
      if (j == i) continue;
      if (!xs[j][i].val) continue;
      auto a = xs[j][i];
      F0R(k, p) {
        xs[j][k] -= xs[i][k] * a;
      }
      as[j] -= as[i] * a;
    }
    //print();
  }
  //print();

  F0R(i, p) {
    cout << as[i] << ' ';
  }
}
#endif


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

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



#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 repi(i,a,b) for(int i=ll(a);i<ll(b);i++)
#define rrepi(i,a,b) for(int i=ll(b);i>=int(a);i--)

#define all(x) (x).begin(),(x).end()

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; }

typedef long long ll;

using namespace std;

long long modpow(long long x,long long n,long long mod)
{
  if(n==0)return 1;
  long long res=modpow(x*x%mod,n/2,mod);
  if(n&1)res=res*x%mod;
  return res;
}
long long modinv(long long a,long long mod)
{
  return modpow(a,mod-2,mod);
}
vector<long long> fact,inv;
void init(int n,int mod){
  fact.resize(n);
  inv.resize(n);
  fact[0]=1LL;
  rep(i,n-1){
    fact[i+1]=(long long)fact[i]*(i+1)%mod;
  }
  inv[n-1]=modinv(fact[n-1],mod);
  rrep(i,n-1){
    inv[i]=(long long)inv[i+1]*(i+1)%mod;
  }
}
long long comb(ll a,ll b){
  if(b<0||a-b<0)return 0;
  return fact[a]*inv[b]%mod*inv[a-b]%mod;
}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll p;cin>>p;
  ll mod=p;
  init(p+7,p);
  vector<ll>res(p);
  rep(i,p){
    ll w;cin>>w;
    res[0]+=w;
    ll tj=1;
    rrep(j,p){
      ll td=comb(p-1,j);
      td*=tj;
      tj*=-i;
      tj%=mod;
      res[j]-=td*w;
      res[j]%=mod;
      if(res[j]<0)res[j]+=mod;
    }
  }
  rep(i,p){

  }
  rep(i,p)cout<<res[i]<<" ";
  cout<<endl;
  return 0;

}


Compiler output:
a.cc: In function 'long long int comb(ll, ll)':
a.cc:60:25: error: 'mod' was not declared in this scope; did you mean 'modf'?
   60 |   return fact[a]*inv[b]%mod*inv[a-b]%mod;
      |                         ^~~
      |                         modf
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stdlib.h>
#include <assert.h>

using namespace std;

#define ll long long
#define N 3002
int add(int x, int y, int p) {
	int ret = (x + y);
	if (ret >= p) {
		ret -= p;
	}
	else if (ret < 0) {
		ret += p;
	}
	return ret;
}
int mul(int x, int y, int p) {
	int ret = (ll)x*y%p;
	if (ret < 0) {
		ret += p;
	}
	return ret;
}
int mypow(int x, int c, int p) {
	int ret = 1;
	while (c > 0) {
		if (c & 1) {
			ret = mul(ret, x, p);
		}
		x = mul(x, x, p);
		c /= 2;
	}
	return ret;
}
int a[N][N];
int combi[N][N];
int val[N], fac[N], invFac[N];
void init(int p) {
	
	for (int i = 0; i < N; ++i) {
		combi[i][i] = combi[i][0] = 1;
		if (i == 0) {
			fac[i] = 1;
		}
		else {
			fac[i] = mul(fac[i - 1], i, p);
		}
		invFac[i] = mypow(fac[i], p - 2, p);
		for (int j = 1; j < i; ++j) {
			combi[i][j] = add(combi[i - 1][j], combi[i - 1][j - 1], p);
		}
	}
}
int ret[N], tmp[2][N];
void solve() {
	int p; scanf("%d", &p);
	init(p);
	for (int i = 0; i <= p - 1; ++i) {
		scanf("%d", &a[0][i]);
	}
	for (int i = 1; i <= p - 1; ++i) {
		int sz = p - 1 - i;
		for (int j = 0; j <= sz; ++j) {
			a[i][j] = add(a[i - 1][j + 1] ,- a[i - 1][j], p);
		}
	}
	int bit = 0;
	for (int i = 1; i <= p - 1; ++i) {
		int nbit = bit ^ 1;
		if (i == 1) {
			tmp[nbit][1] = 1, tmp[nbit][0] = 0;
		}
		else {
			memset(tmp[nbit], 0, sizeof(tmp[nbit]));
			for (int j = 0; j < i; ++j) {
				tmp[nbit][j + 1] = add(tmp[nbit][j + 1], tmp[bit][j],p);
				tmp[nbit][j] = add(tmp[nbit][j], mul(tmp[bit][j], -i+1, p), p);
			}
		}
		bit = nbit;
		int m = mul(a[i][0], invFac[i], p);

		for (int j = 0; j <= i; ++j) {
			ret[j] = add(ret[j], mul(tmp[bit][j], m, p), p);
		}
	}
	ret[0] = add(ret[0], a[0][0], p);
	for (int i = 0; i < p; ++i) {
		printf("%d ", ret[i]);
	}
	putchar('\n');
}
int main()
{
	//freopen("input.txt", "r", stdin);
	solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:79:25: error: 'memset' was not declared in this scope
   79 |                         memset(tmp[nbit], 0, sizeof(tmp[nbit]));
      |                         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <assert.h>
  +++ |+#include <cstring>
    7 |
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
//#define i_7 (long long)(1E9+7)
long long p;
long long i_7 = p;

long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE=3000;
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  cin>>p;
  i_7 = p;
  MOD = p;
  invinit();
  long long b[p] = {};
  int a[p];
  REP(i,p){
    cin>>a[i];
  }
  REP(i,p){
    if(a[i] == 0)continue;
    b[0]++;
    b[0] = mod(b[0]);
    if(i==0){
      long long coef = 0;
    }else{
      long long coef = 1;
    }
    REP(k,p){
      long long temp;
      temp = comb(p-1, k);
      //temp *= po(-i, p-1-k);
      temp *= coef;
      temp = mod(temp);
      b[k] -= temp;
      b[k] = mod(b[k]);
      coef *= inv[p-i];
      coef = mod(coef);
    }
  }
  REP(i,p){
    cout<<b[i]<<' ';
  }
  cout<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:15: error: 'coef' was not declared in this scope; did you mean 'cosf'?
   79 |       temp *= coef;
      |               ^~~~
      |               cosf
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
//#define i_7 (long long)(1E9+7)
long long p;
long long i_7 = p;

long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE=3000;
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  cin>>p;
  i_7 = p;
  MOD = p;
  invinit();
  long long b[p] = {};
  int a[p];
  REP(i,p){
    cin>>a[i];
  }
  REP(i,p){
    if(a[i] == 0)continue;
    b[0]++;
    b[0] = mod(b[0]);
    long long coef = 1;
    REP(k,p){
      long long temp;
      temp = comb(p-1, k);
      //temp *= po(-i, p-1-k);
      temp *= coeff;
      temp = mod(temp);
      b[k] -= temp;
      b[k] = mod(b[k]);
      coef *= inv[p-i];
      coef = mod(coef);
    }
  }
  REP(i,p){
    cout<<b[i]<<' ';
  }
  cout<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:75:15: error: 'coeff' was not declared in this scope; did you mean 'coef'?
   75 |       temp *= coeff;
      |               ^~~~~
      |               coef
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
//#define i_7 (long long)(1E9+7)
long long p;
long long i_7 = p;

long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE=3000;
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  cin>>p;
  i_7 = p;
  MOD = p;
  invinit();
  long long b[p] = {};
  int a[p];
  REP(i,p){
    cin>>a[i];
  }
  REP(i,p){
    if(a[i] == 0)continue;
    b[0]++;
    b[0] = mod(b[0]);
    long long coef = 1;
    REP(k,p){
      long long temp;
      temp = comb(p-1, k);
      coef *= inv[p-i];
      coef = mod(coeff);
      //temp *= po(-i, p-1-k);
      temp *= coeff;
      temp = mod(temp);
      b[k] -= temp;
      b[k] = mod(b[k]);
    }
  }
  REP(i,p){
    cout<<b[i]<<' ';
  }
  cout<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:75:18: error: 'coeff' was not declared in this scope; did you mean 'coef'?
   75 |       coef = mod(coeff);
      |                  ^~~~~
      |                  coef
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
//#define i_7 (long long)(1E9+7)
long long p;
long long i_7 = p;

long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE=3000;
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  cin>>p;
  i_7 = p;
  MOD = p;
  invinit();
  long long b[p] = {};
  int a[p];
  REP(i,p){
    cin>>a[i];
  }
  REP(i,p){
    if(a[i] == 0)continue;
    b[0]++;
    b[0] = mod(b[0]);
    long long coef = 1;
    REP(k,p){
      long long temp;
      temp = comb(p-1, k);
      coeff *= inv[p-i];
      coeff = mod(coeff);
      //temp *= po(-i, p-1-k);
      temp *= coeff;
      temp = mod(temp);
      b[k] -= temp;
      b[k] = mod(b[k]);
    }
  }
  REP(i,p){
    cout<<b[i]<<' ';
  }
  cout<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:7: error: 'coeff' was not declared in this scope; did you mean 'coef'?
   74 |       coeff *= inv[p-i];
      |       ^~~~~
      |       coef
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
long long inf=(long long)1E17;
//#define i_7 (long long)(1E9+7)
long long p;
long long i_7 = p;

long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE=3000;
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  cin>>p;
  i_7 = p;
  MOD = p;
  invinit();
  long long b[p] = {};
  int a[p];
  REP(i,p){
    cin>>a[i];
  }
  REP(i,p){
    if(a[i] == 0)continue;
    b[0]++;
    b[0] = mod(b[0]);
    long long coef = 1;
    REP(k,p){
      long long temp;
      temp = comb(p-1, k);
      coeff *= inv[p-j];
      coeff = mod(coeff);
      //temp *= po(-i, p-1-k);
      temp *= coeff;
      temp = mod(temp);
      b[k] -= temp;
      b[k] = mod(b[k]);
    }
  }
  REP(i,p){
    cout<<b[i]<<' ';
  }
  cout<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:7: error: 'coeff' was not declared in this scope; did you mean 'coef'?
   74 |       coeff *= inv[p-j];
      |       ^~~~~
      |       coef
a.cc:74:22: error: 'j' was not declared in this scope
   74 |       coeff *= inv[p-j];
      |                      ^
Language: C++

#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <algorithm>
#include <utility>
#include <set>
#include <queue>
#include <map>
#include <cmath>
#include <numeric>
#include <tuple>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

long long pow(const long long &v, const long long &n, const long long &mod)
{
    long long ret = 1;
    long long num = n;
    long long now = v;
    
    while (num > 0)
    {
        if (num & 1)
        {
            ret = ret * now % mod;
        }
        now = now * now % mod;
        num = num >> 1;
    }
    
    return ret;
}

int main() {

    
    ll p;
    cin >> p;
    ll mod = p;
    
    vector<ll> v(p);
    for (int i = 0; i < p; ++i)
    {
        cin >> v[i];
    }
    
    vector<ll> fac = vector<long long>(p + 1, 1);
    vector<ll> inv = vector<long long>(p + 1, 1);
    
    for (int i = 1; i <= p; ++i)
    {
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = pow(fac[i], mod - 2, mod);
    }
    
    vector<ll> vb(p);
    
    vector<ll> powp(p + 1);
    
    for (int i = 0; i < p; ++i)
    {
        powp[i] = pow(p - 1, i, p);
    }
    
    for (int i = 0; i < p; ++i)
    {
        if (v[i])
        {
            vb[0] += 1ll;
            vb[0] %= mod;
            ll iii = i;
            
            vector<ll> pp(p);
            ll ppp = 1;
            for (int j = 0; j < p; ++j)
            {
                pp[j] = ppp;
                ppp *= i;
                ppp %= mod;
            }
            
            for (int j = 0; j < p; ++j)
            {
                ll ii = powp[p - 1 - j];
                ll pp =
                vb[j] -= (ii * ((fac[p - 1] * inv[j] % mod * inv[p - 1 - j] % mod) * pp[p - 1 - j] % mod) % mod);
                vb[j] += mod;
                vb[j] %= mod;
                iii *= i;
                iii %= mod;
            }
        }
    }
    
    for (int i = 0; i < p; ++i)
    {
        cout << vb[i] << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:90:88: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   90 |                 vb[j] -= (ii * ((fac[p - 1] * inv[j] % mod * inv[p - 1 - j] % mod) * pp[p - 1 - j] % mod) % mod);
      |                                                                                        ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<pi, pi> pp;
typedef pair<ll, ll> pl;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;

ll kai[200001];
ll mokai[200001];
ll p;

ll mod_pow (ll x, ll y) {
    ll ret = 1;
    while (y) {
        if (y&1) ret = ret*x%p;
        x = x*x%p;
        y /= 2;
    }
    return ret;
}

void init (int _n) {
    kai[0] = 1;
    for (int i = 1; i <= _n; i++) kai[i] = kai[i-1]*i%p;
    for (int i = 0; i <= _n; i++) mokai[i] = mod_pow(kai[i],p-2);
}

ll conb (ll x, ll y) {
    ll z = x-y;
    ll ret = kai[x]*mokai[y]%p;
    ret = ret*mokai[z]%p;
    return ret;
}

ll c[3000];
ll prep[3000][3000];

int main() {
    cin >> p;
    init(3000);
    rep(i,p+1) {
        prep[i][0] = 1;
        for (int j = 1; j <= p; j++) prep[i][j] = prep[i][j-1] * i % p;
    }
    rep(i,p) {
        ll a; cin >> a;
        if (a == 0) continue;
        (c[0] += 1) %= p;
        rep(j,p) {
            c[j] += -1 * conb(p-1, p-1-j) * prep[p-i][p-1-j];
        }
        (c[j] += p*p*p) %= p;
    }
    rep(i,p) {
        cout << c[i];
        if (i != p-1) cout << " ";
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:12: error: 'j' was not declared in this scope
   58 |         (c[j] += p*p*p) %= p;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int maxn = 4000;
#define int long long
int a[maxn], p;
int inv[maxn]{1,1};
int po[maxn]{1};
inline int form(int i){return (i % p + p) % p;}
vector<int> operator * (const vector<int> &a, vector<int> b){
	vector<int> res(a.size() + b.size() - 1ul, 0);
	for(int i = 0;i < a.size();++i){
		for(int j = 0;j < b.size();++j){
			res[i+j] = form(res[i+j] + a[i] * b[j]);
		}
	}
	return res;
}
vector<int> fun{0, 1}, r;
int getv(int i){
	int ci = i, res = r[0];
	for(int j = 1;j < r.size();++j){
		res = form(res + ci * r[j]);
		ci = form(ci * i);
	}
	return res;
}
int main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
	cin >> p;
	for(int i = 0;i < p;++i)cin >> a[i];
	// 
	for(int i = 2;i < p;++i)inv[i] = (p-p/i) * inv[p % i] % p;
	// 
	r.resize(p);	
	r[0] = a[0];
	for(int i = 1;i < p;++i){
		for(int j = 1;j < p;++j)po[j] = form(po[j-1] * i);
		int ls = 0;
		int v = 1;
		for(int j = 0;j < r.size();++j)ls = form(ls + r[j] * po[j]);
		for(int j = 0;j < i;++j){
			v = form(v * form(i-j));
		}
		int sc = form(inv[v] * form(a[i] - ls));
		// cout << v<<" -V " << "target = " << form(a[i]-ls) << '\n';
		for(int i = 0;i < fun.size();++i)r[i] = form(r[i] + sc * fun[i]);
		fun = fun * vector<int>{-i, 1};
	}
	// for(auto j : fun)cout << j << ' ';cout << '\n';
	for(int i = 0;i < p;++i)cout << r[i] << " \n"[i==p-1];
	// for(int i = 0;i < p;++i)assert(getv(i) == a[i]);
}

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0;i<((ll)(n));i++)
#define reg(i,a,b) for(ll i = ((ll)(a));i<=((ll)(b));i++)
#define irep(i,n) for(ll i = ((ll)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(ll i = ((ll)(b));i>=((ll)(a));i--)

/*
AC

11
1 1 1 1 0 0 0 1 1 1 0

13
1 1 1 1 1 1 0 1 1 1 1 1 1

17
1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1

19
1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1
*/

long long modinv(long long a, long long mod) {
    long long b = mod, u = 1, v = 0;
    while (b) {
        long long t = a/b;
        a -= t*b; swap(a, b);
        u -= t*v; swap(u, v);
    }
    u %= mod;
    if (u < 0) u += mod;
    return u;
}

template<typename T>
void polynomial_division(vector<T> a, const vector<T> &b, T p, vector<T> &ans){
	int n = a.size(), m = b.size();
	vector<T> ans(n-m+1,0);
	for(int i=0; i+m-1<n; i++){
		if(a[n-1-i]==0)continue;
		T r = (a[n-1-i]/b[m-1])%p;
		ans[n-m-i]=r;
		for(int j=0; j<m; j++){
			a[n-1-i-j]=(a[n-1-i-j]+p-(r*b[m-1-j])%p)%p;
		}
	}
}

// LIBRARY END

ll p,a[3001],b[3001];
vector<ll> poly,mot,ans;

void init(){
	cin>>p;
	rep(i,p)cin>>a[i];
	rep(i,p)poly.push_back(a[i]);
	ans.assign(p,0);
	mot.assign(p+1,0);
	mot[p]=1; mot[1]=-1;
}

int main(void){
	init();
	rep(i,p){
		vector<ll> div_pol={-i,1};
		vector<ll> v;
		polynomial_division(mot,div_pol,p,v);
		rep(j,p)v[j] = ((v[j]%p)+p)%p;
		ll div=1;
		rep(j,p){
			if(j!=i){
				div=(div*(i-j))%p;
			}
		}
		div=((div%p)+p)%p;
		div = modinv(div,p);
		rep(j,p)ans[j]=(ans[j]+a[i]*v[j]*div)%p;
	}
	// Verification
	bool ok=true;
	rep(i,p){
		ll x=1,tmp=0;
		rep(j,p){
			tmp = (tmp+x*ans[j])%p;
			x=(x*i)%p;
		}
		if(tmp!=a[i])ok=false;
	}
	cerr<<(ok?"大丈夫":"ダメ")<<endl;
	// print the answer
	rep(i,ans.size())cout<<ans[i]<<" ";
	cout<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void polynomial_division(std::vector<_Tp>, const std::vector<_Tp>&, T, std::vector<_Tp>&)':
a.cc:40:19: error: declaration of 'std::vector<_Tp> ans' shadows a parameter
   40 |         vector<T> ans(n-m+1,0);
      |                   ^~~
a.cc:38:75: note: 'std::vector<_Tp>& ans' previously declared here
   38 | void polynomial_division(vector<T> a, const vector<T> &b, T p, vector<T> &ans){
      |                                                                ~~~~~~~~~~~^~~
Language: C++

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
using namespace std;
inline LL read()
{
	LL f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int stack[20];
template<typename T>inline void write(T x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    int top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
template<typename T>inline void pr1(T x){write(x);putchar(' ');}
template<typename T>inline void pr2(T x){write(x);putchar('\n');}
const int MAXN=3005;
int f[MAXN],mod,a[MAXN];
int pow_mod(int a,int b)
{
	int ret=1;
	for(;b;b>>=1,a=1LL*a*a%mod)if(b&1)ret=1LL*ret*a%mod;
	return ret;
}
int g[MAXN],h[MAXN];
void ad(int &x,int y){x+=y;if(x>=mod)x-=mod;}
void dl(int &x,int y){x-=y;if(x<0)x+=mod;}
void mul(int *x,int *y,int len)
{
	static int A[MAXN];memset(A,0,sizeof(A));
	for(int i=0;i<len;i++)for(int j=0;j<=1;j++)
		ad(A[i+j],1LL*x[i]*y[j]%mod);
	for(int i=0;i<=len;i++)x[i]=A[i];
}
void div(int *x,int *y,int len,int mu)
{
	static int A[MAXN],B[MAXN];memset(B,0,sizeof(B));
	int inv=pow_mod(y[1],mod-2);
	for(int i=0;i<len;i++)A[i]=x[i];
	for(int i=len-1;i>0;i--)
	{
		ad(B[i-1],A[i]);d	l(A[i-1],1LL*A[i]*y[0]%mod);
	}
	for(int i=0;i<len;i++)ad(h[i],1LL*B[i]*mu%mod);
}
int main()
{
	mod=read();
	for(int i=0;i<mod;i++)a[i]=read();
	f[0]=1;
	for(int i=0;i<mod;i++)
	{
		g[0]=(-i+mod)%mod;g[1]=1;
		mul(f,g,i+1);
	}
	for(int i=0;i<mod;i++)
	{
		int mu=1;
		for(int j=0;j<mod;j++)if(i!=j)mu=1LL*mu*(i%mod-j%mod+mod)%mod;
		mu=1LL*pow_mod(mu,mod-2)*a[i]%mod;g[0]=(-i+mod)%mod;g[1]=1;
		div(f,g,mod+1,mu);
	}
	for(int i=0;i<mod;i++)pr1(h[i]);
	return 0;
}


Compiler output:
a.cc: In function 'void div(int*, int*, int, int)':
a.cc:60:33: error: 'd' was not declared in this scope
   60 |                 ad(B[i-1],A[i]);d       l(A[i-1],1LL*A[i]*y[0]%mod);
      |                                 ^
Language: C++

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

#define BR "\n"
#define SP " "
#define SHOW(x) for(int i = 0; i < x.size(); i++) { cout << x[i] << SP; } cout << BR;
#define SHOW2(x) for(int j = 0; j < x.size(); j++) { SHOW(x[j]); } cout << BR;

ll p;
vector<ll> inv(3000, 0);

void calcInv() {
  for (int i = 1; i < p; i++) {
    inv[i] = powMod(i, p-2);
  }
  return ;
}

ll powMod(ll a, ll b) {
  ll ans = 1;
  ll temp = a;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * temp) % p;
    temp = (temp * temp) % p;
    b = b / 2;
  }
  return ans;
}

int main() {
  cin >> p;

  vector<ll> a(p);
  for (int i = 0; i < p; i++) {
    cin >> a[i];
  }
  calcInv();

  vector<ll> x(p, 0);
  for (int i = 0; i < p; i++) {
    for (int j = i + 1; j < p; j++) {
      x[i] = (a[i] * inv[j - i]) % p;
    }
  }
  for (int i = p-1; i >= 0; i--) {
    cout << x[i] << SP;
  }

  return 0;
}

Compiler output:
a.cc: In function 'void calcInv()':
a.cc:15:14: error: 'powMod' was not declared in this scope
   15 |     inv[i] = powMod(i, p-2);
      |              ^~~~~~
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include <cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define int long long

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}
int p;
int mod_inverse(int x) {
	int ret = 1; int n = p - 2;
	while (n) {
		if (n & 1)ret = ret * x % p;
		x = x * x % p; n >>= 1;
	}
	return ret;
}


    int a[3030][3030];

    // 各種変数
    int d;     // ダミー
    int i, j, k;  // LOOP インデックス

 
/*
 * 連立方程式を解く（ガウスの消去法）
 */
void calcGaussElimination()
{
    // 係数
    

   
    // 前進消去
    for (k = 0; k < p -1; k++) {
        for (i = k + 1; i < p; i++) {
            d = a[i][k] * mod_inverse( a[k][k]) % p;
            for (j = k + 1; j <= p; j++)
                (a[i][j] -= a[k][j] * d) %= p;
        }
    }

    // 後退代入
    for (i = p - 1; i >= 0; i--) {
        d = a[i][p] % p;
        for (j = i + 1; j < p; j++)
            (d -= a[i][j] * a[j][N]) %= p;
        a[i][p] = d * mod_inverse( a[i][i]) % p;
    }

}




signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    cin >> p;
    int b[3030];
    rep(i, p) {
        cin >> b[i];
        a[i][p] = b[i];
    }
    rep(i, p) {
        int k = 1;
        a[i][p - 1] = k;
        per(j, p - 1) {
            a[i][j] = k * (i + 1) % p;
        }
    }
    calcGaussElimination();
    rep(i, p) {
        cout << a[i][p] << endl;
    }


	return 0;
}

Compiler output:
a.cc: In function 'void calcGaussElimination()':
a.cc:94:34: error: 'N' was not declared in this scope
   94 |             (d -= a[i][j] * a[j][N]) %= p;
      |                                  ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include <cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define int long long

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}
int p;
int mod_inverse(int x) {
	int ret = 1; int n = p - 2;
	while (n) {
		if (n & 1)ret = ret * x % p;
		x = x * x % p; n >>= 1;
	}
	return ret;
}


    int a[p][p + 1];

    // 各種変数
    int d;     // ダミー
    int i, j, k;  // LOOP インデックス

 
/*
 * 連立方程式を解く（ガウスの消去法）
 */
void Calc::calcGaussElimination()
{
    // 係数
    

   
    // 前進消去
    for (k = 0; k < p -1; k++) {
        for (i = k + 1; i < p; i++) {
            d = a[i][k] * mod_inverse( a[k][k]) % p;
            for (j = k + 1; j <= p; j++)
                (a[i][j] -= a[k][j] * d) %= p;
        }
    }

    // 後退代入
    for (i = p - 1; i >= 0; i--) {
        d = a[i][p] % p;
        for (j = i + 1; j < p; j++)
            (d -= a[i][j] * a[j][N]) %= p;
        a[i][p] = d * mod_inverse( a[i][i]) % p;
    }

}




signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    cin >> p;
    int b[3030];
    rep(i, p) {
        cin >> b[i];
        a[i][p] = b[i];
    }
    rep(i, p) {
        int k = 1;
        a[i][p - 1] = k;
        per(j, p - 1) {
            a[i][j] = k * (i + 1) % p;
        }
    }
    Calc::calcGaussElimination();
    rep(i, p) {
        cout << a[i][p] << endl;
    }


	return 0;
}

Compiler output:
a.cc:65:16: error: size of array 'a' is not an integral constant-expression
   65 |     int a[p][p + 1];
      |              ~~^~~
a.cc:65:11: error: size of array 'a' is not an integral constant-expression
   65 |     int a[p][p + 1];
      |           ^
a.cc:75:6: error: 'Calc' has not been declared
   75 | void Calc::calcGaussElimination()
      |      ^~~~
a.cc: In function 'void calcGaussElimination()':
a.cc:94:34: error: 'N' was not declared in this scope
   94 |             (d -= a[i][j] * a[j][N]) %= p;
      |                                  ^
a.cc: In function 'int main()':
a.cc:119:5: error: 'Calc' has not been declared
  119 |     Calc::calcGaussElimination();
      |     ^~~~