# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
754772 | Stickfish | Costinland (info1cup19_costinland) | C++17 | 1 ms | 300 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>
using namespace std;
void solve_smallk(int k) {
for (int m = 1; m < (1 << 16); m += 2) {
vector<bitset<4>> v(4);
for (int i = 0; i < 4; ++i) for (int j = 0; j < 4; ++j) {
v[i][j] = m & (1 << (i * 4 + j));
}
vector<vector<pair<int, int>>> dp(5, vector<pair<int, int>>(5, {0, 0}));
dp[0][0] = {1, 0};
for (int i = 0; i < 4; ++i) for (int j = 0; j < 4; ++j) {
if (v[i][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;
}
}
int ans = 0;
for (int i = 0; i < 5; ++i) {
ans += dp[4][i].first + dp[i][4].second;
}
if (ans == k) {
cout << "5 5\n";
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |