Вопрос по c++ – различные комбинации значений вектора

0

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded High Performance Mark

Ваш Ответ

3   ответа
0

vector resultVec;
while (!inputVec.empty)
{
    char c = inputVec.pop_back();

    foreach(one in resultVec)
    {
         combined = combine c and one;
         resultVec.push_back(combined);
    }

    resultVec.push_back(c);
}
0

Error: User Rate Limit Exceededcombinations.

Error: User Rate Limit Exceededmy_combinationsError: User Rate Limit ExceededcombinationsError: User Rate Limit Exceeded

Error: User Rate Limit ExceededcombinationsError: User Rate Limit Exceeded

6

Error: User Rate Limit Exceeded0Error: User Rate Limit Exceeded2^vector.size() - 1Error: User Rate Limit Exceededvector[i]Error: User Rate Limit Exceeded

vector<char> v;
v.push_back('a');
v.push_back('b');
v.push_back('c');
for (int counter = 0; counter < (1 << v.size()); ++counter)
{
    vector<char> combination;
    for (int i = 0; i < v.size(); ++i)
    {
        if (counter & (1 << i))
            combination.push_back(v[i]);
    }

    // do something with combination
}

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded shn

Похожие вопросы