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 AC
Exec Time 96 ms
Memory 384 KB

Judge Result

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