# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
754819 | Stickfish | Costinland (info1cup19_costinland) | C++17 | 1 ms | 212 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>
#include <vector>
#include <bitset>
#include <algorithm>
#include <set>
using ll = long long;
using namespace std;
pair<vector<int>, vector<int>> get_dp(int n, int m, int msk) {
vector<vector<pair<int, int>>> dp(n + 1, vector<pair<int, int>>(m + 1, {0, 0}));
dp[0][0] = {1, 0};
for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) {
if (msk & (1 << (i * m + j))) {
dp[i + 1][j].first += dp[i][j].first + dp[i][j].second;
dp[i][j + 1].second += dp[i][j].first + dp[i][j].second;
} else {
dp[i + 1][j].first += dp[i][j].first;
dp[i][j + 1].second += dp[i][j].second;
}
}
vector<int> row(n);
vector<int> col(m);
for (int i = 0; i < n; ++i)
row[i] = dp[i][m].second;
for (int j = 0; j < m; ++j)
col[j] = dp[n][j].first;
return {row, col};
}
void solve_smallk(int k) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |