# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
777532 | qwerasdfzxcl | Festivals in JOI Kingdom 2 (JOI23_festival2) | C++17 | 5492 ms | 7912 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, MOD;
ll dpNAIVE[100100][2];
ll P[9][100100], Q[9][100100], R[9][100100], dp[100100][2];
ll fact[100100], factINV[100100];
inline void add(ll &x, const ll &y){
x += y;
if (x>=MOD) x -= MOD;
}
inline ll mul(const vector<ll> &a){
ll ret = 1;
for (auto &x:a) ret = ret * x % MOD;
return ret;
}
inline ll mul(ll x, ll y){
return x * y % MOD;
}
vector<ll> operator +(const vector<ll> &A, const vector<ll> &B){
vector<ll> ret(max(A.size(), B.size()));
for (int i=0;i<(int)ret.size();i++){
if (i<(int)A.size()) add(ret[i], A[i]);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |