# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
563797 | KoD | Bowling (BOI15_bow) | C++17 | 200 ms | 3532 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>
#define rep(i, n) for (int i = 0; i < int(n); ++i)
using ll = long long;
using std::vector;
ll dp[10][331][11][11];
bool match(const char c, const char d) {
return c == '?' or c == d;
}
ll solve(const int N, const std::string& S, const std::vector<int>& P) {
rep(i, 10) rep(j, 331) rep(k, 11) rep(l, 11) dp[i][j][k][l] = 0;
rep(k, 11) rep(l, 11) dp[0][0][k][l] = 1;
rep(i, N - 1) rep(j, 331) rep(k, 11) rep(l, 11) {
const ll val = dp[i][j][k][l];
if (val == 0)
continue;
const auto C = S.begin() + (2 * i);
if (k == 10) {
if (match(C[0], 'x') and match(C[1], '-')) {
rep(m, 11) {
const int nj = j + 10 + l + m;
if (P[i] == -1 or P[i] == nj) {
dp[i + 1][nj][l][m] += val;
# | 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... |