Language: C++

import sequtils,strutils
proc scanf(formatstr: cstring){.header: "<stdio.h>", varargs.}
proc getchar(): char {.header: "<stdio.h>", varargs.}
proc nextInt(): int = scanf("%lld",addr result)
proc nextFloat(): float = scanf("%lf",addr result)
proc nextString(): string =
  var get = false
  result = ""
  while true:
    var c = getchar()
    if int(c) > int(' '):
      get = true
      result.add(c)
    else:
      if get: break
      get = false

#{{{ gcd and inverse
const GCD_H = 0

proc gcd(a,b:int):int=
  if b == 0: return a
  else: return gcd(b,a mod b)
proc lcm(a,b:int):int=
  return a div gcd(a, b) * b
# a x + b y = gcd(a, b)
proc extgcd(a,b:int, x,y:var int):int =
  var
    g = a
  x = 1
  y = 0
  if b != 0:
    g = extgcd(b, a mod b, y, x)
    y -= (a div b) * x
  return g;

proc invMod(a,m:int):int =
  var
    x,y:int
  if extgcd(a, m, x, y) == 1: return (x + m) mod m
  else: return 0 # unsolvable
#}}}

var MOD = -1
#{{{ Mint
type Mint = object
  v:int
proc newMint[T](a:T):Mint =
  var a = a
  a = a mod MOD
  if a < 0: a += MOD
  return Mint(v:a)
proc newMint(a:Mint):Mint =
  return a
proc `+=`[T](a:var Mint, b:T):void =
  a.v += newMint(b).v
  if a.v >= MOD:
    a.v -= MOD
proc `+`[T](a:Mint,b:T):Mint =
  var c = a
  c += b
  return c
proc `*=`[T](a:var Mint,b:T):void =
  a.v *= newMint(b).v
  a.v = a.v mod MOD
proc `*`[T](a:Mint,b:T):Mint =
  var c = a
  c *= b
  return c
proc `-`(a:Mint):Mint =
  if a.v == 0: return a
  else: return Mint(v:MOD - a.v)
proc `-=`[T](a:var Mint,b:T):void =
  a.v -= newMint(b).v
  if a.v < 0:
    a.v += MOD
proc `-`[T](a:Mint,b:T):Mint =
  var c = a
  c -= b
  return c
proc `$`(a:Mint):string =
  return $(a.v)
when declared(GCD_H):
  proc `/=`[T](a:var Mint,b:T):void =
    a.v *= invMod(newMint(b).v,MOD)
    a.v = a.v mod MOD
  proc `/`[T](a:Mint,b:T):Mint =
    var c = a
    c /= b
    return c
#}}}

type poly[T] = seq[T]

proc `+=`[T](self:var poly[T],p:poly[T]):void =
  self.setlen(max(self.len,p.len))
  for i in 0..<p.len: self[i] += p[i]
proc `+`[T](p,q:poly[T]):poly[T] =
  result = p
  result += q
proc `-=`[T](self:var poly[T],p:poly[T]):void =
  self.setlen(max(self.len,p.len))
  for i in 0..<p.len: self[i] -= p[i]
proc `-`[T](p,q:poly[T]):poly[T] =
  result = p
  result -= q

proc `*`[T](p,q:poly[T]):poly[T] =
  result = newSeqWith(p.len + q.len - 1, Mint())
  for i in 0..<p.len:
    for j in 0..<q.len:
      result[i + j] += p[i] * q[j]
proc `*=`[T](self:var poly[T],q:poly[T]):void =
  self = self * q
proc apply[T](p:poly[T],a:T):T = 
  result = T()
  for i in countdown(p.len - 1, 0):
    result *= a
    result += p[i]
proc `$`[T](self:poly[T]):string =
  var v = newseq[string](0)
  for d in countdown(self.len-1,0):
    v.add($self[d] & "*x^" & $d)
  return v.join(" + ")

