이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n, p;
cin >> n >> p;
vector<int> a(1000000);
for (int i = 0; i < n+1; i++)
{
int temp;
cin >> temp;
a[n-i] = temp;
}
int res = 0;
int pow = 1;
for (int i = 0; i < p; i++)
{
for (int j = 1; j < n+1; j++)
{
pow *= i;
pow %= p;
res += (pow * a[j] % p);
res %= p;
}
cout << (res+a[0])%p << endl;
res = 0; pow = 1;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |