# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
185625 | anonymous | Ljetopica (COI19_ljetopica) | C++14 | 121 ms | 63372 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>
#define MAXN 1005
#define MOD 1000000007
#define LL long long
using namespace std;
int N, K;
char seq[MAXN], A[MAXN], B[MAXN];
LL pow2[MAXN];
LL dp[MAXN][MAXN][2][2], dp2[MAXN][MAXN][2][2]; //num, contribution
//n,k, invert, t
LL f(int n, int k, int i, int t) {
if (k < 0) {return(0);}
return(dp[n][k][i][t]);
}
LL f2(int n, int k, int i, int t) {
if (k < 0) {return(0);}
return(dp2[n][k][i][t]);
}
int cost(int i, char At, char Do) {
if (i) {return(At == Do);}
return(At != Do);
}
LL slv(char* V) {
dp[0][0][0][0]=dp[0][0][0][1]=dp[0][0][1][0]=dp[0][0][1][1]=1;
for (int n=1; n<N; n++) {
for (int k=0; k<=K; k++) {
for (int i=0; i<=1; 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... |