# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|
22181 | | sdfgsfg (#42) | 다항식 계산 (KRIII5P_2) | C++11 | | 0 ms | 5928 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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... |