# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
144805 | emilem | Ljetopica (COI19_ljetopica) | C++14 | 251 ms | 63352 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 <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <set>
using namespace std;
const long long mod = 1000000007;
long long n, k;
string path, a, b;
vector<long long> pow2(2000);
long long dp[1005][1005][2][2], cnt[1005][1005][2][2];
void Add(long long depth, long long steps, long long ok, long long atBound, long long depth2, long long steps2, long long ok2, long long atBound2, char dir)
{
if (max(depth, depth2) > n || max(steps, steps2) > k)
return;
if (depth == 2 && steps == 0 && ok == 0 && atBound == 1)
cerr << "";
dp[depth][steps][ok][atBound] += 2 * dp[depth2][steps2][ok2][atBound2];
if (dir == 'R')
dp[depth][steps][ok][atBound] += cnt[depth2][steps2][ok2][atBound2];
dp[depth][steps][ok][atBound] %= mod;
cnt[depth][steps][ok][atBound] += cnt[depth2][steps2][ok2][atBound2];
cnt[depth][steps][ok][atBound] %= mod;
}
long long Solve(string bound)
{
for (long long depth = 1; depth <= n; ++depth)
for (long long steps = 0; steps <= k; ++steps)
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... |