{"problem":{"name":"Polynomial Construction","description":{"content":"Given are a prime number $p$ and a sequence of $p$ integers $a_0, \\ldots, a_{p-1}$ consisting of zeros and ones. Find a polynomial of degree at most $p-1$, $f(x) = b_{p-1} x^{p-1} + b_{p-2} x^{p-2} + ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc137_f"},"statements":[{"statement_type":"Markdown","content":"Given are a prime number $p$ and a sequence of $p$ integers $a_0, \\ldots, a_{p-1}$ consisting of zeros and ones.\nFind a polynomial of degree at most $p-1$, $f(x) = b_{p-1} x^{p-1} + b_{p-2} x^{p-2} + \\ldots + b_0$, satisfying the following conditions:\n\n*   For each $i$ $(0 \\leq i \\leq p-1)$, $b_i$ is an integer such that $0 \\leq b_i \\leq p-1$.\n*   For each $i$ $(0 \\leq i \\leq p-1)$, $f(i) \\equiv a_i \\pmod p$.\n\n## Constraints\n\n*   $2 \\leq p \\leq 2999$\n*   $p$ is a prime number.\n*   $0 \\leq a_i \\leq 1$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$p$\n$a_0$ $a_1$ $\\ldots$ $a_{p-1}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc137_f","tags":[],"sample_group":[["2\n1 0","1 1\n\n$f(x) = x + 1$ satisfies the conditions, as follows:\n\n*   $f(0) = 0 + 1 = 1 \\equiv 1 \\pmod 2$\n*   $f(1) = 1 + 1 = 2 \\equiv 0 \\pmod 2$"],["3\n0 0 0","0 0 0\n\n$f(x) = 0$ is also valid."],["5\n0 1 0 1 0","0 2 0 1 3"]],"created_at":"2026-03-03 11:01:13"}}