Submission #6821875


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

int r[3333];
int main() {
	int p;
	cin >> p;
	for (int i = 0; i < p; i++) {
		int a;
		cin >> a;
		if (!i) (r[0] += a) %= p;
		a = p - a;
		for (int d = 1; d < p; d++) {
			(r[p - d] += a) %= p;
			(a *= i) %= p;
		}
	}
	for (int i = 0; i < p; i++)
		cout << r[i] << ' ';
	cout << endl;
	return 0;
}

Submission Info

Submission Time
Task F - Polynomial Construction
User int_cl
Language C++14 (GCC 5.4.1)
Score 600
Code Size 369 Byte
Status
Exec Time 96 ms
Memory 384 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 a01, a02, a03
All 600 / 600 a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, b41, b42, b43
Case Name Status Exec Time Memory
a01 1 ms 256 KB
a02 1 ms 256 KB
a03 1 ms 256 KB
b04 1 ms 256 KB
b05 1 ms 256 KB
b06 1 ms 256 KB
b07 87 ms 256 KB
b08 96 ms 256 KB
b09 96 ms 256 KB
b10 96 ms 256 KB
b11 87 ms 256 KB
b12 87 ms 256 KB
b13 92 ms 256 KB
b14 92 ms 256 KB
b15 89 ms 256 KB
b16 95 ms 256 KB
b17 92 ms 256 KB
b18 92 ms 256 KB
b19 92 ms 256 KB
b20 96 ms 384 KB
b21 95 ms 256 KB
b22 96 ms 256 KB
b23 96 ms 256 KB
b24 96 ms 256 KB
b25 96 ms 256 KB
b26 92 ms 256 KB
b27 90 ms 256 KB
b28 88 ms 256 KB
b29 90 ms 384 KB
b30 88 ms 256 KB
b31 88 ms 256 KB
b32 87 ms 256 KB
b33 1 ms 256 KB
b34 1 ms 256 KB
b35 89 ms 256 KB
b36 92 ms 256 KB
b37 30 ms 256 KB
b38 50 ms 256 KB
b39 1 ms 256 KB
b40 41 ms 256 KB
b41 2 ms 256 KB
b42 13 ms 256 KB
b43 56 ms 256 KB