# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
20076 | gs13068 | 목공 (kriii4_A) | C++98 | 24 ms | 1104 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <map>
const int p = 1092616193;
using namespace std;
int f(int x, int y)
{
return y & 1 ? (long long)f(x, y ^ 1)*x%p : y ? f((long long)x*x%p, y >> 1) : 1;
}
int a[1001];
int d[5005];
int main()
{
int i, j, n, m, t, s = 0;
scanf("%d%d", &n, &m);
for (i = 0; i < n; i++)
{
scanf("%d", a + i);
s += a[i];
}
s = f(s, p - 2);
for (i = n; i <= m; i++)
{
t = 0;
for (j = 0; j < n; j++) t = (t + (long long)a[j] * d[i + j - n]) % p;
d[i] = ((long long)t * s + 1) % p;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |