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;
#define 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!の逆元を格納する配列。
const 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(){
  invinit();
  cin>>p;
  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]);
    REP(k,p){
      long long temp;
      temp = comb(p-1, k);
      temp *= po(-i, p-1-k);
      temp = mod(temp);
      b[i] -= temp;
      b[i] = mod(b[i]);
    }
  }
  REP(i,p){
    cout<<b[i]<<' ';
  }
  cout<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   58 |   cin>>p;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:78:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   78 |     cout<<b[i]<<' ';
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:80:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   80 |   cout<<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:80:9: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   80 |   cout<<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)
      |     ^~~~