eolymp
опубликовано 07.06.2017, 10:44:58

Можно ли провести операции тольк частью рисунка?

опубликовано 06.03.2020, 14:52:48

Добрый день. Вопрос по условию. Можно ли вставлять скопированное в любое место прямоугольника А*В или обязательно касаться тех квадратиков-прямоугольников, которые были вставленны до?

опубликовано 26.03.2020, 17:35:52

можно в любое место

опубликовано 28.01.2021, 09:29:51

чи можуть фігури накладатися?

опубликовано 15.01.2022, 21:47:24

Можно чтобы на поле были еще фигуры кроме единичного квадрата и прямоугольника(если да,то может ли "лишняя" фигура соприкасатся с прямоугольником?

опубликовано 31.03.2022, 18:38:26

include <iostream>

using namespace std;

define N 1001

define INF 2000000000

long dp[N][N];

int main() { int a, b; cin >> a >> b; if (a < b) swap(a, b); for (int i = 0; i <= a; ++i) for (int j = 0; j <= a; ++j) dp[i][j] = INF;

dp[1][1] = 4;
for (int i = 1; i <= a; ++i)
{
    for (int buf = 1; buf <= i; ++buf)
    {
        long tmp = dp[i - buf][buf] + 2;
        if (tmp < dp[i][buf]) dp[i][buf] = tmp;
        for (int j = 1; j < buf; ++j)
        {
            if (dp[i][j] + 2 < dp[i][buf]) dp[i][buf] = dp[i][j] + 2;
            else if (dp[i][buf] + 2 < dp[i][j]) dp[i][j] = dp[i][buf] + 2;
        }
    }
}
long MIN = dp[a][a];
if (b == 1)
{
    MIN = INF;
    for (int i = 1; i <= a; ++i) if (dp[a][i] < MIN) MIN = dp[a][i];
    cout << MIN;
    return 0;
}
a = b;
for (int i = 0; i <= a; ++i)
    for (int j = 0; j <= a; ++j) dp[i][j] = INF;

dp[1][1] = MIN;
for (int i = 1; i <= a; ++i)
{
    for (int buf = 1; buf <= i; ++buf)
    {
        long tmp = dp[i - buf][buf] + 2;
        if (tmp < dp[i][buf]) dp[i][buf] = tmp;
        for (int j = 1; j < buf; ++j)
        {
            if (dp[i][j] + 2 < dp[i][buf]) dp[i][buf] = dp[i][j] + 2;
            else if (dp[i][buf] + 2 < dp[i][j]) dp[i][j] = dp[i][buf] + 2;
        }
    }
}
MIN = INF;
for (int i = 1; i <= a; ++i) if (dp[a][i] < MIN) MIN = dp[a][i];
cout << MIN;
return 0;

}

опубликовано 22.08.2022, 07:41:03

Good afternoon. Conditional question. Is it possible to insert the copied one in any place of the rectangle A*B, or does it necessarily touch those rectangular squares that were inserted before? color tunnel

опубликовано 11.09.2022, 14:30:50

wordle unlimited is a day by day recreation that may be performed greater than as soon as a day with the problem growing in comparison with the unique wordle. In Wordle, there are a lot of techniques you should use to develop your abilities. The sport Wordle includes guessing eight words concurrently throughout eight boards. It entails appropriately guessing eight words in 13 tries. play wordle provides you the choice to publish your answer to the 8 Misterius Words puzzle on social media. Share with your mates!