proc solve(p:int, a:seq[int]):void =
  MOD = p
  var v: seq[Mint]
  for i in 0..p-1:
    var s = newMint(a[i])
    for j in 0..<v.len:
      s -= v[j]
      s /= i - j
    v.add(s)
  var q:poly[Mint] = @[newMint(0)]
  for i in countdown(p-1,0):
    if i != p - 1:
      q *= @[newMint(-i),newMint(1)]
    q += @[v[i]]
#  echo $q
#  for i in 0..p-1:
#    echo apply(q,newMint(i))
  for i in 0..p-1:
    stdout.write q[i]," "
  echo ""

proc main():void =
  var p = 0
  p = nextInt()
  var a = newSeqWith(p-1-0+1, 0)
  for i in 0..<p-1-0+1:
    a[i] = nextInt()
  solve(p, a);
  return

main()

Compiler output:
a.cc:18:2: error: invalid preprocessing directive #{
   18 | #{{{ gcd and inverse
      |  ^
a.cc:26:3: error: invalid preprocessing directive #a
   26 | # a x + b y = gcd(a, b)
      |   ^
a.cc:41:18: error: stray '#' in program
   41 |   else: return 0 # unsolvable
      |                  ^
a.cc:42:2: error: invalid preprocessing directive #}
   42 | #}}}
      |  ^
a.cc:45:2: error: invalid preprocessing directive #{
   45 | #{{{ Mint
      |  ^
a.cc:55:6: error: stray '`' in program
   55 | proc `+=`[T](a:var Mint, b:T):void =
      |      ^
a.cc:55:9: error: stray '`' in program
   55 | proc `+=`[T](a:var Mint, b:T):void =
      |         ^
a.cc:59:6: error: stray '`' in program
   59 | proc `+`[T](a:Mint,b:T):Mint =
      |      ^
a.cc:59:8: error: stray '`' in program
   59 | proc `+`[T](a:Mint,b:T):Mint =
      |        ^
a.cc:63:6: error: stray '`' in program
   63 | proc `*=`[T](a:var Mint,b:T):void =
      |      ^
a.cc:63:9: error: stray '`' in program
   63 | proc `*=`[T](a:var Mint,b:T):void =
      |         ^
a.cc:66:6: error: stray '`' in program
   66 | proc `*`[T](a:Mint,b:T):Mint =
      |      ^
a.cc:66:8: error: stray '`' in program
   66 | proc `*`[T](a:Mint,b:T):Mint =
      |        ^
a.cc:70:6: error: stray '`' in program
   70 | proc `-`(a:Mint):Mint =
      |      ^
a.cc:70:8: error: stray '`' in program
   70 | proc `-`(a:Mint):Mint =
      |        ^
a.cc:73:6: error: stray '`' in program
   73 | proc `-=`[T](a:var Mint,b:T):void =
      |      ^
a.cc:73:9: error: stray '`' in program
   73 | proc `-=`[T](a:var Mint,b:T):void =
      |         ^
a.cc:77:6: error: stray '`' in program
   77 | proc `-`[T](a:Mint,b:T):Mint =
      |      ^
a.cc:77:8: error: stray '`' in program
   77 | proc `-`[T](a:Mint,b:T):Mint =
      |        ^
a.cc:81:6: error: stray '`' in program
   81 | proc `$`(a:Mint):string =
      |      ^
a.cc:81:8: error: stray '`' in program
   81 | proc `$`(a:Mint):string =
      |        ^
a.cc:84:8: error: stray '`' in program
   84 |   proc `/=`[T](a:var Mint,b:T):void =
      |        ^
a.cc:84:11: error: stray '`' in program
   84 |   proc `/=`[T](a:var Mint,b:T):void =
      |           ^
a.cc:87:8: error: stray '`' in program
   87 |   proc `/`[T](a:Mint,b:T):Mint =
      |        ^
a.cc:87:10: error: stray '`' in program
   87 |   proc `/`[T](a:Mint,b:T):Mint =
      |          ^
a.cc:91:2: error: invalid preprocessing directive #}
   91 | #}}}
      |  ^
a.cc:95:6: error: stray '`' in program
   95 | proc `+=`[T](self:var poly[T],p:poly[T]):void =
      |      ^
a.cc:95:9: error: stray '`' in program
   95 | proc `+=`[T](self:var poly[T],p:poly[T]):void =
      |         ^
a.cc:97:12: error: too many decimal points in number
   97 |   for i in 0..<p.len: self[i] += p[i]
      |            ^~~
a.cc:98:6: error: stray '`' in program
   98 | proc `+`[T](p,q:poly[T]):poly[T] =
      |      ^
a.cc:98:8: error: stray '`' in program
   98 | proc `+`[T](p,q:poly[T]):poly[T] =
      |        ^
a.cc:101:6: error: stray '`' in program
  101 | proc `-=`[T](self:var poly[T],p:poly[T]):void =
      |      ^
a.cc:101:9: error: stray '`' in program
  101 | proc `-=`[T](self:var poly[T],p:poly[T]):void =
      |         ^
a.cc:103:12: error: too many decimal points in number
  103 |   for i in 0..<p.len: self[i] -= p[i]
      |            ^~~
a.cc:104:6: error: stray '`' in program
  104 | proc `-`[T](p,q:poly[T]):poly[T] =
      |      ^
a.cc:104:8: error: stray '`' in program
  104 | proc `-`[T](p,q:poly[T]):poly[T] =
      |        ^
a.cc:108:6: error: stray '`' in program
  108 | proc `*`[T](p,q:poly[T]):poly[T] =
      |      ^
a.cc:108:8: error: stray '`' in program
  108 | proc `*`[T](p,q:poly[T]):poly[T] =
      |        ^
a.cc:110:12: error: too many decimal points in number
  110 |   for i in 0..<p.len:
      |            ^~~
a.cc:111:14: error: too many decimal points in number
  111 |     for j in 0..<q.len:
      |              ^~~
a.cc:113:6: error: stray '`' in program
  113 | proc `*=`[T](self:var poly[T],q:poly[T]):void =
      |      ^
a.cc:113:9: error: stray '`' in program
  113 | proc `*=`[T](self:var poly[T],q:poly[T]):void =
      |         ^
a.cc:120:6: error: stray '`' in program
  120 | proc `$`[T](self:poly[T]):string =
      |      ^
a.cc:120:8: error: stray '`' in program
  120 | proc `$`[T](self:poly[T]):string =
      |        ^
a.cc:129:12: error: too many decimal points in number
  129 |   for i in 0..p-1:
      |            ^~~~~~
a.cc:131:14: error: too many decimal points in number
  131 |     for j in 0..<v.len:
      |              ^~~
a.cc:135:22: error: stray '@' in program
  135 |   var q:poly[Mint] = @[newMint(0)]
      |                      ^
a.cc:138:12: error: stray '@' in program
  138 |       q *= @[newMint(-i),newMint(1)]
      |            ^
a.cc:139:10: error: stray '@' in program
  139 |     q += @[v[i]]
      |          ^
a.cc:140:4: error: invalid preprocessing directive #echo
  140 | #  echo $q
      |    ^~~~
a.cc:141:4: error: invalid preprocessing directive #for
  141 | #  for i in 0..p-1:
      |    ^~~
a.cc:142:6: error: invalid preprocessing directive #echo
  142 | #    echo apply(q,newMint(i))
      |      ^~~~
a.cc:143:12: error: too many decimal points in number
  143 |   for i in 0..p-1:
      |            ^~~~~~
a.cc:151:12: error: too many decimal points in number
  151 |   for i in 0..<p-1-0+1:
      |            ^~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sequtils,strutils
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'proc' does not name a type
    3 | proc getchar(): char {.header: "<stdio.h>", varargs.}
      | ^~~~
a.cc:4:1: error: 'proc' does not name a type
    4 | proc nextInt(): int = scanf("%lld",addr result)
      | ^~~~
a.cc:37:1: error: 'proc' does not name a type
   37 | proc invMod(a,m:int):int =
      | ^~~~
a.cc:154:3: error: expected unqualified-id before 'return'
  154 |   return
      |   ^~~~~~